0054.html: Difference between revisions

From Linix VServer
Jump to navigationJump to search
(Restored content from Wayback Machine)
 
(Restored content from Wayback Machine)
Tag: Manual revert
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<div class="links">
<div class="links">


'''[Vserver] &quot;vserver enter&quot; eating cpu and vkill problem:'''<br />
'''Re: [vserver] Getting a real pid 1 init in a container:'''<br />
 <span class="small">vserver development mailing list</span> <br />
 <span class="small">vserver development mailing list</span> <br />
[<nowiki/>[[../|Next/Previous Months]]] [<nowiki/>[http://www.solucorp.qc.ca/miscprj/s_context.hc Main vserver Project Homepage]] [<nowiki/>[http://www.solucorp.qc.ca/mlist/index.hc?list=vserver Howto Subscribe/Unsubscribe]] [<nowiki/>[http://www.paul.sladen.org/vserver/ Paul Sladen's vserver stuff]]
[<nowiki/>[[../|Next/Previous Months]]] [<nowiki/>[http://www.solucorp.qc.ca/miscprj/s_context.hc Main vserver Project Homepage]] [<nowiki/>[http://www.solucorp.qc.ca/mlist/index.hc?list=vserver Howto Subscribe/Unsubscribe]] [<nowiki/>[http://www.paul.sladen.org/vserver/ Paul Sladen's vserver stuff]]
Line 8: Line 8:
<div class="head">
<div class="head">


<span id="vserver-vserver-enter-eating-cpu-and-vkill-problem"></span>
<span id="re-vserver-getting-a-real-pid-1-init-in-a-container"></span>
= [Vserver] &quot;vserver enter&quot; eating cpu and vkill problem =
= Re: [vserver] Getting a real pid 1 init in a container =


* <span class="dfn">This message</span>: [ [[#start|Message body]] ] [ [[#options2|More options]] ]
* <span class="dfn">This message</span>: [ [[#start|Message body]] ] [ [[#options2|More options]] ]
* <span class="dfn">Related messages</span>: [ [[0055.html|Next message]] ] [ [[0053.html|Previous message]] ] [ [[0055.html|Next in thread]] ] [ [[#replies|Replies]] ]
* <span class="dfn">Related messages</span>: [ [[0055.html|Next message]] ] [ [[0053.html|Previous message]] ] [ [[0052.html|In reply to]] ]




Line 18: Line 18:
<div class="mail">
<div class="mail">


<span id="from"> <span class="dfn">From</span>: Philippe Teuwen &lt;[mailto:phil_at_teuwen.org?Subject=Re:%20%5BVserver%5D%20&quot;vserver%20enter&quot;%20eating%20cpu%20and%20vkill%20problem phil_at_teuwen.org]&gt; </span><br />
<span id="from"> <span class="dfn">From</span>: Grzegorz Nosek &lt;[mailto:grzegorz.nosek_at_gmail.com?Subject=Re:%20%5Bvserver%5D%20Getting%20a%20real%20pid%201%20init%20in%20a%20container grzegorz.nosek_at_gmail.com]&gt; </span><br />
<span id="date"><span class="dfn">Date</span>: Fri 12 Jan 2007 - 18:18:42 GMT</span><br />
<span id="date"><span class="dfn">Date</span>: Wed 21 Mar 2012 - 18:22:20 GMT</span><br />
<span id="message-id"><span class="dfn">Message-ID</span>: &lt;45A7D102.8030109@teuwen.org&gt; </span><br />
<span id="message-id"><span class="dfn">Message-ID</span>: &lt;4F6A1C5C.3070009@gmail.com&gt; </span><br />


Hello,<br />
W dniu 21.03.2012 16:47, Grzegorz Nosek pisze:<br />
''&gt; A basically working patch attached. One weird side effect is that the''<br />
''&gt; container init and its children are not visible in `vps auxf` (they''<br />
''&gt; remain visible in `vps aux` though).''<br />




Here are some problems I have with vserver.<br />
Attached v2, this one is actually working *too* well -- the process tree<br />
is shown *twice* on some occasions ;) Also, upstart works like a charm<br />
(start/stop etc.)<br />




My environment:<br />
This is another bug I won't fix today -- gotta go:<br />
Kernel: Debian vserver_pre-patched kernel for AMD64:<br />
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<br />
According to changelog.Debian, this version is using vserver patch v2.0.2<br />
util-vserver: 0.30.211-6<br />




First problem:<br />
debian:/proc/sys/vserver# grep Tgid /proc/1/status<br />
In some situations my CPU was burning like hell for days before I noticed it.<br />
Tgid: 1<br />
This was the vcontext/login process, the one running when using the command &quot;vserver XX enter&quot;.<br />
debian:/proc/sys/vserver# chcontext --xid 1 -- grep Tgid /proc/1/status<br />
If it happens that the process is disconnected from its terminal it eats all the CPU :-(<br />
Tgid: 1<br />
debian:/proc/sys/vserver# chcontext --xid 948 -- grep Tgid /proc/1/status<br />
Tgid: 1<br />
debian:/proc/sys/vserver# chcontext --xid 1 -- grep Tgid /proc/1/status<br />
Tgid: 2219<br />




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




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




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


* text/x-patch attachment: [[att-0054/0001-Actually-use-VServer-context-reaper.patch|0001-Actually-use-VServer-context-reaper.patch]]


host:~# vserver devel enter<br />
devel:~# top<br />


 
</div>
--- in another host term ---<br />
<span id="received"><span class="dfn">Received on</span> Wed Mar 21 18:38:55 2012</span>
host:~# ps -C top<br />
  PID TTY TIME CMD<br />
host:~# vps -C top<br />
  PID CONTEXT TTY TIME CMD<br />
17111 31022 devel pts/13 00:00:00 top<br />
host:~# vkill 17111<br />
vkill: vc_ctx_kill(): No such process<br />
host:~# chcontext --ctx 1 ps -C top<br />
  PID TTY TIME CMD<br />
17111 pts/13 00:00:00 top<br />
host:~# chcontext --ctx 1 kill 17111<br />
&lt;no error but nothing happens neither: &gt;<br />
host:~# vps -C top<br />
 PID CONTEXT TTY TIME CMD<br />
17111 31022 devel pts/13 00:00:00 top<br />
host:~# kill 17111<br />
host:~# vps -C top<br />
 PID CONTEXT TTY TIME CMD<br />
&lt;worked!!&gt;<br />
 
 
This is not the behaviour I expected.<br />
 
 
Apart from that I'm happy running vserver for almost a year with now 6 guests.<br />
 
 
Phil<br />
 
 
PS: nothing particular here when I ran testme.sh<br />
Linux-VServer Test [V0.17] Copyright (C) 2003-2006 H.Poetzl<br />
chcontext is working.<br />
chbind is working.<br />
Linux 2.6.17-2-vserver-amd64 #1 SMP Wed Sep 13 18:02:36 CEST 2006 x86_64<br />
Ea 0.30.211 236/glibc (DSa) &lt;compat,v11,fscompat,v13,net,v21,oldproc,olduts&gt;<br />
VCI: 0002:0002 236 03000016 (TbLgnP)<br />
 
 
<pre>
---
[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</pre>
<span id="received"><span class="dfn">Received on</span> Fri Jan 12 18:54:14 2007</span>


</div>
</div>
Line 134: Line 65:


* <span class="dfn">This message</span>: [ [[#start|Message body]] ]
* <span class="dfn">This message</span>: [ [[#start|Message body]] ]
* <span class="dfn">Next message</span>: [[0055.html|Peter Mann: &quot;Re: [Vserver] &quot;vserver enter&quot; eating cpu and vkill problem&quot;]]
* <span class="dfn">Next message</span>: [[0055.html|Steve Kieu: &quot;Re: [vserver] IPtables, network namespaces&quot;]]
* <span class="dfn">Previous message</span>: [[0053.html|Jarek Dylag: &quot;Re: [Vserver] kernel panic patch-2.6.19.1-vs2.1.1.7.diff&quot;]]
* <span class="dfn">Previous message</span>: [[0053.html|Jarry: &quot;Re: [vserver] IPtables, network namespaces&quot;]]
* <span class="dfn">Next in thread</span>: [[0055.html|Peter Mann: &quot;Re: [Vserver] &quot;vserver enter&quot; eating cpu and vkill problem&quot;]]
* <span class="dfn">In reply to</span>: [[0052.html|Grzegorz Nosek: &quot;Re: [vserver] Getting a real pid 1 init in a container&quot;]]
* <span id="replies"></span><span class="dfn">Reply</span>: [[0055.html|Peter Mann: &quot;Re: [Vserver] &quot;vserver enter&quot; eating cpu and vkill problem&quot;]]
* <span class="dfn">Reply</span>: [[0062.html|Daniel Hokka Zakrisson: &quot;Re: [Vserver] &quot;vserver enter&quot; eating cpu and vkill problem&quot;]]


* <span id="options2"></span><span class="dfn">Contemporary messages sorted</span>: [ [[date.html#54|By Date]] ] [ [[index.html#54|By Thread]] ] [ [[subject.html#54|By Subject]] ] [ [[author.html#54|By Author]] ] [ [[attachment.html|By messages with attachments]] ]
* <span id="options2"></span><span class="dfn">Contemporary messages sorted</span>: [ [[date.html#54|By Date]] ] [ [[index.html#54|By Thread]] ] [ [[subject.html#54|By Subject]] ] [ [[author.html#54|By Author]] ] [ [[attachment.html|By messages with attachments]] ]
Line 147: Line 76:


[<nowiki/>[[../|Next/Previous Months]]] [<nowiki/>[http://www.solucorp.qc.ca/miscprj/s_context.hc Main vserver Project Homepage]] [<nowiki/>[http://www.solucorp.qc.ca/mlist/index.hc?list=vserver Howto Subscribe/Unsubscribe]] [<nowiki/>[http://www.paul.sladen.org/vserver/ Paul Sladen's vserver stuff]]<br />
[<nowiki/>[[../|Next/Previous Months]]] [<nowiki/>[http://www.solucorp.qc.ca/miscprj/s_context.hc Main vserver Project Homepage]] [<nowiki/>[http://www.solucorp.qc.ca/mlist/index.hc?list=vserver Howto Subscribe/Unsubscribe]] [<nowiki/>[http://www.paul.sladen.org/vserver/ Paul Sladen's vserver stuff]]<br />
<span class="small">Generated on Fri 12 Jan 2007 - 18:54:20 GMT by [http://www.hypermail.org/ hypermail 2.1.8]</span>
<span class="small">Generated on Wed 21 Mar 2012 - 18:38:55 GMT by [http://www.hypermail.org/ hypermail 2.1.8]</span>


</div>
</div>

Latest revision as of 02:12, 11 November 2025

Re: [vserver] Getting a real pid 1 init in a container[edit]


From: Grzegorz Nosek <grzegorz.nosek_at_gmail.com>
Date: Wed 21 Mar 2012 - 18:22:20 GMT
Message-ID: <4F6A1C5C.3070009@gmail.com>

W dniu 21.03.2012 16:47, Grzegorz Nosek pisze:
> A basically working patch attached. One weird side effect is that the
> container init and its children are not visible in `vps auxf` (they
> remain visible in `vps aux` though).


Attached v2, this one is actually working *too* well -- the process tree
is shown *twice* on some occasions ;) Also, upstart works like a charm
(start/stop etc.)


This is another bug I won't fix today -- gotta go:


debian:/proc/sys/vserver# grep Tgid /proc/1/status
Tgid: 1
debian:/proc/sys/vserver# chcontext --xid 1 -- grep Tgid /proc/1/status
Tgid: 1
debian:/proc/sys/vserver# chcontext --xid 948 -- grep Tgid /proc/1/status
Tgid: 1
debian:/proc/sys/vserver# chcontext --xid 1 -- grep Tgid /proc/1/status
Tgid: 2219


Basically in xid==1 /proc/1 contains info about the last visited fakeinit.


Best regards,
  Grzegorz Nosek


Received on Wed Mar 21 18:38:55 2012

[[[../|Next/Previous Months]]] [Main vserver Project Homepage] [Howto Subscribe/Unsubscribe] [Paul Sladen's vserver stuff]
Generated on Wed 21 Mar 2012 - 18:38:55 GMT by hypermail 2.1.8