1、前提:如果是短时间的性能测试可以用loadrunner监控,只要在linux上安装rstatd监控程序就可以。
如果是长时间的稳定性测试需要在linux输入命令行来保存性能参数。最后再把导入到excel里进行统计就可以了。
命令行如下:
nohup vmstat -S m 5 >>/root/20070406_buslog1.txt &
解释:直接将性能结果保存到文档中以后参看。 监视内存,cpu,I/O
vmstat -S m 5
解释:直接监控返回结果
说明:
其中20070406_buslog1.txt文件名,你们可以按照自己的标准制定文件名
root/是保存路径vmstat
/*感谢我的小美女领导hat*/
2、vmstat提供了processes, memory, paging, block I/O, traps和CPU的活动状况
procs -----------memory---------- ---swap-- -----io---- -system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
1 0 0 513072 52324 162404 0 0 2 2 261 32 0 0 100 0 0
0 0 0 513072 52324 162404 0 0 0 0 271 43 0 0 100 0 0
0 0 0 513072 52324 162404 0 0 0 0 255 27 0 0 100 0 0
0 0 0 513072 52324 162404 0 0 0 28 275 51 0 0 97 3 0
0 0 0 513072 52324 162404 0 0 0 0 255 21 0 0 100 0 0
各输出列的含义:
Process
– r: The number of processes waiting for runtime.
– b: The number of processes in uninterruptable sleep.
Memory
– swpd: The amount of virtual memory used (KB).
– free: The amount of idle memory (KB).
– buff: The amount of memory used as buffers (KB).
Swap
– si: Amount of memory swapped from the disk (KBps).
– so: Amount of memory swapped to the disk (KBps).
IO
– bi: Blocks sent to a block device (blocks/s).
– bo: Blocks received from a block device (blocks/s).
System
– in: The number of interrupts per second, including the clock.
– cs: The number of context switches per second.
CPU (these are percentages of total CPU time)
- us: Time spent running non-kernel code (user time, including nice time).
– sy: Time spent running kernel code (system time).
– id: Time spent idle. Prior to Linux 2.5.41, this included IO-wait time.
– wa: Time spent waiting for IO. Prior to Linux 2.5.41, this appeared as zero.