Re: [vserver] vserver and cgroups

From: Jean Weisbuch <>
Date: Mon 31 Mar 2014 - 15:45:31 BST
Message-ID: <>


I havent tried a 3.13 kernel yet but these informaitons are applicable
to 3.10 kernels (and olders too).

With the util-vserver supplied on the BenG repository you dont need to
manually mount the cgroups, memory limit support should be loaded

As for modifying limits on /etc/vservers/<guest>/cgroup/memory, the
limits will only be used at the VServer start, not if the VServer is
already running.
You can change the live value on : /dev/cgroup/<guest>/memory.* (wont be
kept at reboot).

I am not sure that putting an "*G" argument will work, i personally use
integer values such as :
        VSERVERNAME=thevservername MEMLIMITGB=4

        [[ ! -d "/etc/vservers/${VSERVERNAME}/cgroup" ]] && mkdir
        echo $((${MEMLIMITGB}*1024*1024*1024)) >
        echo $((${MEMLIMITGB}*1024*1024*1024)) >
        perl -i -pe 's/^#(virt_mem)/\1/' /etc/vservers/${VSERVERNAME}/cflags
        echo $((${MEMLIMITGB}*1024*1024*1024)) >
        echo $((${MEMLIMITGB}*1024*1024*1024)) >

On 31/03/2014 16:37, Tomasz Pajor wrote:
> Hi,
> I have problem with setting up memory limit on a vserver.
> I'm using 3.13.6-vs2.3.6.11-beng from
> Steps
> - added "cgroup_enable=memory swapaccount=1" to GRUB_CMDLINE_LINUX
> - added "none /dev/cgroup cgroup cpu,cpuset,memory 0 0" to /etc/fstab
> of the guest
> - mkdir /etc/vservers/.defaults/cgroup
> - mkdir /etc/vservers/<guest>/cgroup
> - echo "4G" > /etc/vservers/<guest>/cgroup/memory.limit_in_bytes
> - echo "8G" > /etc/vservers/<guest>/cgroup/memory.memsw.limit_in_bytes
> When I enter the guest, limits are not applied, also when I run
> vserver-stat I got "open(memory.stat): No such file or directory".
> Can anyone point out what am I doing wrong?
Received on Mon Mar 31 15:45:40 2014

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Mon 31 Mar 2014 - 15:45:40 BST by hypermail 2.1.8