First, Vmstat
Vmstat is a monitoring tool in Linux/unix that shows the status of a server at a given time interval, including memory information for the operating system, CPU usage status, process information, and so on.
Grammar:
Vmstat [-v] [delay [count]] #-v print out the version information of the Vmstat tool #delay set the time interval for two outputs #count set the number of total outputs
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/87/05/wKiom1fRWPqAviPmAABm6fuVbJY513.png "title=" 1.png " "Wkiom1frwpqavipmaabm6fuvbjy513.png" width= "770" height= "alt=" border= "0" hspace= "0" vspace= "0" style= "width : 770px;height:105px; "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M02/87/04/wKioL1fRWVqy5X5aAAB3kf0Qyik125.png "title=" 2.png " alt= "Wkiol1frwvqy5x5aaab3kf0qyik125.png" width= "810" height= "138" border= "0" hspace= "0" vspace= "0" style= "width : 810px;height:138px; "/>
To explain the output parameters
Procs
R: Number of running processes (that is, the number of processes that are really allocated to the CPU), if the value is longer than the number of system logical CPUs, indicates a low CPU
B: Number of processes that are blocking
Memory
SWPD: Indicates how much virtual memory is in use
Free: Indicates the size of the currently idle physical memory
Buff: Indicates the size of the buffers currently in use
Cached: Indicates the size of the cached currently in use
Buffers and cached differences: ①buffers and cached are part of the memory ②buffers is between the memory and the disk, when the disk read and write operations, the memory first cache the data into the buffers, and then write to the disk; The cached is between the CPU and the memory, cached is the content that the cache reads, the next time reads, if hits in the cache, then reads directly from the cache, otherwise reads the disk.
Swap
Si: Indicates the size of the virtual memory read from disk
So: Indicates the size of the write from virtual memory to disk
If Si and so are not 0 long, the system is out of memory, and if the value of SWPD is not 0 for a long time, but the value of Si and so is 0 long, there is no need to worry
Io
Bi: Represents the total amount of data read from disk
Bo: Indicates the total amount of data written to disk
System
In: Indicates the number of system interrupts
CS: Indicates the number of context switches produced per second
The greater the value of in and CS, the greater the CPU time consumed by the kernel
Cpu
US: Percentage of CPU time consumed by user processes
Sy: Percentage of CPU time consumed by kernel processes
ID:CPU idle state percent of time
WA: Indicates the percentage of CPU time that the IO wait occupies
us+sy+id=100
--------------------------------------------------------------------------------------------------------------- -------------------------
Second, the SAR command
The SAR command can obtain the system's CPU, disk, memory, network operation status and other information
Common usage is
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/04/wKioL1fRYlfBJLrpAACeoAJBdNQ873.png "title=" 3.png " alt= "Wkiol1frylfbjlrpaaceoajbdnq873.png" width= "850" height= "143" border= "0" hspace= "0" vspace= "0" style= "width : 850px;height:143px; "/>
650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/87/04/wKioL1fRZEuyIWGfAACLl-p991s993.png "title=" 7.png " alt= "Wkiol1frzeuyiwgfaacll-p991s993.png" width= "860" height= "0" border= "0" hspace= "0" vspace= "width : 860px;height:125px; "/>
650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/87/06/wKiom1fRYsChqXfmAAEyJ34GI34413.png "title=" 4.png " alt= "Wkiom1fryschqxfmaaeyj34gi34413.png" width= "950" height= "317" border= "0" hspace= "0" vspace= "0" style= "width : 950px;height:317px; "/>
650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/06/wKiom1fRY0qgYCeTAACuzI4zLzU206.png "title=" 5.png " alt= "Wkiom1fry0qgycetaacuzi4zlzu206.png" style= "width:1050px;height:143px;" width= "1050" height= "143" border= "0" Hspace= "0" vspace= "0"/>
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/87/06/wKiom1fRY6KSYll-AADncA2nXuk354.png "title=" 6.png " alt= "Wkiom1fry6ksyll-aadnca2nxuk354.png" width= "960" height= "248" border= "0" hspace= "0" vspace= "0" style= "width : 960px;height:248px; "/>
Note The main points:
-U means to view the overall system CPU usage status,-P can query the usage of each CPU separately, the CPU count is starting from 0
--------------------------------------------------------------------------------------------------------------- -----------------
Third, Iostat
You can monitor the IO operation of the system disk and also output the CPU usage
Grammar:
Iostat options [interval [count]]
Options |
Description |
-C |
Show CPU Usage |
-D |
Show disk usage |
-K |
Indicates that data is displayed in kilobytes |
-X Device |
Specify the disk devices to be counted |
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/87/06/wKiom1fRZnjxmJjWAABLdaiZp8Y728.png "title=" 8.png " alt= "Wkiom1frznjxmjjwaabldaizp8y728.png" width= "height=" 108 "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width : 800px;height:108px; "/>KB_READ/S: Indicates the number of data blocks read per second
KB_WRTN/S: Indicates the number of data blocks written per second
Kb_read: Number of blocks of data that are read in total
KB_WRTN: Indicates the total number of data blocks written
--------------------------------------------------------------------------------------------------------------- --------
Iv. netstat
Information such as network connections, port status, and routing tables can be displayed
Syntax: netstat [options]
Common option |
Description |
-A |
Show all connections and listening ports |
-R |
Show routing information |
-T |
Show TCP connections |
-U |
Show UDP connections |
-L |
To display connections with a connection status of listen |
-P |
Display the corresponding PID of the connection |
-N |
Display connections as IP and port |
More common usage:
Netstat-plntnetstat-pulnnetstat-r
--------------------------------------------------------------------------------------------------------------- ---------------------
V. Free
Monitor the usage of Linux memory
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/87/04/wKioL1fRaCrARYk9AAAqKn_RmEE318.png "title=" 9.png " alt= "Wkiol1fracraryk9aaaqkn_rmee318.png" width= "760" height= "" border= "0" hspace= "0" vspace= "0" style= "width:760px ; height:71px; "/>
--------------------------------------------------------------------------------------------------------------- ------------
Liu, uptime
You can view the boot time and CPU load of the system
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/87/04/wKioL1fRaNPQMsEBAAAb76HZRy4243.png "title=" 10.png "alt=" Wkiol1franpqmsebaaab76hzry4243.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width : 600px;height:36px; "/>
The system now time starts when the number of logged-on users in the average load within 1 minutes 5 minutes average load within 15 minutes of the average load
Note: If the three output values of the load average are larger than the number of system logical CPUs, this means that the CPU is busy and can affect system performance
--------------------------------------------------------------------------------------------------------------- ----------
This article is from the "a" blog, please make sure to keep this source http://lzs66.blog.51cto.com/9607068/1850886
Common performance analysis tools for Linux systems