Re: [Vserver] vserver cpu scheduling

From: Herbert Poetzl <herbert_at_13thfloor.at>
Date: Thu 23 Nov 2006 - 19:29:31 GMT
Message-ID: <20061123192931.GH2826@MAIL.13thfloor.at>

On Tue, Nov 21, 2006 at 10:05:07AM +0100, Andreas Baetz wrote:
> Hi,
>
> I updated to another kernel (2.6.18.2) and another vserver version
> (vs2.0.2.2-rc6), and I think the hard cpu scheduling doesn't work as
> expected.

works here as expected (with 2.6.18.3-vs2.0.2.2-rc8)

> What I'm trying to do is to limit the CPU cycles for xid 8004 (deb4).
>
> In vserver 8004 the following command is running:
>
> cat /dev/zero | gzip | gzip | gzip > /dev/null

hmm, strange, could you try with the following sequence
(see links for the sources) and let me know what top
and vtop report on that?

  vcmd -i 666 -BC ctx_create .flagword=^34^33^32^8 -- cpuhog

that is supposed to put a hog in xid=666 which should
get roughly 25% cpu (which is the default setting)

http://vserver.13thfloor.at/Experimental/TOOLS/cpuhog.c
http://vserver.13thfloor.at/Experimental/TOOLS/vcmd-0.05.tar.bz2

TIA,
Herbert

> vtop shows:
> top - 09:55:24 up 18:05, 11 users, load average: 1.12, 0.67, 0.33
> Tasks: 167 total, 3 running, 164 sleeping, 0 stopped, 0 zombie
> Cpu(s): 86.4%us, 13.3%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.3%hi, 0.0%si, 0.0%st
> Mem: 904876k total, 875096k used, 29780k free, 131580k buffers
> Swap: 1003960k total, 0k used, 1003960k free, 355168k cached
>
> PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
> 14417 root 25 0 1820 656 276 R 91.1 0.1 2:26.04 gzip
>
> According to the shedule (see below), the CPU should be limited to
> 100*3/20 = 15 %
>
> additional info:
>
> host:/tmp# vserver --version
> vserver 0.30.211 -- manages the state of vservers
> This program is part of util-vserver 0.30.211
>
> Copyright (C) 2003,2004,2005 Enrico Scholz
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License. This program has absolutely no warranty.
>
> host:/tmp# bash ./testme.sh-0.16 -v
> Linux-VServer Test [V0.16] Copyright (C) 2003-2006 H.Poetzl
> chcontext is working.
> chbind is working.
> chcontext 0.30.211 -- allocates/enters a security context
> This program is part of util-vserver 0.30.211
>
> Copyright (C) 2004 Enrico Scholz
> This program is free software; you may redistribute it under the terms of
> the GNU General Public License. This program has absolutely no warranty.
> Linux 2.6.18.2-vs2.0.2.2-rc6.061120 #1 PREEMPT Mon Nov 20 15:33:17 CET 2006 i686
> Ea 0.30.211 273/glibc (DSa) <compat,v11,fscompat,v13,net,oldproc,olduts>
> VCI: 0002:0002 273 03000036 (TbLgnP)
> (root@host)
> (gcc version 4.1.2 20061115 (prerelease)
> (Debian 4.1.1-20))
> #1 PREEMPT Mon Nov 20 15:33:17 CET 2006
> ---
> # chcontext true && chcontext --xid 45678 true
> # succeeded.
> # chcontext --xid 45678 egrep 'context|VxID' /proc/self/status
> # succeeded.
> # chcontext --secure --xid 45678 mknod /tmp/testme.sh-0.16.cB7844/node c 0 0
> # succeeded.
> # chcontext --hostname zaphod.7841 uname -a | grep -q zaphod.7841
> # succeeded.
> # chbind --ip 192.168.0.42 true
> # succeeded.
> # chbind --ip 192.168.0.1/255.255.255.0 --ip 10.0.0.1/24 true
> # succeeded.
> # chcontext --xid 45678 --flag fakeinit bash -c 'test $$ -eq 1'
> # succeeded.
> # chcontext --flag fakeinit bash -c 'test $$ -eq 1'
> # succeeded.
>
> host:/tmp# vserver-stat
> CTX PROC VSZ RSS userTIME sysTIME UPTIME NAME
> 0 151 1.3G 547.1M 1h31m06 9m29s29 16h20m45 root server
> 1 1 2.2M 1.1M 0m03s11 0m04s68 45m04s93 monitoring server
> 8003 8 118.8M 37.8M 1m32s14 0m13s57 16h18m07 deb3
> 8004 7 23M 7.4M 0m00s30 0m00s00 43m14s33 deb4
> host:/tmp# cat /etc/vservers/deb4/flags
> sched_hard
>
> host:/tmp# cat /etc/vservers/deb4/schedule
> 3
> 20
> 500
> 10
> 500
> 0
>
> host:/tmp# cat /proc/virtual/8004/status
> UseCnt: 30
> Tasks: 11
> Flags: 0000000202020110
> BCaps: 00000000344c04ff
> CCaps: 0000000000000101
> Ticks: 0
>
> host:/tmp# cat /proc/virtual/8004/sched
> Token: 500
> FillRate: 3
> Interval: 20
> TokensMin: 10
> TokensMax: 500
> PrioBias: 0
> VaVaVoom: 0
> cpu 0: 0 0 0
> host:/tmp# uname -a
> Linux host 2.6.18.2-vs2.0.2.2-rc6.061120 #1 PREEMPT Mon Nov 20 15:33:17 CET 2006 i686 GNU/Linux
>
> host:/tmp# grep -i vserver /usr/src/linux-2.6.18.2/.config
> # Linux VServer
> CONFIG_VSERVER_LEGACY=y
> # CONFIG_VSERVER_LEGACY_VERSION is not set
> CONFIG_VSERVER_LEGACYNET=y
> CONFIG_VSERVER_PROC_SECURE=y
> CONFIG_VSERVER_HARDCPU=y
> # CONFIG_VSERVER_HARDCPU_IDLE is not set
> # CONFIG_VSERVER_DEBUG is not set
> CONFIG_VSERVER=y
> CONFIG_VSERVER_SECURITY=y
>
>
> **********************************************************************
> This email and any files transmitted with it are confidential and
> intended solely for the use of the individual or entity to whom they
> are addressed. If you have received this email in error please notify
> the system manager.
> **********************************************************************
>
> _______________________________________________
> 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
Received on Thu Nov 23 19:34:11 2006

[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Thu 23 Nov 2006 - 19:34:17 GMT by hypermail 2.1.8