[Users] Dstat plugin for OpenVZ CPU statistics

Dag Wieers dag at wieers.com
Mon Oct 23 03:25:15 EDT 2006


On Tue, 17 Oct 2006, Kirill Korotaev wrote:

> I think the following statistics are helpful for OpenVZ:
> 
> - per VE UBC fail counters (failcnt in /proc/user_beancounters).
>   I would draw a delta between 2 screen updates and if it is non-zero
>   draw it in red.

I wrote a new vzubc plugin for this and renamed the vz plugin to vzcpu. 
It only displays the per VE failcnt or the total failcnt. 
Feedback welcome.

[root at itmphys01 dstat]# ./dstat -c -Mvzcpu,vzubc
Module dstat_vzcpu is still experimental.
Module dstat_vzubc is still experimental.
----total-cpu-usage---- -total-ve-usage total
usr sys idl wai hiq siq|usr sys idl nic|_fcnt
  0   0  98   1   0   0|  0   0 100   0|8471 
  0   0 100   0   0   0|  0   0 100   0|   0 
  0   0 100   0   0   0|  0   0 100   0|   0 
  0   0  97   4   0   0|  0   0 100   0|   0 
  1   0 100   0   0   0|  0   0 100   0|   9 
  0   0  97   2   0   0|  0   0 100   0|   3 
  0   0 100   0   0   0|  0   0 100   0|   0 

[root at itmphys01 dstat]# ./dstat -c -Mvzcpu,vzubc -f
Module dstat_vzcpu is still experimental.
Module dstat_vzubc is still experimental.
-------cpu0-usage--------------cpu1-usage------ --ve-301-usage----ve-302-usage- -301---302-
usr sys idl wai hiq siq:usr sys idl wai hiq siq|usr sys idl nic:usr sys idl nic|_fcnt:_fcnt
  0   0  99   1   0   0:  0   0  98   2   0   0|  0   0 100   0:  0   0 100   0|8470     0 
  0   0 100   0   0   0:  0   0 100   0   0   0|  0   0 100   0:  0   0 100   0|   0     0 
  0   0 100   0   0   0:  1   0  99   0   0   0|  0   0  99   0:  0   0 100   0|   4     0 
  0   0 100   0   0   0:  0   0 100   0   0   0|  0   0 100   0:  0   0 100   0|   5     0 
  0   0 100   0   0   0:  0   0 100   0   0   0|  0   0 100   0:  0   0 100   0|   3     0 
  0   0  96   4   0   0:  1   1  91   7   0   0|  0   0 100   0:  0   0 100   0|   2     0 

Non-zero is displayed in color.


> - per VE memory limit (kmemsize + privvmpages) and current usage
>   (kmemsize + oomguarpages). Same, if kmemsize or privvmpages
>   failcnt is increasing, then it can be drawn in red.

How do I have to look at this ?

	used = kmemsize + oomguarpages
	total = kmemsize + privvmpages

	percentage used : used * 100 / total


> - per VE CPU usage. This one can be calculated from /proc/fairsched2
>   here are some details on this:
>   http://forum.openvz.org/index.php?t=tree&th=479&mid=2771&&rev=&reveal=

Is my current implementation wrong ? It seems to provide correct 
information. Except maybe for the nice-value. I have never seen it 
different from zero.

I also don't understand what the idle/strv/uptime values are.


> - per VE and global CPU and memory latency.

I have no clue to what CPU and memory latency means. What is the value 
displayed in ? How to visualize ?


> - per VE disk I/O stats (stats not available yet).
> - per VE network stats (there is no generic stats yet).

I'm obviously interested in both as well.

Are there any other counters that proof useful, like eg. number of 
interrupts, number of context-switches, loadavg etc. Are things like that 
available from openvz ?

dstat needs some infrastructure to pass options/arguments to plugins. At 
this point that is not possible, limiting the user to specify either the 
total, or the per VE for _all_ VEs. This of course is pretty annoying if 
you have 50 VEs on a system :)

I'm considering a syntax like this:

	dstat -M vzcpu:total;301;302 -M vzubc:total;301;302

Kind regards,
--   dag wieers,  dag at wieers.com,  http://dag.wieers.com/   --
[all I want is a warm bed and a kind word and unlimited power]


More information about the Users mailing list