I want to see resource utilization data that is concise and easy to read. What is the quickest and easiest way to show that?
Environment
- Red Hat Enterprise Linux 4, 5
Issue
- I want to see resource utilization data that is concise and easy to read. What is the quickest and easiest way to show that?
Resolution
- Try using the
vmstatcommand. This command gives you an overview of process, memory, swap, I/O, system, and CPU activity in one line of numbers. The first line divides the fields in six categories, including process, memory, swap, I/O, system, and CPU related statistics. The second line further identifies the contents of each field, making it easy to quickly scan data for specific statistics.
The process-related fields are:
-
r - The number of runnable processes waiting for access to the CPU
-
b - The number of processes in an uninterruptible sleep state
The memory-related fields are:
-
swpd - The amount of virtual memory used
-
free - The amount of free memory
-
buff - The amount of memory used for buffers
-
cache - The amount of memory used as page cache
The swap-related fields are:
-
si - The amount of memory swapped in from disk
-
so - The amount of memory swapped out to disk
The I/O-related fields are:
-
bi - Blocks sent to a block device
-
bo - Blocks received from a block device
The system-related fields are:
-
in - The number of interrupts per second
-
cs - The number of context switches per second
The CPU-related fields are:
-
us - The percentage of the time the CPU ran user-level code
-
sy - The percentage of the time the CPU ran system-level code
-
id - The percentage of the time the CPU was idle
-
wa - I/O wait
-
When vmstat is run without any options, only one line is displayed. This line contains averages, calculated from the time the system was last booted.
-
However, most system administrators do not rely on the data in this line, as the time over which it was collected varies. Instead, most administrators take advantage of vmstat's ability to repetitively display resource utilization data at set intervals. For example, the command
vmstat 1displays one new line of utilization data every second, while the commandvmstat 1 10displays one new line per second, but only for the next ten seconds.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.