Linux vmstat command details

Source: Internet
Author: User


Linux vmstat command details the mstat command is used to obtain information about processes, virtual storage, page swap space, and CPU activity. This information reflects the system load. Output item category project description the number of tasks pending for execution by Procs r shows the number of tasks being executed and waiting for CPU resources. When this value exceeds the number of CPUs, a CPU bottleneck occurs. B Memory swpd is using the swap size. Unit: K. free Memory space. buff used buff size, buffer the cache used for reading and writing Block devices. The file system's cache inact www.2cto.com is active.
Swap si Swap memory usage, transferred from the disk to the memory so Swap memory usage, transferred from the memory to the disk IO bi the total amount of data read from the block device (read disk) (KB/s ), the data prime (written to disk) (KB/s) of the data written by bo to the block device the number of interruptions produced by System in per second the number of context switches produced by cs per second the greater the value above, we can see that the CPU time consumed by the kernel will be more CPU us the CPU time consumed by the user process % us value is relatively high, it indicates that the user process consumes more CPU time, however, if we use more than 50% for a long time, we should consider optimizing the program algorithm or accelerating it.
When the CPU time percentage consumed by the sy kernel process is high, it indicates that the system kernel consumes many CPU resources, which is not a benign performance. We should check the cause. When the percentage of CPU time consumed by id idle wa I/O wait is high, it indicates that the IO wait is serious, which may be caused by a large number of random access to the disk, it may also be the bottleneck of the disk bandwidth (block operation ). The command is relatively simple, but the relationship between memory, disk, and cpu is quite complex. You need to learn more about the related knowledge. Vmstat is short for Virtual Meomory Statistics (Virtual Memory Statistics). It monitors Virtual memory, processes, and CPU activity of the operating system. He makes statistics on the overall situation of the system. The disadvantage is that he cannot conduct in-depth analysis on a process. Generally, run the vmstat 5 5 command, which indicates delay5s and then counts 5 times. A summary of the data to reflect the real system conditions. # Vmstat 5 5 procs ----------- memory ---------- --- swap -- ----- io ---- system -- ---- cpu ---- r B swpd free buff cache si so bi bo in cs us sy id wa 1 0 62792 9116 88092 6 30 189 89 1061 569 17 28 54 2 0 62792 3400 9124 88092 0 00 14 884 4 14 81 0 0 0 434 62792 3400 0 00 14 9132 88092 4 15 81 0 1 0 62792 3400 9140 88092 0 00 14 868 6 20 74 0 1 0 418 62792 3400 0 00 15 9148 9 25 67 0
Linux memory monitoring vmstat command output is divided into six parts: www.2cto.com (1) process procs: r: Number of processes waiting in the running queue. B: Number of processes waiting for io. (2) Linux memory monitoring memory memoy: swpd: currently available swap memory (unit: KB ). Free: idle memory (unit: KB ). Buff: the number of buffer memories (unit: KB ). Cache: The amount of memory used as the cache (unit: KB ). (3) Linux memory monitoring swap switching page si: Number of switching pages from disk switching to memory, unit: KB/second. So: the number of pages exchanged from the memory to the disk. Unit: KB/second. (4) Linux memory monitoring io block device: bi: number of blocks sent to the block device, unit: block/second. Bo: number of blocks received from the block device. Unit: block/second. (5) Linux memory monitoring system: in: Number of interrupts per second, including clock interruptions. Cs: the number of environment (context) Conversions per second. Www.2cto.com (6) Linux memory monitoring cpu central processor: cs: the time used by the user process. Expressed as a percentage. Sy: the time used by the system process. Expressed as a percentage. Id: the idle time of the central processor. Expressed as a percentage. If r is often greater than 4 and the id is often less than 40, it indicates that the central processor is under heavy load.
If bi and bo are not equal to 0 for a long time, the physical memory capacity is too small.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.