Check the CPU and memory load in linux.
$ Vmstatprocs ----------- memory ---------- --- swap -- ----- io ---- system -- ----- cpu ------ r B swpd free buff cache si so bi bo in cs us sy id wa st 1 4 329796 26040 4528 1 50 160 36 17 2 10 85 3 0 results are explained as follows: the procsr column indicates the number of processes that run and wait for the cpu time slice. If the number is greater than 1 for a long time, the cpu is insufficient and the cpu needs to be increased. Column B indicates the number of processes waiting for resources, such as waiting for I/O or memory switching. Cpu indicates the cpu usage status. The us column shows the percentage of CPU time consumed in user mode. When the value of us is high, it indicates that the user process consumes a lot of cpu time. However, if it is longer than 50%, you need to consider optimizing your program. The sy column shows the percentage of cpu time consumed by the kernel process. Here, the reference value of us + sy is 80%. If the value of us + sy is greater than 80%, there may be insufficient CPU. The wa column shows the percentage of CPU time occupied by IO wait. The reference value of wa is 30%. If wa exceeds 30%, the IO wait is serious, which may be caused by a large number of random access to the disk, it may also be caused by the bandwidth bottleneck of the disk or disk access controller (mainly block operations ). The id column shows the percentage of time when the cpu is idle. The system displays the number of interrupts occurred during the collection interval. The in column shows the number of device interruptions per second observed during a certain time interval. The cs column indicates the number of context switches generated per second. If cs is much higher than the disk I/O and network information packet rate, further investigation should be conducted. The number of memories that memoryswpd switches to the memory swap area (k indicates ). If the value of swpd is not 0, or it is relatively large, for example, if it exceeds 100 m, as long as the value of si and so is 0 for a long time, system performance is still normal free the number of memory in the current idle page list (k indicates) the number of buff memory used as the buffer cache. Generally, buffer is required for reading and writing Block devices. Cache: The amount of memory that is used as the page cache. Generally, it is used as the cache of the file system. If the cache is large, it indicates that there are many files in the cache. If the bi in IO is small at this time, it indicates that the file system is more efficient. The number of swapsi switches from memory to memory swap zone. So the number of memory entries in the memory swap zone. The total amount of data IObi reads from Block devices (read disk) (kb per second ). Total data written to bo Block devices (disk write) (kb per second)
How to view the status of the current Linux system, such as CPU usage, memory usage, and load
There is a tool named top in linux. You can run it as root.
If not, you may need to install
How can I view Linux cpu/memory/Hard Disk/IO and other data?
Cpu top view process and cpu usage
View cpu load in uptime
Memory is free. Check the memory. The virtual memory-m is displayed in megabytes.
Hard Disk df-hT to view the usage of each partition.-h is displayed in G units.-T is the system type of the partition.
Iostat-x 1 allows you to view disk IO information.