怎么测试linux的性能测试,Linux性能测试工具

4、iostat

iostat由Red Hat Enterprise Linux AS发布。同时iostat也是Sysstat的一部分,可以下载到,网址是http://perso.wanadoo.fr/sebastien.godard/

执行iostat命令可以从系统启动之后的CPU平均时间,类似于uptime。除此之外,iostat还对创建一个服务器磁盘子系统的活动报告。该报告包含两部分:CPU使用情况和磁盘使用情况。

iostat显示实例:

avg-cpu: %user %nice %system %iowait %steal %idle 0.16 0.01 0.03 0.10 0.00 99.71

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn hda 0.31 4.65 4.12 327796 290832 avg-cpu: %user %nice %system %iowait %steal %idle 1.00 0.00 0.00 0.00 0.00 100.00

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn hda 0.00 0.00 0.00 0 0 avg-cpu: %user %nice %system %iowait %steal %idle 0.00 0.00 0.00 0.00 0.00 99.01

Device: tps Blk_read/s Blk_wrtn/s Blk_read Blk_wrtn hda 0.00 0.00 0.00 0 0

CPU占用情况包括四块内容

%user:显示user level (applications)时,CPU的占用情况。 %nice:显示user level在nice priority时,CPU的占用情况。 %sys:显示system level (kernel)时,CPU的占用情况。 %idle: 显示CPU空闲时间所占比例。 磁盘使用报告分成以下几个部分: Device: 块设备的名字

tps: 该设备每秒I/O传输的次数。多个I/O请求可以组合为一个,每个I/O请求传输的字节数不同,因此可以将多个I/O请求合并为一个。 Blk_read/s, Blk_wrtn/s: 表示从该设备每秒读写的数据块数量。块的大小可以不同,如1024, 2048 或 4048字节,这取决于partition的大小。

例如,执行下列命令获得设备/dev/sda1 的数据块大小: dumpe2fs -h /dev/sda1 |grep -F "Block size" 输出结果如下

dumpe2fs 1.34 (25-Jul-2003) Block size: 1024

Blk_read, Blk_wrtn: 指示自从系统启动之后数据块读/写的合计数。

也可以查看这几个文件/proc/stat,/proc/partitions,/proc/diskstats的内容。

5、vmstat

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.

6、sar

sar是Red Hat Enterprise Linux AS发行的一个工具,同时也是Sysstat工具集的命令之一,可以从以下网址下载:http://perso.wanadoo.fr/sebastien.godard/

sar用于收集、报告或者保存系统活动信息。sar由三个应用组成:sar显示数据、sar1和sar2用于收集和保存数据。

使用sar1和sar2,系统能够配置成自动抓取信息和日志,以备分析使用。配置举例:在/etc/crontab中添加如下几行内容

同样的,你也可以在命令行方式下使用sar运行实时报告。

从收集的信息中,可以得到详细的CPU使用情况(%user, %nice, %system, %idle)、内存页面调度、网络I/O、进程活动、块设备活动、以及interrupts/second liyawei:~

# sar -u 3 10

Linux 2.6.16.21-0.8-default (liyawei) 05/31/07

10:17:16 CPU %user %nice %system %iowait %idle 10:17:19 all 0.00 0.00 0.00 0.00 100.00 10:17:22 all 0.00 0.00 0.00 0.33 99.67 10:17:25 all 0.00 0.00 0.00 0.00 100.00 10:17:28 all 0.00 0.00 0.00 0.00 100.00 10:17:31 all 0.00 0.00 0.00 0.00 100.00 10:17:34 all 0.00 0.00 0.00 0.00 100.00 7、KDE System Guard

KDE System Guard (KSysguard) 是KDE图形方式的任务管理和性能监视工具。监视本地及远程客户端/服务器架构体系的中的主机。

42/4<1234>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值