Linux View system performance common commands __linux

Source: Internet
Author: User
Tags switches time interval cpu usage

explanation of Vmstat result content

Vmstat

procs-----------Memory----------      ---swap--  ----- IO----      --system--  -----CPU------
         r b   swpd   free    buff       cache   si   so      bi    bo          in   cs          US sy ID WA St
& nbsp;       2 0   88   199564 134860 1175252   0     0        0   352         9323 10496     8 6   0 0


Procs
The R column represents the number of processes running and waiting for the CPU time slice, if longer than 1, indicating that the CPU is low and needs to be increased.
Column B indicates the number of processes waiting on the resource, such as waiting for I/O, or memory swapping.

Memory
The amount of memory that SWPD switches to the memory Swap area (k). If the value of SWPD is not 0, or relatively large, such as over 100m, as long as SI, so the value of long-term 0, system performance is still normal
Free amount of memory in the current list of idle pages (k)
Buff as buffer cache memory quantity, generally to the block device to read and write only need to buffer.
Cache: As page cache of memory, generally as a file system cache, if the cache is larger, indicating that the cache used more files, if the IO in the bi relatively small, indicating file system efficiency is better.

Swap
Si by memory into the memory swap area number.
So from the memory swap area into the amount of memory.

Io
The total amount of data that bi reads from a block device (read disk) (KB per second).
The total amount of data written by a Bo block device (write disk) (KB per second)
Here we set the Bi+bo reference value of 1000, if more than 1000, and the WA value should be considered balanced disk load, can be combined with iostat output to analyze.

System displays the number of interrupts that occurred during the collection interval
The in column represents the number of device interrupts per second observed during a time interval.
The CS column represents the number of context switches generated per second, such as when CS is much higher than disk I/O and network packet rates, and should be investigated further.

CPU indicates the CPU usage state
The US column shows the percentage of CPU time spent in user mode. US is a high value, indicating that the user process consumes more CPU time, but if it is longer than 50%, you need to consider optimizing the user's program.
The SY column shows the percentage of CPU time spent by the kernel process. The reference value for us + sy is 80%, and if Us+sy is greater than 80%, there may be a lack of CPU.
The WA column shows the percentage of CPU time that the IO wait takes. The reference value for WA is 30%, and if WA exceeds 30%, the IO wait is serious, possibly due to a large amount of random access to the disk or the bandwidth bottleneck of the disk or disk access controller (mostly block operations).
The ID column shows the percentage of time that the CPU is idle

The Vmstat command output is divided into six sections:
(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: Swap memory currently available (in kilobytes).
Free: Idle memory (in kilobytes).
Buff: Buffers The number of memory (in kilobytes).
Cache: The amount of memory that is used as the cache (in kilobytes).
(3) Swap page
Si: The number of swap pages exchanged from disk to memory, in units: kb/seconds.
So: the number of swap pages from memory to disk, in units: kb/seconds.
(4) IO block device:
BI: The number of blocks sent to the block, in units: Block/sec.
Bo: The number of blocks received from the block device, in units: Block/sec.
(5) System systems:
In: The number of interrupts per second, including clock interrupts.
CS: The number of ambient (context) switches per second.
(6) CPU central Processor:
CS: 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 processing Unit. expressed as a percentage.

If R is often greater than 4, and the ID is often less than 40, the CPU load is heavy.

If the Bi,bo is not equal to 0 for a long time, the physical memory capacity is too small.

Check the performance of the system. 1 CPU Usage Analysis

The following metrics measure the load on the CPU.

Overall utilization:

[Root@linux stone]sar-u 5 5
Linux 2.4.21-4.ELSMP (linux1) 01/04/05

18:00:17 CPU%user%nice%system%idle
18:00:22 All 1.50 0.00 0.93 97.57
18:00:27 All 16.02 0.00 4.74 79.24
18:00:32 All 5.69 0.00 3.77 90.53
18:00:37 All 0.79 0.00 1.10 98.11
18:00:42 All 2.69 0.00 1.21 96.10
Average:all 5.15 0.00 2.24 92.61

Gets the usage of the specified CPU number (in multiple CPUs)
[Root@linux stone]sar-u 0
Linux 2.4.21-4.ELSMP (linux1) 01/04/05
00:00:00 CPU%user%nice%system%idle
00:10:00 0 1.10 0.00 0.83 98.36
00:20:00 0 0.55 0.00 0.78 97.52
00:30:00 0 0.97 0.00 0.77 98.57
00:40:00

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.