[Vserver] "vserver enter" eating cpu and vkill problem

From: Philippe Teuwen <phil_at_teuwen.org>
Date: Fri 12 Jan 2007 - 18:18:42 GMT
Message-ID: <45A7D102.8030109@teuwen.org>

Hello,

Here are some problems I have with vserver.

My environment:
Kernel: Debian vserver_pre-patched kernel for AMD64:
Linux version 2.6.17-2-vserver-amd64 (Debian 2.6.17-9) (waldi@debian.org) (gcc version 4.1.2 20060901 (prerelease) (Debian 4.1.1-13)) #1 SMP Wed Sep 13 18:02:36 CEST 2006
According to changelog.Debian, this version is using vserver patch v2.0.2
util-vserver: 0.30.211-6

First problem:
In some situations my CPU was burning like hell for days before I noticed it.
This was the vcontext/login process, the one running when using the command "vserver XX enter".
If it happens that the process is disconnected from its terminal it eats all the CPU :-(

Apparently it happens when the session is not ended properly (disconnections, etc)
I could reproduce the problem as follow:
* ssh to the server as normal user
* sudo su -
* vserver XX enter
* now from another term, kill -9 on either of the two su processes ("su -" or "-su")
At that point the session in the vserver ends but vcontext is still hooked to the
current terminal so cpu is fine.
* now quit the current terminal
At that point vcontext is not hooked to any terminal (vps ax => "?" on the tty column)
and using top you see it's running 100% cpu, ~ 80% system and 20% user.

Second problem (cosmetic):
Depending on the tool, the process I was talking about in the previous problem appears
as vcontext (top, pgrep,... cat /proc/NNN/status)
or as login (ps ax, pgrep -f,... cat /proc/NNN/cmdline) or should I say
"login\0\0\0\0\0\0\0\0\0\0\0..."
This is quite disturbing using processes mgmt tools like when I wrote a cron
to detect cpu hangry vcontext processes to be killed :-)

Third problem I discovered when writing that watchdog:
Processes from guests are not displayed using ps/top/etc in context 0 (ps ax from host)
but well in context 1 (e.g. vps ax).
Fine.
But if I want to kill one of them:

host:~# vserver devel enter
devel:~# top

--- in another host term ---
host:~# ps -C top
  PID TTY TIME CMD
host:~# vps -C top
  PID CONTEXT TTY TIME CMD
17111 31022 devel pts/13 00:00:00 top
host:~# vkill 17111
vkill: vc_ctx_kill(): No such process
host:~# chcontext --ctx 1 ps -C top
  PID TTY TIME CMD
17111 pts/13 00:00:00 top
host:~# chcontext --ctx 1 kill 17111
<no error but nothing happens neither: >
host:~# vps -C top
 PID CONTEXT TTY TIME CMD
17111 31022 devel pts/13 00:00:00 top
host:~# kill 17111
host:~# vps -C top
 PID CONTEXT TTY TIME CMD
<worked!!>

This is not the behaviour I expected.

Apart from that I'm happy running vserver for almost a year with now 6 guests.

Phil

PS: nothing particular here when I ran testme.sh
Linux-VServer Test [V0.17] Copyright (C) 2003-2006 H.Poetzl
chcontext is working.
chbind is working.
Linux 2.6.17-2-vserver-amd64 #1 SMP Wed Sep 13 18:02:36 CEST 2006 x86_64
Ea 0.30.211 236/glibc (DSa) <compat,v11,fscompat,v13,net,v21,oldproc,olduts>
VCI: 0002:0002 236 03000016 (TbLgnP)

---
[000]# succeeded.
[001]# succeeded.
[011]# succeeded.
[031]# succeeded.
[101]# succeeded.
[102]# succeeded.
[201]# succeeded.
[202]# succeeded.
_______________________________________________
Vserver mailing list
Vserver@list.linux-vserver.org
http://list.linux-vserver.org/mailman/listinfo/vserver
Received on Fri Jan 12 18:54:14 2007
[Next/Previous Months] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Fri 12 Jan 2007 - 18:54:20 GMT by hypermail 2.1.8