my kernel is 184.108.40.206-vs220.127.116.11,It does not support cgroup.
Seemingly,the cgroup is supported after 2.6.26version.
I user yum to install libcgroup in my OS like this:
yum install libcgroup
but there is no avaliable package.
so can I use cgroup in the 18.104.22.168 kernel?
If yes,what should I do?
Thank you very much!
From: Claus Herwig
Date: 2012-03-01 08:16
Subject: Re: [vserver] how to limit the cpu and memory of the vps?
>> does anyont know how to limit the cpu and memory of the vps?
as I learned just yesterday on IRC, that page isn't really uptodate
Short version for memory cgroup:
Grab a not too old kernel with the necessary kernel config parameters
set, and a recent util-vserver.
For me (Debian squeeze) kernel 22.214.171.124-vs126.96.36.199.39-beng and
util-vserver 0.30.216-pre3000, both from repo.psand.net, did work out of
Type "mount" to verify that /dev/cgroup is mounted and has the necessary
mount options. You'll want rw,cpuset,cpu,cpuacct,memory at least. And
you don't want the ns option. (With mentioned versions the util-vserver
init script did all that on system startup.)
Make sure your vserver config tree has cgroup directories.
mkdir -p /etc/vservers/.defaults/cgroup
mkdir -p /etc/vservers/<vsname>/cgroup
See what memory limits you have on your running vserver:
memory.limit_in_bytes is the physical RSS hard limit (what the rss.hard
rlimit was in earlier days)
memory.memsw.limit_in_bytes is the limit for physical RAM + Swap
together (I think this was rss.soft in earlier days)
Set some sensible limits for the running vserver:
echo "2G" >/dev/cgroup/<vsname>/memory.limit_in_bytes
echo "3G" >/dev/cgroup/<vsname>/memory.memsw.limit_in_bytes
Make the limits permanent:
echo "2G" >/etc/vservers/<vsname>/memory.limit_in_bytes
echo "3G" >/etc/vservers/<vsname>/memory.memsw.limit_in_bytes
Treat your vserver to a realistic memory display:
echo "VIRT_MEM" >>/etc/vservers/<vsname>/flags
CHECON EDV-Consulting und Redaktion
Claus Herwig * Barer Straße 70 * 80799 München
+49 89 27826981 * Fax 27826982 * firstname.lastname@example.org
Received on Thu Mar 1 01:49:08 2012