Last 5 Posts from 2006/May/09

{K,}Ubuntu Dapper Drake: make it even faster

Yesterday I got my Kubuntu machine updated, it's a bit faster now, but still not as fast as I would like.

So I went to try to speed things up. Given I did not install it myself, I don't know if he did most procedures I do and I noticed the guy didn't. Some things I did:

File System Speedups: since I use a laptop (slow disks) with dm-crypt, making filesystem as fast as possible is crucial. Also, avoid forced fsck since it may show while booting for a talk/presentation (as it already did!) and avoid huge reserved space for super user, since HD is not that big. Changes:

  • Save previous ext3 state: dumpe2fs $EXT3_PARTITION > ext3-state.txt
  • Turn off forced fsck runs: tune2fs -i0 $EXT3_PARTITION
  • Turn on dir_index on ext3, for faster searchs and file lookup: tune2fs -O dir_index,sparse_super,has_journal,filetype $EXT3_PARTITION
  • (Possibly) reduce amount of reserved space for super user. It defaults to 5%, but maybe it's too much for you, or it's not needed (if you use /home partition) calculate amount with AMOUNT=512*100/$FS_SIZE_IN_MB to reserve 512mb. Set it with tune2fs -m$AMOUNT $EXT3_PARTITION; tune2fs -m0 $HOME_EXT3_PARTITION
  • Have ext3 to rebuild indexes and thus use dir_index (first unmount partitions, you may boot from a livecd): fsck.ext3 -fCD $EXT3_PARTITION
  • User greater ext3 commit interval. It defaults to 5 seconds, but on laptops with good battery you can make it 15-60. I use 15 (home) and 60 (system, also with noatime) for fail-safety: edit /etc/fstab and append commit=15 to filesystem options.

Hardware Settings: it's all about hdparm. Edit /etc/hdparm.conf and make sure, at least dma=on and interrupt_unmask=on are set.

Network: If you often change networked and non-networked environments, you may notice boot can take a lot if you have interfaces as "auto" in /etc/network/interfaces. Remove them all from auto and install ifplugd, it will then detect if network is physically available and if so launch them. You may also install and configure wpasupplicant in order to automatically change among WEP, WPA and WPA2 wireless networks, but be aware to set wpa-conf /etc/wpa_supplicant.conf in interface option in /etc/network/interfaces

X.org: use 16 instead of 24 bits-per-pixel, at least it will consume less memory.

Kernel: use latest Con Kolivas' kernel patch. It makes desktop more responsive.

Services: disable unused services in /etc/rcS.d and /etc/rc2.d. I do not use PCMCIA, PPP, EVMS, NFS and a bunch of other services. Also, readahead seems to be optimized to GNOME rather KDE, so I disabled it too (readahead-desktop).

My system (IBM ThinkPad T41, 512mb of RAM, 40Gb Fujitsu MHT2040HA, 1.6Ghz/1MB cache Pentium-M) boots to KDM in 45s, remember that I use dm-crypt! It's still far from how many seconds I think it should take, but things are still improving in GNU/Linux.