Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Application of vmstat output method under linux

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "the use of vmstat output method under linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the use of vmstat output method under linux".

Vmstat

Procs-memory-----swap- io---system- cpu--

R b swpd free buff cache si so bi bo in cs us sy id wa

00 100152 2436 97200 289740 01 34 45 99 33 00 99 0

Procs

The r column represents the number of processes running and waiting for cpu time slices. If it is greater than 1 for a long time, it means that cpu is insufficient and cpu needs to be added.

The b column represents the number of processes waiting for resources, such as waiting for Imax O, memory swapping, and so on.

Cpu indicates the usage status of cpu

The us column shows the percentage of CPU time spent in user mode. When the value of us is high, it means that the user process consumes more cpu time, but if the long-term value is greater than 50%, you need to consider optimizing the user's program.

The sy column shows the percentage of cpu time spent by kernel processes. Here, the reference value of us+sy is 80%. If the us+sy is greater than 80%, there may be insufficient CPU.

The wa column shows the percentage of CPU time spent waiting for IO. Here, the reference value of wa is 30%. If the wa exceeds 30%, it means that the IO wait is serious, which may be caused by a large number of random access to the disk, or by the bandwidth bottleneck of the disk or disk access controller (mainly block operation).

The id column shows the percentage of time that cpu has been idle

System shows the number of interrupts that occurred during the acquisition interval

The in column represents the number of device interrupts per second observed during a time interval.

The cs column indicates the number of context switches per second, such as when the cs rate is much higher than disk IPUBO and network packets, further investigation should be carried out.

Memory

The amount of memory (represented by k) that swpd switches to the memory swap. If the value of swpd is not 0 or is relatively large, for example, if it exceeds 100m, as long as the value of si and so is 0 for a long time, the system performance is still normal.

Amount of memory in free's current list of free pages (k represents)

Buff, as the amount of memory of buffer cache, generally needs to be buffered for reading and writing to block devices.

Cache: as the amount of memory of the page cache, it is generally used as the cache of the file system. If the cache is large, more files are used for cache. If the bi in the IO is relatively small, the file system is more efficient.

Swap

The number of si entering memory swap area from memory.

So enters the amount of memory from the memory swap.

IO

The total amount of data that bi reads from the block device (read disk) (kb per second).

Total amount of data written by bo block devices (write to disk) (kb per second)

The bi+bo reference value we set here is 1000. If the value exceeds 1000 and the wa value is large, disk load balancing should be considered, which can be analyzed in combination with iostat output.

The vmstat command output is divided into six parts:

(1) process procs:

R: the number of processes waiting in the run queue.

B: the number of processes waiting for io.

(2) memory memoy:

Swpd: currently available swap memory (in KB).

Free: free memory (in KB).

Buff: the number of memory buffered out (in KB).

Cache: the amount of memory used for caching (in KB).

(3) swap exchange page

Si: the number of swapped pages swapped from disk to memory, in KB/ seconds.

So: the number of swapped pages swapped from memory to disk, in KB/ seconds.

(4) io block equipment:

Bi: the number of blocks sent to the block device, in blocks per second.

Bo: the number of blocks received from the block device, in blocks per second.

(5) system system:

In: number of interrupts per second, including clock interrupts.

Cs: number of environment (context) switches per second.

(6) cpu CPU:

Cs: the time spent by the user process. Expressed as a percentage.

Sy: the time used by the system process. Expressed as a percentage.

Id: idle time of the CPU. Expressed as a percentage.

If r is often greater than 4 and id is often less than 40, the CPU is heavily loaded. If bi,bo is not equal to 0 for a long time, the physical memory capacity is too small.

At this point, I believe you have a deeper understanding of "the use of vmstat output methods under linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report