procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu----- rb swpd freeinact active si sobibo in cs us sy id wa st 100 810420973807062800 115 4 89 7916 9030 Free – 空闲的内存空间 si – 每秒从磁盘中交换进内存的数据量(以KB为单位)。 so – 每秒从内存中交换出磁盘的数据量(以KB为单位)。 注意:如果你不带参数的执行vmstat命令,它会输出自系统启动以来的总结报告。 2. 每X秒执行vmstat,共执行N次 下面命令将会每2秒中执行一次vmstat,执行6次后自动停止执行。
复制代码代码如下:[root@tecmint ~]# vmstat 2 6
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu----- rb swpd free buffcache si sobibo in cs us sy id wa st 000 81042022064 1013680056 3 50 5703 9520 000 81041222064 10136800 0 0 16 3500 10000 000 81041222064 10136800 0 0 14 3500 10000 000 81041222064 10136800 0 0 17 3800 10000 000 81041222064 10136800 0 0 17 3500 10000 000 81041222064 10136800 0 0 18 3601 10000 3. 带时间戳的vmstat命令 带-t参数执行vmstat命令,该命令将会在每一行输出后都带一个时间戳,如下所示。
复制代码代码如下:[tecmint@tecmint ~]$ vmstat -t 1 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------ ---timestamp--- rb swpd free buffcache si sobibo in cs us sy id wa st 000 63202824992 1922440070 5 55 7813 95102012-09-02 14:57:18 IST 100 63202824992 19224400 0 017151415 94002012-09-02 14:57:19 IST 100 63190424992 19224400 0 019560005 95002012-09-02 14:57:20 IST 000 63178024992 19224400 0 015652405 95002012-09-02 14:57:21 IST 100 63165624992 19224400 0 018959205 95002012-09-02 14:57:22 IST 4. 统计各种计数器 vmstat命令的-s参数,将输出各种事件计数器和内存的统计信息。
复制代码代码如下:[tecmint@tecmint ~]$ vmstat -s
1030800total memory 524656used memory 277784active memory 185920inactive memory 506144free memory 26864buffer memory 310104swap cache 2064376total swap 0used swap 2064376free swap 4539 non-nice user cpu ticks 0 nice user cpu ticks 11569 system cpu ticks 329608 idle cpu ticks 5012 IO-wait cpu ticks 79 IRQ cpu ticks 74 softirq cpu ticks 0 stolen cpu ticks 336038 pages paged in 67945 pages paged out 0 pages swapped in 0 pages swapped out 258526 interrupts 392439 CPU context switches 1346574857 boot time 2309 forks 5. 磁盘统计信息 vmstat的-d参数将会输出所有磁盘的统计信息。