How can I improve Ubuntu overall system performance?

What are your tips for improving overall system performance on ubuntu? Inspired by this question I realized that some default settings may be rather conservative on Ubuntu and that it's possible to tweak it with little or no risk if you wish to make it faster.

This is not meant to be application specific (e.g. make firefox load pages faster), but system wide.

Preferably 1 tip per answer, with enough detail for people to implement it.

A couple of mine would be:

  • Install Preload (via Software Center or sudo apt-get install preload);
  • Change Swappiness value - "which controls the degree to which the kernel prefers to swap when it tries to free memory";

What are yours?

PS: Since this is not intended to have a unique answer but rather, several useful tips, I'm making this community wiki out-of-the-box.


Solution 1:

If you are "the average Joe", then just don't do anything. Don't fiddle with programs or settings which you don't understand. Don't follow tips posted on the Internet how to improve the performance of your system by compiling some software yourself or by installing a selfmade kernel.

Some of those tips may give you minor performance improvements indeed, but some of them will also give you a real headache, if you changed the wrong setting, disabled the wrong service, installed the wrong driver etc.

Therefore just be happy about your nicely running system. And BTW: Why would you need those 5 percent performance improvements? It will not lead to typing your office documents faster or editing your holiday photos in half the time.

And just to be clear: If you are not the average Joe, but a developer/hardcore gamer/... needing any cycle you can get, you are not the target of this comment...

Solution 2:

Disable automatic startup of any services that are not needed (or even remove the package completely).

A lot of packages start up services automatically. These services then use memory and CPU even they are hardly ever used. It is better in this case, to stop those services, or take them out of autostart, and start them up only if they are needed.

To remove applications from starting up on 10.04,go to System > Preferences > Startup Applications (may be slightly different on other versions)

On 12.04, you can go select the startup applications by clicking on the Dash Icon. Then, type startup and select "startup applications".




alt text

And just unmark the apps you don't need. But be sure about it, don't just remove apps you don't know. If you are not sure about one, leave it that way. A google search or new question here about specific programs will help.

Solution 3:

[Disclaimer] Administer the following at your own risk.

Tushar Neupaney gives this advices here:

1. Use lighter applications (Replace your default applications with them)

  • Gedit >> Mousepad
  • Picture viewer (EOG …) >> Gpicview
  • Network Manager >> Wicd
  • Evince >> epdfview

2. Decrease Swappiness

  • sudo vim /etc/sysctl.conf

    Edit: vm.swappiness=10

3. For dual cores (Use Concurrency)

  • sudo vim /etc/init.d/rc

    Edit: CONCURRENCY=shell

    shell option is now obsolete. Default value is makefile and shell is by 2010-05-14 an alias for makefile.

4. Clean up apt cache at /var/cache/apt/archives and unneccessary apt-sources list in /etc/apt/sources.list

  • sudo apt-get autoclean

5. Install BUM (Boot Up manager)

  • sudo apt-get install bum

    Remove unnecessary applications and services from startup

6. Remove some unnecessary TTY’s

  • sudo vim /etc/default/console-setup

    Edit: ACTIVE_CONSOLES=”/dev/tty[1-3]“

    Note: goto /etc/init/ and change the tty’s files that you DO NOT want. Edit them and comment lines starting with “start on runlevel”. So, in this case, you’ll comment the start line in "tty4.conf" to "tty6.conf" files.

7. Install Prelink

  • sudo apt-get install prelink
  • sudo vim /etc/default/prelink

    Edit: PRELINKING=Yes

  • sudo /etc/cron.daily/prelink

    Actually, Prelink is useless since Feisty Fawn (because Ubuntu uses a very effective runtime linker now). In addition, it's intrusive - it directly modifies the executables and ultimately can break them. DO NOT do it.

8. Install Preload

  • sudo apt-get install preload

9. Get rid of kinit if you don’t use hibernate and sleep functions.

  • sudo vim /etc/initramfs-tools/conf.d/resume

    Edit: Comment (Put # in front of) RESUME=XXXX…………………….

Solution 4:

Decrease your boot loader menu timeout

Sounds trivial, but I found the default 10 seconds in Ubuntu is too long for my tastes. Say my screen takes a bit to auto-adjust the res, I see the counter reads 8 seconds at first sight.

I would edit the timeout to 3 seconds, giving me a second to see the boot menu (accounting for the time my screen adjusts to the res). Plenty of time, as pressing the arrow keys to select another item stops the counter.

Grub (before 9.10 Karmic)

sudo -i gedit /boot/grub/menu.lst

Find and edit the "TIMEOUT" line

Grub 2 (new installs of 9.10 Karmic and after)

sudo -i gedit /etc/default/grub

Find and edit the "GRUB_TIMEOUT" line, and run sudo update-grub

Solution 5:

If you are short of RAM, use zramswap or zram-config from Ubuntu repos. It's virtual swap that compresses unused RAM contents instead of putting them to disk (which usually freezes the system after you hit the RAM barrier). I experience little to no performance loss with it instead of system freezing every time I run out of RAM.

This works only for Natty and up (because you'll need kernel 2.6.37.1 or newer). For older systems you can use compcache, but you'll have to set it up manually.

For those who never hit the RAM limit it gives some speed boost on HDD systems anyway, but you'd better decrease swappiness to achieve the same effect.

SSD users: most likely you won't experience any speed boost, but zramswap can reduce SSD wear quite a lot.