Subject: vserver and cgroups
From: Scott Baker <smbaker@gmail.com>
Date: Thu, 23 Dec 2010 15:38:51 -0800

I'm using util-vserver-0.30.216 on a 2.6.27 distribution. My questions
have to do with limiting CPU use to vservers using the cgroups
mechanism.

1) When I ssh into a particular vserver, the processes spawned as the
result of the ssh, namely a bash shell and it's resulting
subprocesses, are not associated with the cgroup of that vserver. They
remain associated with the root cgroup. I assume this is because sshd
is running as a task in the root cgroup. Is there something I'm doing
wrong or an easy way to fix this? Alternatively I can look into
patching this myself, if anyone has any helpful pointers, please send
them by. I have a lot of jobs that get started via ssh sessions and
they're not getting the benefit of the cgroup scheduling.

2) The next question I have is a general cgroup issue. I would like to
give one vserver exclusive use of a CPU so that no other vserver may
use that cpu. The brute-force approach to do this is to set
/dev/cgroup/<vserver>/cpuset.cpus for that cpu and to remove that cpu
from the cpuset.cpus for every other vserver. If I want to give one
vserver exclusive use of a CPU, then I need to touch the cpuset for
every other vserver to remove that CPU. Am I missing anything here?

Thanks,
Scott