Linux下性能测试分析工具拾遗

1.cat /proc/loadavg

得到:

1.88 1.57 1.47 5/469 18927

前面三个数据是load avg,是取前1,5,15的数据(与uptime,w的数据一样),代表内核中状态为R(Running)和D(Disk IO)的job平均值,如果有4个cpu,均值如果是1基本表示是使用率为25%.第四个数字表示内核正在运行的进程或线程数量(应少于等于CPU数),第五个表示进程或线程总数,最后一个表示最近创建的进程id.


2.uptime

除了包含load average数据外,还有启动多久,几个用户等。


3.free/vmstat

两个命令主要用来看内存使用,需要区分buffer和cache.在网上找了一些文章,发现最靠谱的解释是:

Buffers are associated with a specific block device, and cover caching of filesystem metadata as well as tracking in-flight pages. The cache only contains parked file data. That is, the buffers remember what's in directories, what file permissions are, and keep track of what memory is being written from or read to for a particular block device. The cache only contains the contents of the files themselves.

cache是页缓存(page cache),buffer是块设备上的file metadata以及记录读写的页缓存位置等。buffer一般不占用太多,不是重要指标,cache才是。

主要用来看内存:

清空页缓存(Linux 2.6之后才支持):

sync # 清空dirty

echo 3 > /proc/sys/vm/drop_caches


4.IO:

sar命令或iostat命令

iostat中nice表示进程带nice标志的用户时间占总的时间的比率。steal还不知道是什么。

带以下参数,详细而且方便时候抽样统计:

iostat interval 3 -t -d -x

如何判断io的bottlenecks,参考:http://oplinux.com/order/iostat.html


参考:

man proc

man uptime

http://qa.blog.163.com/blog/static/190147002201111282625762/

http://stackoverflow.com/questions/6345020/linux-memory-buffer-vs-cache

http://blog.csdn.net/codestinity/article/details/7496962

man iostat

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值