Constant Disk I/O – What’s Taking All Disk Resources?
Recently, I updated my system and some other applications on my laptop and I found that some program on my system began gobbling up huge amounts of disk-activity. I looked at Gnome’s system-monitor and found that extremely unhelpful. Yeah, I could discovered what was taking the CPU and Nice readings but neither of these told me what was causing all the spin up activity of the hard-disk. This may not be a big deal for modern disks but for old computers it brought it to a halt and kept it that way minute(s) at a time. An easy way to monitor programs use of disk-activity is to use block dump.
First set block dump active in /proc:
sudo sh -c "echo 1 > /proc/sys/vm/block_dump"
Looking at the syslog now will tell where resources are going:
tail -f /var/log/syslog
Looking at this I discovered that Firefox-3.01 was taking all the disk resources:
Sep 3 12:18:23 partridge-ibook kernel: kjournald(2443): WRITE block 7152 on hda11 Sep 3 12:18:23 partridge-ibook kernel: kjournald(2443): WRITE block 7160 on hda11 Sep 3 12:18:25 partridge-ibook kernel: firefox(3655): READ block 2234472 on hda9 Sep 3 12:18:29 partridge-ibook kernel: firefox(3655): READ block 649144 on hda9
For some unknown reason Firefox-3.01 was reading and writing to the disk far more than Firefox-3.0-beta5 was. What an incredible disappointment. Firefox-3.01 literally made my laptop come to a complete halt. This is incredibly disappointing because the beta version performed alot better with very little I/O activity.
I looked this up a bit but never really found the answer. Firefox uses fsync to save data (history, bookmarks) during a session, sometimes excessively. Because of inherent problems with fsyncing and the ext3 filesystem not much can be done with it. Fsyncing can be disabled by entering a Preference Name “toolkit.storage.synchronous” in “about:config” and inputting a value of 0, but this didn’t fix the problem. It turns out that Firefox-3.01 just uses alot more memory and re-allocates memory a good deal more often, so swap is being used and paged about every 2 minutes and can take minutes to finish. Unfortunately, a Firefox-3.0-beta5 ebuild is no longer in portage.
Turning block dumping off is the opposite of turning it on:
sudo sh -c "echo 0 > /proc/sys/vm/block_dump"
Looks like back to Epiphany for me, or heck, who knows, maybe Google Chrome will be stable soon!
Thanks to vor for the tip.
Enjoy the Day!