Speeding up my Linux system

My Mandriva 2009.1 system at home had become a bit slow lately, and so I decided to do some attempts to make it a bit faster again. This is not the most powerful system anymore (Asus A8N-SlI NForce4 motherboard, Athlon 64 3500+, 3 GB RAM, 250 GB SATA-1 disk, NVidia 6600 GT graphics card), but it sometimes felt very slow because of lots of disk activity, especially during start-up. I succeeded in improving the performance noticeably: the disk activity now stops much earlier after log-in and after starting Evolution.

I did some different changes at once and have not always measured what was the impact of each individual change. So your mileage may vary.

  • I updated from Mandriva 2009.1 to Mandriva Cooker. Actually I don’t know if this has had any direct effect on the performance. However, it’s a pre-requisite or a recommendation for some of the later changes (GNote and ext4).
  • I removed several of the GNOME panel applets, which probably helps in reducing GNOME start up time. I remove the system monitor applet, one of the weather applets, and Deskbar.
  • I removed Tomboy (which was also active as an applet in my GNOME panel) and installed GNote. GNote looks exactly the same as Tomboy and transparently replaces it (it will immediately start showing your Tomboy notes), but it’s written in C++. The fact that now the Mono .NET runtime environment does not need to be started during GNOME start-up, might have improved the GNOME log-in performance.
  • I cleaned up my mailboxes a bit by removing old mails I don’t need anymore. After that, I manually vacuumed the sqlite database used by Evolution. To do so, close Evolution, and run the following commands in the shell (you will need to have the package sqlite3-tools installed):
    $ evolution --force-shutdown
    $ for i in $(find ~/.evolution/mail -name folders.db); do echo "VACUUM;" | sqlite3 $i; done

    This reduced the size of the folders.db for main IMAP account from more than 300 MB to about 150 MB! After this operation much less disk activity happened while starting up Evolution and the system remained much more responsive. It seems I’m not the only one who was suffering from this problem. This is a serious regression since Evolution switched from berkeleydb to sqlite. Apart from this problem, Evolution’s IMAP implementation is currently also very slow with IMAP if you have big folders and no work seems to be done on that… I have the feeling Mutt‘s motto is correct: all mail clients suck, this one just sucks less. Still, I prefer a GUI mail client.
  • I removed Beagle from my system. All in all I don’t used it very often, and it looks like Tracker might become much more interesting in the future.
  • I switched from Firefox 3.0 to Firefox 3.5, which is also a bit faster. Packages are available in cooker’s main/testing repository, or you can just download a build from mozilla.org. A long time ago I experienced slowdowns in Firefox, which I fixed at that time by disabling reporting of attack sites and web forgeries in Firefox’ preferences – Security. It’s better to not disable this if Firefox is working nicely for you.
  • I switched from ext3 to ext4 for my / and /usr partition. You can just switch from ext3 to ext4 by replacing ext3 by ext4 in /etc/fstab. However, then you won’t take advantage of all new features. To do so, switch to runlevel 1 (init 1 in the console), umount the partition you want to migrate (if you want to migrate /, you can mount it as read-only by running mount -o remount,ro /. Then run these commands on the device:
    # tune2fs -O extents,uninit_bg,dir_index /dev/device
    # fsck -pDf /dev/device

    Then reboot your system.
    Don’t migrate your /boot partition or your / partition if you don’t have a separate /boot partition, because this might lead to an unbootable system because I’m not sure whether grub in Mandriva has complete ext4 support.
    I would also recommend running an up to date Linux kernel, because ext4 has undergone many improvements lately. Cooker’s current kernel 2.6.30.1 is working nicely for me.
    For more ext4 information, I recommend reading the Linux kernel newbies ext4 page.
  • My /home partition is using XFS. If you are using XFS, you can run xfs_fsr to defragment files.

After all these changes, my system feels much snappier now than one month ago.

2 thoughts on “Speeding up my Linux system

  1. For whatever its worth, I am having no problem with grub and ext4 on /boot partition. I am really delighted with ext4. I am having no problems with it with KDE4 either. I was using a combination of ext3 and Reiser3 before, but ext4 is very fast and efficient. I do have to admit though that I am looking forward to btrfs! – George

    [root@localhost ghmitch]# mount
    /dev/sdb7 on / type ext4 (rw,relatime)
    none on /proc type proc (rw)
    /dev/sdc1 on /backup type ext4 (rw,relatime)
    /dev/sdb5 on /boot type ext4 (rw,relatime)
    /dev/sda6 on /home type ext4 (rw,relatime)
    /dev/sdb15 on /opt type ext4 (rw,relatime)
    /dev/sdb9 on /tmp type ext4 (rw,relatime)
    /dev/sdb13 on /usr type ext4 (rw,relatime)
    /dev/sda5 on /usr/share type ext4 (rw,relatime)
    /dev/sdb11 on /var type ext4 (rw,relatime)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    none on /sys/fs/fuse/connections type fusectl (rw)
    gvfs-fuse-daemon on /home/ghmitch/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ghmitch)
    [root@localhost ghmitch]# uname -a
    Linux localhost 2.6.29.6-desktop-1mnb #1 SMP Sun Jul 5 19:25:09 EDT 2009 x86_64 Intel(R) Pentium(R) Dual CPU E2200 @ 2.20GHz GNU/Linux

Comments are closed.