View Single Post
  #9 (permalink)  
Old 21-Sep-2008, 15:10
Zonei Zonei is offline
Puzzled Penguin
 
Join Date: Sep 2008
Posts: 28
Zonei hasn't been rated much yet
Wink (Solved) Too much HDD activity

Well after an entire week of searching, poking, harrassing folks at irc, and venturing through deepest vaults of google, beyond page 17, I am pretty confident that I've nailed the problem.

Plain and simple --> ext3 journaling.

For each and every little speck written on the disc, kjournald would make substantial writes. And that got flushed by pdflush after a short while, configurable by dirty_ files in /proc/sys/vm.

So when I converted my /tmp and /var partitions to ext2, the disc misteriously fell silent. I was pleased.

Makes sense. Suse, by default, does a lot of logging and disc activity:

1. Firewall often reports critical accepted and blocked packets. Unless you run a server and you're already behind a nat router, you don't really need critical logging.
2. Wifi often has something to log, especially when WPA keys are updated (my router had default update time of 60 seconds). Check that and crank it up to an hour or more.
3. Nscd will cache passwords every minute. Disable password caching (unless you run a server with hundreds or thousands of users ssh-ing to it all the time) in nscd.conf.
4. Postfix pickup daemon will check for email every 30 seconds. Unless you run an MTA for your clients, crank that up to 5 minutes in /etc/master.cf

Add browsing to that (and perhaps favourite chat client logging), and you have pretty much constantly lit up hdd light on the laptop. The only thing preventing constant writes is pdflush which does it periodically when pages expire or grow beyond certain size.

It it also helps to partition your disc according to some usage logic. I separate /tmp, /var, /home (and on servers /srv) from root. Then / is pretty much read-only except when you install software (/usr) or edit /etc. /var is constantly being written to by logs. Your /home is a read-write-o-rama. So is /tmp. Such partitioning also helps containing fragmentation, confining it to specific partitions (yes, there _is_ fragmentation on ext2/3).

Finally, I don't need access times. Other than /var (because of mail -- and even if you don't run an MTA you need it because system may email you something nice ), all my paritions are set with noatime in fstab, and /var is set with relatime (enhanced noatime which clusters access time updates).

And if you run Virtualbox, it helps a lot to assign special noatime ext2 partition just for it (unless you really need access time -- consider relatime, and journaling on the hdd images).

Of course there are more tweaks to be done, like moving FF cache to /var, various program logs that are by default kept in ~/ should also go to /var etc...

But for now, I'll sit back and enjoy the silence of my hdd.
Reply With Quote