172
edits
Changes
Initial revision of the article
==Problem==
Quite a few people complain at the forum that <tt> vzlist</tt> command outputs wrong proccess number (e.g. http://forum.openvz.org/index.php?t=tree&goto=12664&#msg_12664). Look:
<pre>
[root@HN ~] # vzlist
VPSID NPROC STATUS IP_ADDR HOSTNAME
1001 63 running xx.yy.136.88 promo.HN.com
1002 12 running xx.yy.138.6 video.HN.com
1003 24 running xx.yy.136.86 db.HN.com
[root@HN ~] # vzctl exec 1001 ps aux | wc -l
13
[root@HN ~] # vzctl exec 1002 ps aux | wc -l
14
[root@HN ~] # vzctl exec 1003 ps aux | wc -l
17
</pre>
As you see, the number is false for VE 1001 and 1003, but is correct for VE 1002 (14 = 12 + 1 (wc command) + 1 (ps command)).
==Disclosure==
The thing is that <tt>ps aux</tt> command outputs only "full-fledged" processes, but not threads. And `vzlist` command counts all processes in VE including threads. <tt>ps -eLf</tt> command allows you to see all processes:
<pre>
[root@HN ~] # vzctl exec 1001 ps aux | wc -l
65
[root@HN ~] # vzctl exec 1002 ps aux | wc -l
14
[root@HN ~] # vzctl exec 1003 ps aux | wc -l
26
</pre>
Now the outputs suite each other.
[[Category:Troubleshooting]]
Quite a few people complain at the forum that <tt> vzlist</tt> command outputs wrong proccess number (e.g. http://forum.openvz.org/index.php?t=tree&goto=12664&#msg_12664). Look:
<pre>
[root@HN ~] # vzlist
VPSID NPROC STATUS IP_ADDR HOSTNAME
1001 63 running xx.yy.136.88 promo.HN.com
1002 12 running xx.yy.138.6 video.HN.com
1003 24 running xx.yy.136.86 db.HN.com
[root@HN ~] # vzctl exec 1001 ps aux | wc -l
13
[root@HN ~] # vzctl exec 1002 ps aux | wc -l
14
[root@HN ~] # vzctl exec 1003 ps aux | wc -l
17
</pre>
As you see, the number is false for VE 1001 and 1003, but is correct for VE 1002 (14 = 12 + 1 (wc command) + 1 (ps command)).
==Disclosure==
The thing is that <tt>ps aux</tt> command outputs only "full-fledged" processes, but not threads. And `vzlist` command counts all processes in VE including threads. <tt>ps -eLf</tt> command allows you to see all processes:
<pre>
[root@HN ~] # vzctl exec 1001 ps aux | wc -l
65
[root@HN ~] # vzctl exec 1002 ps aux | wc -l
14
[root@HN ~] # vzctl exec 1003 ps aux | wc -l
26
</pre>
Now the outputs suite each other.
[[Category:Troubleshooting]]