[vserver] how to limit cpu without CGroup

From: songjun435 <songjun435_at_gmail.com>
Date: Wed 07 Mar 2012 - 12:51:11 GMT
Message-ID: <2012030720510310996410@gmail.com>

I want to limit cpu of the vps. From the document,there are two methods:
the first one is to use the cgroup to limit the cpu;
the second one is to use the commond 'vattribute' 'vsched'.
But as I knowmy linux kernel is 2.6.18 which do not support the cgroup. So I only to use the second method.

Then I do it as following(my cpu has 16 processors):
1.vserver test start
2.vattribute --set --xid 42 --flag sched_hard
42 is the contextID of test
3.vsched --xid 42 --fill-rate 1 --interval 4 --tokens-max 50000 --token-min 2500 --idle-time --force
   Above commond set the test vps most occupy 1/4(25%) proportion of the CPU
   that is the hard cpu limit of the test vps is 25%

4.then I enter the vps,and execute 8 Transcoding programmes 'ffmpeg',
  then I execute top to check the cpu status:
   it shows that the cpu has been used 50%, which mean the 8 ffmpeg programmes occupy 50% of the cpu, not 25% which is the hard cpu limit.

So, could anyone know why there is no effect on the cpu limit after I use 'vattribute''vsched' to set the hard limit of CPU?
How should I do to limit CPU without CGroup?
I will appreciate it if you give some clue.

Received on Wed Mar 7 12:51:33 2012

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 07 Mar 2012 - 12:51:33 GMT by hypermail 2.1.8