Speeding up Ubuntu

For a long time now, I've put up with a slow Thinkpad because, well, I thought it was an inevitable function of its age. You see, I've had this Thinkpad since June 2005; it wasn't even state of the art to begin with (only P40,000 at that time) -- only a Celeron processor with 256MB RAM and shared video -- but it was adequate for my needs. Whatever window I've had to sell this machine has long passed me now; not that I'd want to, as this baby and I have been through a lot.

On the other hand, I tried squeezing more life out of this Thinkpad with a minimalist installation involving Openbox. That worked, but even then, it was still slow. The fault, apparently, lay in heavy disk activity; and the window manager had little to do with that.

A few more searches on the Internet brought me to this page of tips to speed up Ubuntu. And you know what? They work!

Possibly the most helpful tip involved the swappiness setting. That works by changing the value of vm.swappiness to 10.

sudo sysctl vm.swappiness=10

Making this permanent involves a change in /etc/sysctl.conf by adding the line:

vm.swappiness=10

What is "swappiness?" According to this article at kerneltrap.org:
Swappiness is a kernel "knob" used to tweak how much the kernel favors swap over RAM; high swappiness means the kernel will swap out a lot, and low swappiness means the kernel will try not to use swap space.

There's a lot of discussion about what value is most appropriate (for example, see this other article). Your own mileage may vary. As for me, setting it to the low value of 10 practically eliminated the heavy disk activity.

I did a few other things, notably:

1. Disabling IPv6

Edit /etc/modprobe.d/aliases and change the line:

alias net-pf-10 ipv6

to

alias net-pf-10 off #ipv6

2. Aliasing hostname to localhost

Modify /etc/hosts's first two line as follows:

127.0.0.1 localhost yourhost
127.0.1.1 yourhost


3. Installing preload

sudo apt-get install preload

The other instructions pertained to bootup time. While they were helpful, they really weren't my main concern. I did do the profile and concurrency tricks, however, and they seem to have shaved a few seconds off my boot time.