On Fri, Mar 16, 2007 at 06:54:26PM -0700, Albert Mak (almak) wrote: > Hi, > > I have Linux (2.6.14.3 Kernel) with Vserver 2.0.1 and testing the CPU > limit capabilities. I have 2 vserver contexts both running CPU intensive > app capable of using up 100% CPU, I am setting up on vserver to limit 1 > context to 10% CPU and the 2nd to 80% CPU, both using flags sched_prio. > I am seeing CPU usage split 50/50 between the 2 contexts. I repeated the > same test using sched_hard with the same result (kernel VSERVER_HARDCPU > config set to y). I am expecting to see at least the CPU usage close to > the Vserver limits. > > Have I got the wrong settings or some other issues. Your help is really > appreciated. > > -Albert > > top - 18:37:04 up 26 min, 1 user, load average: 2.04, 1.40, 0.62 > Tasks: 127 total, 3 running, 124 sleeping, 0 stopped, 0 zombie > Cpu(s): 98.7% us, 1.3% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi, > 0.0% si > Mem: 513084k total, 115660k used, 397424k free, 10200k buffers > Swap: 0k total, 0k used, 0k free, 39332k cached > > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > 6616 root 20 0 1332 228 184 R 49.8 0.0 2:23.12 > exceed_cpu_limi > 6513 root 20 0 1336 232 184 R 48.1 0.0 2:43.79 > exceed_cpu_limi > > -bash-2.05b# vps > PID CONTEXT TTY TIME CMD > 3672 0 MAIN pts/0 00:00:00 bash > 6513 2 APP1 pts/0 00:03:01 exceed_cpu_limi > 6616 3 APP2 pts/0 00:02:40 exceed_cpu_limi > 7655 1 ALL_PROC pts/0 00:00:00 vps > 7656 1 ALL_PROC pts/0 00:00:00 ps > > -bash-2.05b# pwd > /etc/vservers/APP1 > -bash-2.05b# cat flags > sched_prio
you want to add sched_hard here if you want hard scheduling, the prio scheduler will only adjust priorities according to the token buckets ... I'd also suggest to use a more recent kernel (and probably Linux-VServer patch) than this one as the scheduler was enhanced quite a lot in 2.2.x > -bash-2.05b# cat schedule > 80 > 100 > 200 > 50 > 140 > dummy > > -bash-2.05b# pwd > /etc/vservers/APP2 > -bash-2.05b# cat flags > sched_prio > -bash-2.05b# cat schedule > 10 > 100 > 200 > 50 > 140 > dummy > > -bash-2.05b# cat /proc/virtual/2/sched > Token: 140 > FillRate: 1 > Interval: 100 > TokensMin: 50 > TokensMax: 140 > PrioBias: 0 > VaVaVoom: -5 > cpu 0: 229674 71 0 > > -bash-2.05b# cat /proc/virtual/3/sched > Token: 140 > FillRate: 10 > Interval: 100 > TokensMin: 50 > TokensMax: 140 > PrioBias: 0 > VaVaVoom: -5 > cpu 0: 217275 54 0 looks like none of the token buckets is active here, what does the /proc/virtual/2/status show? TIA, Herbert > _______________________________________________ > Vserver mailing list > Vserver@list.linux-vserver.org > http://list.linux-vserver.org/mailman/listinfo/vserver _______________________________________________ Vserver mailing list Vserver@list.linux-vserver.org http://list.linux-vserver.org/mailman/listinfo/vserver