首页 > 代码库 > linux工具类之系统性能监测

linux工具类之系统性能监测

内存监测每2s以M,K,B为单位分别显示
[root@221-comecs mnt]# free -s2 -m total used free shared buffers cachedMem: 995 562 433 0 95 337-/+ buffers/cache: 129 866Swap: 1635 0 1635 total used free shared buffers cachedMem: 995 562 433 0 95 337-/+ buffers/cache: 129 866Swap: 1635 0 1635[root@221-comecs mnt]# free -s2 total used free shared buffers cachedMem: 1019820 575496 444324 0 97448 345320-/+ buffers/cache: 132728 887092Swap: 1675256 0 1675256 total used free shared buffers cachedMem: 1019820 575504 444316 0 97448 345320-/+ buffers/cache: 132736 887084Swap: 1675256 0 1675256[root@221-comecs mnt]# free -s2 -b total used free shared buffers cachedMem: 1044295680 589180928 455114752 0 99786752 353607680-/+ buffers/cache: 135786496 908509184Swap: 1715462144 0 1715462144 total used free shared buffers cachedMem: 1044295680 589189120 455106560 0 99786752 353607680-/+ buffers/cache: 135794688 908500992Swap: 1715462144 0 1715462144

[root@109-com1 asterisk]# watch -n1 -d free
Every 1.0s: free                                                                                                                     Thu Oct  9 14:53:01 2014

             total       used       free     shared    buffers     cached
Mem:       1019820     933400      86420          0     112452     515660
-/+ buffers/cache:     305288     714532
Swap:      1675256        456    1674800
[root@109-com1 asterisk]# watch -d vmstat
Every 2.0s: vmstat                                                                                                                   Thu Oct  9 14:58:28 2014

procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  0    456  74072 112636 527608    0    0     0    17   21   40  0  0 99  0  0

[root@250-shiyan bin]# ps aux|head -1;ps aux|sort -rnk6|head  以RSS即第六列为准由大到小排序

 

linux工具类之系统性能监测