[Users] Getting CPU idle time of CT outside the CT

Pavel Snajdr lists at snajpa.net
Mon Jul 21 08:06:04 PDT 2014


Hello,

is there any way how to get CPU idle % of CT outside out of the CT?

We were trying to figure this out from /proc/vz/vestat, first try was to
divide used/idle, but idle seems to be accounted for all available
hwnode CPUs and used seems to be accounted for CPUs available to the CT;
in the end it was giving a pretty reasonable numbers in low CPU load
situations, but when the CT was maxing out its available CPUs, we were
getting 100+% CPU load.

Next thing we've tried is to look into user,nice and system values, but
there is no idle nor total number of available jiffies to compare to.

Another thing we've tried is to read /proc/stat from outside of the CT,
but that is a problem, since ve->veid is 0 when running a process to
read out /vz/root/<veid>/proc/stat.

Solution of a last resort seems to be to run mpstat (or equivalent)
inside of the CT via vzctl exec and watch its output. But that gives me
hundreds of unnecessary running processes - I need to monitor hundreds
of CTs per hwnode. That's kind of a pain :)

Is there any better way to do this or what am I doing wrong?

Our kernel is 042stab092.2.

- snajpa


More information about the Users mailing list