Loadavg

From OpenVZ Virtuozzo Containers Wiki
Revision as of 15:16, 30 May 2012 by Kir (talk | contribs) (created)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Load average is a traditional UNIX metric. Load average value is the average number of processes that are either in a runnable or uninterruptable state during a particular time period. The three numbers shown are load averages for the last 1, 5, and 15 minutes.

A process in a runnable state is either using the CPU or waiting to use the CPU. A process in uninterruptable state is waiting for some I/O access, eg waiting for disk. The averages are taken over the three time intervals. Load averages are not normalized for the number of CPUs in a system, so a load average of 1 means a single CPU system is loaded all the time while on a 4 CPU system it means it was idle 75% of the time.

How to get container's load average

For a single specific container:

vzctl exec $CTID cat /proc/loadavg

For all or specified containers

vzlist -o ctid,laverage [CTID ...]

See vzlist(8) for details on vzlist.

Reasons for high load average

Two reasons for high load average is lack of CPU time or disk I/O bandwidth. For container, it can also be because of its limits, such as the CPU limit or low disk I/O priority.

For VSwap-enabled containers, one case is the lack of RAM (physpages). Whenever a RAM shortage occurs, system will start doing virtual swapping, delaying a given container to emulate the effect of a real swap-out.