Linux server monitoring commands

  
        

(1) iostat

This command can detect whether the storage device is working properly, display the details of the storage system, see the IO status of each disk, and monitor the CPU usage status.

14:52 [root@aaa]$ iostat Linux 2.6.18-308.el5 (aaa) August 22, 2014

avg-cpu: %user %nice %system %iowait % Steal %idle 4.65 0.00 0.78 0.02 0.00 94.55

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn sda 1.55 0.16 96.24 5548422 3391975158 sda1 0.00 0.00 0.00 1748 118 sda2 0.71 0.13 27.18 4537378 957989784 sda3 0.00 0.00 0.00 1422 304 sda4 0.00 0.00 0.00 8 0 sda5 0.83 0.03 69.06 1007434 2433984952

(2) free view memory usage Summary

14:56 [root @ a] $ free -m total used free shared Buffers cached Mem: 32168 31714 453 0 1056 26763 -/+ buffers/cache: 3894 28273 Swap: 4094 0 4094

(3)meminfoView details

14:52 [root@aaa ]$ cat /proc/meminfo MemTotal: 32940052 kB MemFree: 464180 kB Buffers: 1081628 kB Cach Ed: 27405336 kB SwapCached: 0 kB Active: 6155648 kB Inactive: 24833068 kB HighTotal: 0 kB HighFree: 0 kB LowTotal: 32940052 kB LowFree: 464180 kB SwapTotal: 4192956 kB SwapFree: 4192804 kB Dirty: 16 kB Writeback: 0 kB AnonPages: 2501732 kB Mapped: 32108 kB Slab: 1428392 kB PageTables: 26956 kB NFS_Unstable: 0 kB Bounce: 0 kB CommitLimit: 20662980 kB Committed_AS: 4767104 kB VmallocTotal: 34359738367 kB VmallocUsed: 264924 kB VmallocChunk: 34359473015 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 Hugepagesize: 2048 kB

(4) mpstat displays CPU status,

can display the average status of all processors, and can also display statistics

12:38 [ ] $ mpstat -P ALL Linux 2.6.18-308.el5 (a04.api.cms.3g.b28.youku) August 23, 2014

12:38:01 CPU %user %nice % Sys %iowait %irq %soft %steal %idle intr/s 12:38:01 all 4.64 0.00 0.54 0.02 0.01 0.22 0.00 94.56 67.60 12:38:01 0 8.58 0.00 0.93 0.05 0.05 0.71 0.00 89.68 67.60 12:38 01 seconds 1 3.53 0.00 0.41 0.01 0. 00 95.98 0.07 0.00 0.00 12:38:01 2.84 0.00 2 0.33 0.01 0.00 0.05 96.76 0.00 0.00 12:38:01 3 3.61 0.00 0.48 0.02 0.00 0.07 0.00 95.83 0.00

12:38 [root @ a04 .api.cms.3g.b28.youku]$ mpstat -P 0 Linux 2.6.18-308.el5 () August 23, 2014

12:40:43 CPU %user %nice % sys% iowait% irq% soft% steal% idle intr /s 12 43 is of 5 seconds when 40 0 ​​8.58 0.00 0.93 0.05 0.05 0.71 0.00 89.68 67.60

 1 CPU: processor number, If all, then this line Represents the statistical average of all processors 2 % usr: CPU utilization in user mode 3% nice: user mode CPU utilization with scheduling priority 4 % sys: kernel state CPU utilization (this value does not include responsive hardware Interrupt and software interrupt time) 5% iowait: The percentage of time that the IO request causes the CPU to be in the IDLE state. 6 %irq: The ratio of the time the CPU responds to the hardware interrupt. 7 %soft: The ratio of the time the CPU responds to the software interrupt. 8 %steal: When virtual The passive wait time ratio of the virtual CPU when serving the other virtual processors is 9% guest: consumed by running a virtual processor CPU time ratio (5) netstat
-a : Display all socke information -r : Display routing information -i : Display network card interface statistics -s : Display network protocol statistics (6) pmap Display the amount of memory occupied by the process, find the occupied The most memory-intensive process .nginx main process memory usage analysis 

15:00 [ ]$ ps -ef

Copyright © Windows knowledge All Rights Reserved