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

How to judge whether the Linux system is healthy?

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

Share

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

This article mainly shows you "how to judge whether the Linux system is healthy", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "how to judge whether the Linux system is healthy" this article.

When it comes to checking the health of the system, most friends may consider viewing the process or opening the task manager, but for linux systems applied to servers in real production environments, the above two methods are not effective viewing methods. Today, I would like to recommend a very practical way to care about the health of the system running in the linux system-'vmstat' command.

Vmstat command is a very practical Linux/Unix monitoring tool, which can directly browse the running status of the system at a given time interval, including server CPU utilization, memory usage, virtual memory swap, hard disk, memory read and write. Compared to top, it allows managers to see the CPU, memory, and IO usage of the entire machine, not just the CPU usage and memory utilization of a single process. Of course, this is not to say that only vmstat is used instead of top, in fact, the two are used in different production environments.

The use of the vmstat tool is accomplished by two numeric parameters: * the given number of time intervals in seconds, and the second parameter is the number of views.

For example:

1: given time interval, 1 second

3: number of views

Of course, if you do not check the number of times, it will continue to monitor, if you do not want to monitor, then simply stop the vmstat, which is also a common operation in the real production environment.

As shown in the figure, I keep running vmstat, check it eight times a second, and then stop.

Next, let's explain the meaning of all the parameters displayed by this command.

R: run queue (that is, how many processes are actually assigned to CPU). When this value exceeds the number of CPU, there will be a CPU bottleneck.

B: indicates a blocked process.

Swpd: the amount of virtual memory used. A value greater than 0 indicates that the device is out of physical memory.

Free: the amount of free physical memory.

Buff: cache of directory contents and permission levels in the system

Cache: cache is directly used for file buffering. (the linux system uses part of the free physical memory to cache files and directories to improve the performance of program execution. When a program uses memory, buffer/cached is quickly used.)

Si: the amount of virtual memory read from disk per second. If this value is greater than 0, physical memory is insufficient or memory is leaked. You need to find a process that consumes a lot of memory to solve it.

So: the amount of virtual memory written to disk per second. If this value is greater than 0, it also means that the memory is not used enough.

Bi: the number of blocks received by block devices per second. Here, block devices refer to all disks and other block devices on the system. The default block size is 1024.

Bo: for the number of blocks sent by block devices per second, the values of bi and bo are generally close to 0, otherwise the input and output are too frequent and need to be adjusted.

In: the number of interrupts per second of CPU, including time interrupts.

Cs: the number of context changes per second, for example, when a user calls a system function, it is necessary to change the context. Thread switching also requires process context switching. The smaller the value, the better. If it is too large, you should consider reducing the number of threads or processes.

Us: user CPU time, user space time in running state.

Sy: the CPU time of the system, the time of the system space in the running state. If it is too high, it means that the system call time is long.

Note: us+sy= process time (cpu time)

Id: idle CPU time, generally speaking, id + us + sy = 100

Wt: wait for IO (input / output) CPU time.

The above is all the contents of the article "how to judge whether the Linux system is healthy or not". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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