性能分析
vmstat
虚拟内存统计
用法
Usage:
vmstat [options] [delay [count]]
Options:
-a, --active active/inactive memory
-f, --forks number of forks since boot
-m, --slabs slabinfo
-n, --one-header do not redisplay header
-s, --stats event counter statistics
-d, --disk disk statistics
-D, --disk-sum summarize disk statistics
-p, --partition <dev> partition specific statistics
-S, --unit <char> define display unit
-w, --wide wide output
-t, --timestamp show timestamp
-h, --help display this help and exit
-V, --version output version information and exit
示例
[root@localhost ~]# vmstat
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 71256 92720 0 565120 0 0 1 115 22 36 1 0 99 0 0
其中
free
内存使用状况
[root@localhost ~]# free
total used free shared buff/cache available
Mem: 1849336 1193336 90344 1752 565656 460000
Swap: 2097148 71248 2025900
[root@localhost ~]# free -h
total used free shared buff/cache available
Mem: 1.8G 1.1G 88M 1.7M 552M 449M
Swap: 2.0G 69M 1.9G
[root@localhost ~]# free -m
total used free shared buff/cache available
Mem: 1805 1165 88 1 552 449
Swap: 2047 69 1978
[root@localhost ~]# free -h 2
total used free shared buff/cache available
Mem: 1.8G 1.1G 88M 1.7M 552M 449M