Editing
Util-vserver:Cgroups
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span class="editsection">[<nowiki/>[[index.php?title=util-vserver:Cgroups&action=edit§ion=5|edit]]]</span> <span class="mw-headline"> cgroup and CFS based CPU hard limiting that replaces sched_hard </span> == <span id="References"></span> <span id="edit-references"></span> === <span class="editsection">[<nowiki/>[[index.php?title=util-vserver:Cgroups&action=edit§ion=6|edit]]]</span> <span class="mw-headline">References</span> === You can find documentation about the CFS hard limiting in <code>Documentation/scheduler/sched-cfs-hard-limits.txt</code> inside your kernel source dir. <span id="Requirements"></span> <span id="edit-requirements"></span> === <span class="editsection">[<nowiki/>[[index.php?title=util-vserver:Cgroups&action=edit§ion=7|edit]]]</span> <span class="mw-headline">Requirements</span> === This feature is currently available in <code>patch-2.6.31.2-vs2.3.0.36.15.diff</code> and is in testing phase as of this patch set so report any bugs to the mailing list. To get the hard limit setup on every vServer start you need a recent utils package. It worked for me with: <code>0.30.216-pre2864</code>. (Download from [http://people.linux-vserver.org/~dhozac/t/uv-testing/ util-vserver prereleases]) Before trying to setup limits for one guest you should mount the cgroup filesystem: <pre>[ -d /dev/cgroup ] || mkdir /dev/cgroup mount -t cgroup -ocpu none /dev/cgroup</pre> <span id="Configuration"></span> <span id="edit-configuration"></span> === <span class="editsection">[<nowiki/>[[index.php?title=util-vserver:Cgroups&action=edit§ion=8|edit]]]</span> <span class="mw-headline">Configuration</span> === Example for an upper bound of 2/5th (or 40%) of the all CPU power that a guest/cgroup can useΒ : <pre> # force CFS hard limit (only needed for older kernel versions) # echo 1 > /etc/vservers/<guestname>/cgroup/cpu.cfs_hard_limit # time assigned to guest (in microseconds) 200000 = 0,2 sec echo 200000 > /etc/vservers/<guestname>/cgroup/cpu.cfs_runtime_us # in each specified period (in microseconds) 500000 = 0,5 sec echo 500000 > /etc/vservers/<guestname>/cgroup/cpu.cfs_period_us</pre> This limit is an hard limit, see it like an upper wall for the resources used by the cgroup. If you set both CPU share AND hard limit the system will do fine but hard limits takes priority over CPU share scheduling, so CPU share will do the job but each cgroup will have an upper bound that it cannot cross even if the CPU share you gave it is higher. The hard limit feature adds 3 cgroup files for the CFS group scheduler: * <code>cfs_runtime_us</code>: Hard limit for the group in microseconds. * <code>cfs_period_us</code>: Time period in microseconds within which hard limits is enforced. * <code>cfs_hard_limit</code>: The control file to enable or disable hard limiting for the group. <br /> <span id="using_cgroup_to_enforce_memory_limits"></span> <span id="edit-using-cgroup-to-enforce-memory-limits"></span>
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information