管理员必备的20个Linux系统监控工具4
mpstat – 多处理器使用率
mpstat命令可以显示所有可用处理器的使用情况,处理器编号从0开始。mpstat -P ALL显示每个处理器的平均使用率。
# mpstat -P ALL
输出样例:
Linux 2.6.18-128.1.14.el5 (www03.nixcraft.in) 06/26/2009
06:48:11 PM CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
06:48:11 PM all 3.50 0.09 0.34 0.03 0.01 0.17 0.00 95.86 1218.04
06:48:11 PM 0 3.44 0.08 0.31 0.02 0.00 0.12 0.00 96.04 1000.31
06:48:11 PM 1 3.10 0.08 0.32 0.09 0.02 0.11 0.00 96.28 34.93
06:48:11 PM 2 4.16 0.11 0.36 0.02 0.00 0.11 0.00 95.25 0.00
06:48:11 PM 3 3.77 0.11 0.38 0.03 0.01 0.24 0.00 95.46 44.80
06:48:11 PM 4 2.96 0.07 0.29 0.04 0.02 0.10 0.00 96.52 25.91
06:48:11 PM 5 3.26 0.08 0.28 0.03 0.01 0.10 0.00 96.23 14.98
06:48:11 PM 6 4.00 0.10 0.34 0.01 0.00 0.13 0.00 95.42 3.75
06:48:11 PM 7 3.30 0.11 0.39 0.03 0.01 0.46 0.00 95.69 76.89
pmap – 进程的内存使用
pmap命令可以显示进程的内存映射,使用这个命令可以找出造成内存瓶颈的原因。
# pmap -d PID
显示PID为47394进程的内存信息。
# pmap -d 47394
输出样例:
47394: /usr/bin/php-cgi
Address Kbytes Mode Offset Device Mapping
0000000000400000 2584 r-x– 0000000000000000 008:00002 php-cgi
0000000000886000 140 rw— 0000000000286000 008:00002 php-cgi
00000000008a9000 52 rw— 00000000008a9000 000:00000 [ anon ]
0000000000aa8000 76 rw— 00000000002a8000 008:00002 php-cgi
000000000f678000 1980 rw— 000000000f678000 000:00000 [ anon ]
000000314a600000 112 r-x– 0000000000000000 008:00002 ld-2.5.so
000000314a81b000 4 r—- 000000000001b000 008:00002 ld-2.5.so
000000314a81c000 4 rw— 000000000001c000 008:00002 ld-2.5.so
000000314aa00000 1328 r-x– 0000000000000000 008:00002 libc-2.5.so
000000314ab4c000 2048 —– 000000000014c000 008:00002 libc-2.5.so
00002af8d48fd000 4 rw— 0000000000006000 008:00002 xsl.so
00002af8d490c000 40 r-x– 0000000000000000 008:00002 libnss_files-2.5.so
00002af8d4916000 2044 —– 000000000000a000 008:00002 libnss_files-2.5.so
00002af8d4b15000 4 r—- 0000000000009000 008:00002 libnss_files-2.5.so
00002af8d4b16000 4 rw— 000000000000a000 008:00002 libnss_files-2.5.so
00002af8d4b17000 768000 rw-s- 0000000000000000 000:00009 zero (deleted)
00007fffc95fe000 84 rw— 00007ffffffea000 000:00000 [ stack ]
ffffffffff600000 8192 —– 0000000000000000 000:00000 [ anon ]
mapped: 933712K writeable/private: 4304K shared: 768000K
最后一行非常重要:
* mapped: 933712K 内存映射所占空间大小
* writeable/private: 4304K 私有地址空间大小
* shared: 768000K 共享地址空间大小
五月 3rd, 2011 at 05:21
Some New Sites I Like…
[...]below you’ll find the link to some websites that I think you should go and see http://www.panicattackstreatmentcure.net/links/ some are related to my site and others are unrelated but definitely worth visiting[...]…
五月 9th, 2011 at 21:36
Recent Favourite Sites…
[...]below you’ll find my recommended links page http://www.yeastinfectiontreatmentcure.net/links/ with some great sites that I think you should go visit[...]…
十二月 2nd, 2011 at 13:21
Check this out……
[...] that is the end of this article. Here you’ll find some sites that we think you’ll appreciate, just click the links over[...]………
十二月 6th, 2011 at 17:21
Visitor recommendations trackback……
[...]one of our visitors recently recommended the following website[...]………