OpenVZ Forum


Home » General » Support » Process in OpenVZ. (Which ContaINER)
Process in OpenVZ. [message #41410] Mon, 17 January 2011 11:44 Go to next message
maas187 is currently offline  maas187
Messages: 1
Registered: January 2011
Junior Member
Hi to All,

I have a linux system running openzv , with over 10 containers .

When i run the command ps -ef , i see all the processes running on system.

the question is how would i know which process is for what system. without entering the containers.


Thank you
Re: Process in OpenVZ. [message #41411 is a reply to message #41410] Mon, 17 January 2011 13:11 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

Hi,

use vzpid it display the CT ID given the process ID (PID)

% vzpid <PID>

Bye,
Thorsten
Re: Process in OpenVZ. [message #41418 is a reply to message #41410] Tue, 18 January 2011 17:34 Go to previous messageGo to next message
nuno is currently offline  nuno
Messages: 43
Registered: January 2010
Member
cat /proc/PID/status will also tell you.
recent versions of htop also support openvz and can display CTID if configured to do so.

[Updated on: Tue, 18 January 2011 17:35]

Report message to a moderator

Re: Process in OpenVZ. [message #41654 is a reply to message #41418] Sun, 13 February 2011 05:21 Go to previous messageGo to next message
pyite is currently offline  pyite
Messages: 20
Registered: January 2007
Junior Member
Cool feature! htop rocks.

Is there any way to find the classic Virtuozzo utility called "vztop"? It would aggregate performance for each VE and show one VE per line in top.


Re: Process in OpenVZ. [message #41666 is a reply to message #41654] Sun, 13 February 2011 21:27 Go to previous messageGo to next message
curx
Messages: 739
Registered: February 2006
Location: Nürnberg, Germany
Senior Member

@pyite: vztop and vzps are located in vzprocps package, see http://download.openvz.org/contrib/utils/

Bye,
Thorsten
Re: Process in OpenVZ. [message #43616 is a reply to message #41666] Sun, 02 October 2011 08:52 Go to previous messageGo to next message
Rene is currently offline  Rene
Messages: 40
Registered: September 2006
Member
How do you get this to work on a 64 bit hardware node? It complains that glibc is not installed, but it is - in 64bit version though. I expect that's the problem...

# rpm -Uvh vzprocps*
warning: vzprocps-2.0.11-6.13.swsoft.i386.rpm: Header V3 DSA/SHA1 Signature, key ID 2425c37e: NOKEY
error: Failed dependencies:
libc.so.6 is needed by vzprocps-2.0.11-6.13.swsoft.i386
libc.so.6(GLIBC_2.0) is needed by vzprocps-2.0.11-6.13.swsoft.i386
libc.so.6(GLIBC_2.1) is needed by vzprocps-2.0.11-6.13.swsoft.i386
libc.so.6(GLIBC_2.3) is needed by vzprocps-2.0.11-6.13.swsoft.i386
libncurses.so.5 is needed by vzprocps-2.0.11-6.13.swsoft.i386

# rpm -q glibc
glibc-2.12-1.25.el6.x86_64

[Updated on: Sun, 02 October 2011 10:44]

Report message to a moderator

Re: Process in OpenVZ. [message #43618 is a reply to message #43616] Sun, 02 October 2011 13:14 Go to previous messageGo to next message
Sadist is currently offline  Sadist
Messages: 10
Registered: November 2009
Location: Bulgaria
Junior Member

install i686 version of glibc
also you need a ncurses.i386 and ncurses.x86_64 installed on your system

glibc.i686 : The GNU libc libraries.
ncurses.i386 : A terminal handling library
ncurses.x86_64 : A terminal handling library

yum install -y glibc.i686 ncurses.x86_64 ncurses.i386 


Debian GNU/Linux user since - Debian 2.2 (Potato)
SysAdmin & Customer Support Ninja

[Updated on: Sun, 02 October 2011 13:18]

Report message to a moderator

Re: Process in OpenVZ. [message #43623 is a reply to message #41410] Sun, 02 October 2011 23:32 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
A bit worrying is that stock procps 2.0.11 was released way back in Dec 2002. This swsoft's vzprocps package seems to be a patched Red Hat 9 version, released in 2003 and supported into 2006.

I'm not familiar with the code itself so I can't tell if this could be a problem of any kind. But it sure is getting a bit old.

Using the binary seems to be the only way. Rebuilding this source rpm on a modern distro won't work since build needs -fwritable-strings and this is deprecated since gcc 3.4 and removed in gcc 4.0.

Could anyone perhaps port these vz patches to a newer procps version?

Anyway, htop is also in EPEL and Fedora. The rpms need to be rebuilt to enable openvz support (--enable-openvz configure switch). Since it has to be rebuilt anyway, I'm using the 0.9 version from Fedora 16 and rebuild it for our systems.

If anyone goes down this path, here is what needs to be done afterwards: within htop press F2 for setup, move down to "columns", move to the far left and move down to find "VPID", press F5 to add and F10 to finish. The VPID column will show the openvz VM's ID. Quite nice!
Re: Process in OpenVZ. [message #43625 is a reply to message #41410] Mon, 03 October 2011 05:08 Go to previous messageGo to next message
Rene is currently offline  Rene
Messages: 40
Registered: September 2006
Member
Thanks much! I had to install ncurses-libs.i686 to install libncurses.so.5 and now vzprocps installs ok.

Still doesn't run though, both vztop and vzps falls over with alternatively "Floating point exception" and "Segmentation fault":

# vztop -C
01:06:10 up 2 days, 21:02, 1 user, load average: 0.12, 0.12, 0.06
631 processes: 629 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 4.0% user 0.8% system 0.0% nice 5.6% iowait 788.0% idle
Floating point exception
# vztop -C
01:06:10 up 2 days, 21:02, 1 user, load average: 0.12, 0.12, 0.06
631 processes: 629 sleeping, 2 running, 0 zombie, 0 stopped
CPU states: 4.0% user 0.8% system 0.0% nice 5.6% iowait 788.0% idle
Segmentation fault

# vzps
Segmentation fault
Re: Process in OpenVZ. [message #43635 is a reply to message #41410] Tue, 04 October 2011 00:40 Go to previous messageGo to next message
Ales is currently offline  Ales
Messages: 330
Registered: May 2009
Senior Member
Is this on a 2.6.32 RHEL kernel? Looks related to this buffer overflow bug:

http://bugzilla.openvz.org/show_bug.cgi?id=1654 (patch available).

Also in regards to my previous post about "-fwriteable-strings" not being available any more, others have noticed too:

http://bugzilla.openvz.org/show_bug.cgi?id=950 (patch available).

I thought it would have other consequences and didn't research further, but it's just a simple configure tweak. Well, I should look at the Bugzilla more closely in the future and save myself some time.

Anyway, looks like vzprocps would need a bit of love & attention.
Re: Process in OpenVZ. [message #43676 is a reply to message #43635] Thu, 06 October 2011 08:44 Go to previous message
Rene is currently offline  Rene
Messages: 40
Registered: September 2006
Member
Yes this is on 2.6.32-042stab037.1, Scientific Linux 6.1.

> Anyway, looks like vzprocps would need a bit of love & attention

Absolutely! I can't understand how this tool has not been updated for years. It should be a cornerstone in managing an OpenVZ server!

Another tool I REALLY miss from Virtuozzo is vzstat or something similar showing a list with the load of each container on a hardware node, like below. Actually it could probably be improved a lot, but a tool that would just show the important key values like CPU, memory, IO, loadavg for starters would be really cool.

 11:38am, up 382 days,  5:21,  1 user, load average: 3.59, 3.87, 4.35
CTNum 24, procs 1699: R   4, S 1687, D   5, Z   3, T   0, X   0
CPU [ OK ]: CTs 100%, CT0   0%, user  42%, sys  58%, idle   0%, lat(ms) 371/49
Mem [ OK ]: total 12160MB, free 465MB/5MB (low/high), lat(ms) 1/0
Swap [ OK ]: tot 3961MB, free 3944MB, in 0.000MB/s, out 0.000MB/s
Net [ OK ]: tot: in  0.000MB/s    0pkt/s, out  0.000MB/s    0pkt/s
Disks [ OK ]: in 0.000MB/s, out 147.703MB/s

  CTID ST    %VM     %KM        PROC     CPU     SOCK FCNT MLAT IP
     1 OK 1.2/-   0.2/-     0/89/MAX 0.01/2.5  68/MAX    0    3 192.168.40.239
   303 OK 2.3/-   0.5/-     0/75/MAX 3.05/3.3  78/MAX    0   11 xx.yy.251.73
   305 OK 2.3/-   0.9/-     2/87/MAX 19.0/5.6 109/MAX    0  371 xx.yy.158.189
   307 OK 2.5/-   0.3/-     0/36/MAX 0.00/3.3  19/MAX    0    0 xx.yy.251.70
   310 OK 0.5/-   0.1/-     0/31/MAX 0.00/4.4  18/MAX    0    1 xx.yy.158.185
   318 OK 1.8/-   0.4/-     0/62/MAX 11.9/4.4  70/MAX    0    1 xx.yy.144.18
   401 OK 4.6/-   0.5/-     0/83/MAX 0.07/5.6  65/MAX    0    3 xx.yy.216.146
   402 OK 1.2/-   0.2/-     0/45/MAX 0.01/4.4  22/MAX    0    1 xx.yy.144.23
   403 OK 1.2/-   0.3/-     0/65/MAX 0.03/3.3  58/MAX    0    1 xx.yy.144.29
   406 OK 3.7/-   0.4/-     0/92/MAX 0.02/5.6  95/MAX    0    1 xx.yy.144.27
   407 OK 0.9/-   0.3/-     0/69/MAX 0.03/3.3  54/MAX    0    1 xx.yy.144.15
   409 OK 2.7/-   0.3/-     0/74/MAX 0.12/4.4  55/MAX    0    3 xx.yy.144.25
   410 OK 1.5/-   0.3/-     0/57/MAX 0.02/3.3  53/MAX    0    1 xx.yy.144.7
   414 OK 2.0/-   0.3/-     0/57/MAX 0.00/4.4  43/MAX    0    1 xx.yy.251.66
   417 OK 1.3/-   0.3/-     0/55/MAX 0.00/4.4  49/MAX    0   37 xx.yy.144.12
   418 OK 0.5/-   0.1/-     0/36/MAX 0.00/2.1  27/MAX    0    0 xx.yy.158.163
   423 OK 4.1/-   0.5/-    0/120/MAX 0.02/5.6 144/MAX    0    4 xx.yy.144.28
   425 OK 1.3/-   0.2/-     0/43/MAX 0.02/2.1  44/MAX    0    1 xx.yy.144.4
   426 OK 0.9/-   0.3/-     0/64/MAX 0.02/2.1  46/MAX    0    0 xx.yy.144.6
   427 OK 1.7/-   0.3/-     0/72/MAX 0.00/4.4  57/MAX    0    1 xx.yy.158.173
   428 OK 2.2/-   0.3/-     0/67/MAX 0.61/5.6  50/MAX    0    6 xx.yy.216.147
   430 OK 0.3/-   0.2/-     0/37/MAX 0.00/4.4  22/MAX    0    0 xx.yy.158.188
   431 OK 0.1/-   0.1/-     0/19/MAX 0.00/2.1  13/MAX    0    1 xx.yy.251.75
   432 OK 1.5/-   0.3/-     0/59/MAX 0.00/8.9  82/MAX    0    7 xx.yy.158.180


I hacked up this quick-n-dirty script that produce a usable output, even if it ain't too pretty:

#
clear
while true
do
tput cup 0 0
top -cbn1 | head -12
echo
for x in `vzlist -o veid -H`; do /bin/echo "$x: `vzctl exec $x cat /proc/loadavg `"; done
echo
iostat -dmN | grep -v ^sd
sleep 10
done


You might need to change the iostat line depending on your disks and configuration.

[Updated on: Thu, 06 October 2011 13:00]

Report message to a moderator

Previous Topic: Tasks hanging cause node to reboot/stall
Next Topic: Kernel upgrade from 2.6.18 to 2.6.32
Goto Forum:
  


Current Time: Tue Nov 19 00:42:23 GMT 2024

Total time taken to generate the page: 0.02984 seconds