Use of vmstat

Source: Internet
Author: User
Article Title: Use of vmstat. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Vmstat is a comprehensive performance analysis tool that allows you to observe the process status, memory usage, virtual memory usage, disk I/O, interruption, context switching, and CPU usage of the system.

Run the vmstat 1 command as the root user in the system to observe the performance. The meanings of each parameter value can be found below:

  Vmstat

  Procs

R:

Number of processes running and waiting (CPU time slice). This value can also determine whether to increase the CPU (more than 1 for a long time)

B:

Number of processes that are in the non-disruptive state, which is usually caused by IO.

  Memory

Swpd: Switch to swap memory (in KB by default)

If the value of swpd is not 0, or it is still relatively large, for example, more than m, but the value of si and so is 0 for a long time, we don't have to worry about this situation, it won't affect the system performance.

Free: idle physical memory

Buff: As the buffer cache memory, buffer reading/writing of Block devices

Cache: Memory Used as the page cache, the cache of the file system

If the cache value is large, it indicates that the number of files in the cache is large. If files frequently accessed can be cached, the disk read IO bi will be very small.

  Swap

Si: swap memory usage, transferred from disk to memory

So: swap memory usage, transferred from memory to disk

When the memory is sufficient, both values are 0. If the two values are greater than 0 for a long time, the system performance will be affected. Both disk IO and CPU resources are consumed.

When we often see that the free memory is very small or close to 0, we think that the memory is not enough. In fact, we cannot simply look at this point. We also need to combine si and so. If the free memory is very small, however, si and so are few (mostly 0), so don't worry, the system performance will not be affected at this time.

  Io

Bi: total data read from Block devices (read disk) (KB/s ),

Bo: data written to block devices (written to disk) (KB/s)

When reading and writing random disks, the larger the two values (such as 1 M), the larger the CPU value in the IO wait

  System

In: The number of interruptions per second.

Cs: Number of context switches generated per second

The larger the two values above, the more CPU time consumed by the kernel will be seen

  Cpu

Us: Percentage of CPU time consumed by user processes

When the value of us is relatively high, it indicates that the user process consumes a lot of CPU time. However, if the CPU usage exceeds 50% for a long time, we should consider optimizing the program algorithm or accelerating it.

Sy: Percentage of CPU time consumed by kernel Processes

When the sy value is high, it indicates that the system kernel consumes many CPU resources, which is not a benign performance. We should check the cause.

Wa: Percentage of CPU time consumed by I/O wait

When the value of wa is high, the IO wait is serious, which may be caused by a large number of random access to the disk, or the bandwidth bottleneck of the disk (block operation ).

Id: percentage of time when the CPU is idle

What information is output by vmstat worth noting?

Procs r: many processes are running and the system is busy.

Io bo: the volume of data written to the disk is a little large. If it is a large file, you don't have to worry about writing within 10 MB. If it is a small file, writing within 2 Mb is basically normal.

Cpu us: it lasts for more than 50 and is acceptable during peak service hours.

Cpu wa: slightly higher

Cpu id: lasting less than 50, acceptable during peak Service Hours

Source Address http://blog.3gcomet.com/article.asp? Id = 437

Related Article

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.