All the things that every program should know--linux server monitoring commands

Source: Internet
Author: User

(1) Iostat

This command detects if the storage device is working properly, shows the details of the storage system, can see the IO status of each disk, and can monitor the CPU usage.

 -: the[[Email protected]]$ iostatlinux2.6. --308. El5 (AAA) August 22, 2014 AVG-CPU:%user%nice%system%iowait%steal%Idle4.65 0.00 0.78 0.02 0.00 94.55Device:tps Blk_read/s blk_wrtn/s Blk_read blk_wrtnsda1.55 0.16 96.24 5548422 3391975158sda10.00 0.00 0.00 1748 118sda20.71 0.13 27.18 4537378 957989784Sda30.00 0.00 0.00 1422 304sda40.00 0.00 0.00 8 0Sda50.83 0.03 69.06 1007434 2433984952

(2) Free view overview of memory usage

£ º [[email protected]]$ free-32168317144530  105626763389428273409404094

(3) Meminfo View more information

 -: the[[Email protected]]$ cat/proc/meminfomemtotal:32940052Kbmemfree:464180kbbuffers:1081628kbcached:27405336kbswapcached:0kbactive:6155648kbinactive:24833068kbhightotal:0Kbhighfree:0kblowtotal:32940052Kblowfree:464180kbswaptotal:4192956Kbswapfree:4192804Kbdirty: -Kbwriteback:0kbanonpages:2501732kbmapped:32108Kbslab:1428392Kbpagetables:26956kbnfs_unstable:0kbbounce:0Kbcommitlimit:20662980kbcommitted_as:4767104kbvmalloctotal:34359738367kbvmallocused:264924Kbvmallocchunk:34359473015kbhugepages_total:0Hugepages_free:0HUGEPAGES_RSVD:0hugepagesize:2048Kb

(4) Mpstat Display CPU status,

You can display the average status of all processors, or you can display statistics

 A: -[]$ Mpstat-P Alllinux2.6. --308. El5 (A04.api.cms.3g.b28.youku) August 23, 2014 12:38 01 sec CPU%user%nice%sys%iowait%irq%soft%steal%idle intr/S12 38 minutes, 01 seconds All4.64 0.00 0.54 0.02 0.01 0.22 0.00 94.56 67.6012:38 01 sec0 8.58 0.00 0.93 0.05 0.05 0.71 0.00 89.68 67.6012:38 01 sec1 3.53 0.00 0.41 0.01 0.00 0.07 0.00 95.98 0.0012:38 01 sec2 2.84 0.00 0.33 0.01 0.00 0.05 0.00 96.76 0.0012:38 01 sec3 3.61 0.00 0.48 0.02 0.00 0.07 0.00 95.83 0.00 A: -[Email protected]]$ mpstat-p0Linux2.6. --308. El5 () August 23, 2014 12:40 43 sec CPU%user%nice%sys%iowait%irq%soft%steal%idle intr/S12 40 minutes, 43 seconds .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, this line represents the statistical average of all processors 2%usr: User-state CPU Utilization 3%nice: User-state CPU utilization with scheduling priority 4 SYS: kernel-state CPU utilization (this value does not include the time it takes to respond to hardware interrupts and software interrupts) 5%iowait: Percentage of time that processing IO requests causes the CPU to be idle 6%irq:cpu response hardware interrupt Time ratio 7%SOFT:CPU response software interrupt Time ratio 8 %steal: The virtual CPU's passive wait time ratio of 9%guest when the virtual machine monitor is serving the other virtualized processors: CPU time ratio consumed by running a virtual processor

(5) Netstat
-A: Show all Socke information-R: Show routing Information-I: Display network card Pretext statistics-S: Display protocol statistics (6) Pmap shows the amount of memory consumed by the process, and finds the process that consumes the most RAM. Analysis of memory consumption of nginx main process

 the:xx[]$ Ps-ef |grep nginxnobody13609 19402 0Aug06?xx:xx:xxNginx:worker processnobody13610 19402 0Aug06?xx:xx:xxNginx:worker processnobody13611 19402 0Aug06?xx:xx:xxNginx:worker processnobody13612 19402 0Aug06?xx:xx:xxNginx:worker processnobody13613 19402 0Aug06?xx:xx:xxNginx:worker processnobody13614 19402 0Aug06?xx:xx:xxNginx:worker processnobody13615 19402 0Aug06?xx:xx: onNginx:worker processnobody13616 19402 0Aug06?xx:xx: onNginx:worker Processroot16487 16097 0  the:xxpts/1 xx:xx:xxgrep nginxroot19402 1 0May05?xx:xx:xxNginx:master Process Nginx the:xx[]$ Pmap19402|head-nTen19402: Nginx:master process Nginx00000000004000001112K r-x--/opt/nginx/sbin/Nginx000000000071600068K RW---/opt/nginx/sbin/Nginx000000000072700060K RW---[anon]0000000014fbc000 1080K RW---[Anon]00000032432000001204K r-x--/lib64/libcrypto.so.0.9. 8e. #prelink #.6zb7wz (Deleted) 000000324332d000 2044K-----/lib64/libcrypto.so.0.9. 8e. #prelink #.6zb7wz (Deleted) 000000324352c000 132K rw---/lib64/libcrypto.so.0.9. 8e. #prelink #.6zb7wz (Deleted) 000000324354d000 16K rw---[Anon]0000003243600000280K r-x--/lib64/libssl.so.0.9.8e

All the things that every program should know--linux server monitoring commands

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.