Linux查看哪个进程io延迟,LINUX下找出哪个进程造成的IO等待很高的方法

在本机测试通过^^

抓哪个进程干坏事前要先停掉syslog

/etc/init.d/syslog stop

echo 1 > /proc/sys/vm/block_dump

dmesg | egrep “READ|WRITE|dirtied” | egrep -o ‘([a-zA-Z]*)’ | sort | uniq -c | sort -rn | head

14 kjournald

11 bash

10 pdflush

8 egrep

2 jsvc

2 irqbalance

不要忘记在抓完之后关掉block_dump和启动syslog

echo 0 > /proc/sys/vm/block_dump

/etc/init.d/syslog start

进程介绍:

1.kjournald

EXT3文件系统的日志进程,具有3种模式:

journal - logs all filesystem data and metadata changes. The slowest of the three ext3 journaling modes, this journaling mode minimizes the chance of losing the changes you have made to any file in an ext3 filesystem.(记录所有文件系统上的元数据改变,最慢的一种模式,)

ordered - only logs changes to filesystem metadata, but flushes file data updates to disk before making changes to associated filesystem metadata. This is the default ext3 journaling mode.(默认使用的模式,只记录文件系统改变的元数据,并在改变之前记录日志)

writeback - only logs changes to filesystem metadata but relies on the standard filesystem write process to write file data changes to disk. This is the fastest ext3 journaling mode.(最快的一种模式,同样只记录修改过的元数据,依赖标准文件系统写进程将数据写到硬盘)

修改模式EXT3的工作模式;

vim /etc/fstab

/dev/hda5      /opt            ext3       data=writeback        1 0详细介绍:http://www.linuxplanet.com/linuxplanet/reports/4136/5/

2.pdflush

pdflush用于将内存中的内容和文件系统进行同步,比如说,当一个文件在内存中进行修改,pdflush负责将它写回硬盘.每当内存中的垃圾页(dirty page)超过10%的时候,pdflush就会将这些页面备份回硬盘.这个比率是可调节的,通过/etc/sysctl.conf中的 vm.dirty_background_ratio项 默认值为10 也可以

cat /proc/sys/vm/dirty_background_ratio 查看当前的值

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值