New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Script to show OpenVZ container process informtion
Microlinux
Member
Here is a little Python script to show OpenVZ container process info from the hardware node.
I only have a minimal dev system to test on. If any values look wrong, let me know.
Must be run as root, requires iotop.
https://dl.dropboxusercontent.com/u/19515814/vzpsi
vzpsi [-s sort_field (pid)] [-n show_top_n (all)] [-q] [ctid]
-s is one of ctid, name, pid, ppid, cpu, mem, io_rd, io_wr
-n is an integer
-q suppresses output header
If no ctid is specified, all processes are shown.
sudo ./vzpsi -s mem -n 5 101
ctid name pid ppid cpu mem (rss) io_rd io_wr
---- -------------- ------- -------- ------ ---------- --------- ---------
101 httpd 12691 12155 0.0 % 3.6 MB 0 KB/s 0 KB/s
101 httpd 13371 12691 0.0 % 3.0 MB 0 KB/s 0 KB/s
101 httpd 12694 12691 0.0 % 2.9 MB 0 KB/s 0 KB/s
101 sendmail 12675 12155 0.0 % 2.3 MB 0 KB/s 0 KB/s
101 sendmail 12683 12155 0.0 % 2.0 MB 0 KB/s 0 KB/s
Thanked by 1serverian
Comments
I updated this to fix I/O speeds and add IOPs.
Some internal changes as well. Removed external dependencies, cleaned things up.
nice work. will try out in one of our nodes
Cool, let me know if you see anything funky`
Very good. But I'm a bit sceptic about /proc/%s/io I'm not sure if it's the correct values.
I'm fairly certain it is, it has checked out against tests I have run (i.e. ioping) -- but it's certainly possible there are situations where it may not be. If you happen to notice anything that seems overtly wrong, please let me know.