Question: What are your tips for improving overall system performance on ubuntu? Inspired by this [question](https://askubuntu.com/q/2099) 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](http://techthrob.com/2009/03/02/drastically-speed-up-your-linux-system-with-preload/) (via Software Center or `sudo apt-get install preload`);
* Change [Swappiness](https://help.ubuntu.com/community/SwapFaq) 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.

Answer: 
If you are short of RAM, use [zramswap](http://www.webupd8.org/2011/10/increased-performance-in-linux-with.html) 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](https://askubuntu.com/questions/56673/how-to-permanently-enable-compressed-ram-swap-what-version-to-use), 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](https://help.ubuntu.com/community/SwapFaq#What_is_swappiness_and_how_do_I_change_it.3F) 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.
Tuning ext4 for maximum smoke
=============================

Enable writeback mode. This mode will typically provide the best ext4 performance. Note that it happens at cost of reliability as it disables journaling for writing data. Data may be written into the main filesystem after its metadata has been committed to the journal. As result old data may appear in files after a crash and journal recovery.

```
tune2fs -o journal_data_writeback /dev/sdXX

# Check fs options
dumpe2fs /dev/sdXX |more

```

[Documentation from kernel.org](https://www.kernel.org/doc/Documentation/filesystems/ext4.txt):

> 
> In data=writeback mode, ext4 does not journal data at all. This mode provides a similar level of journaling as that of XFS, JFS, and ReiserFS in its default mode - metadata journaling. A crash+recovery can cause incorrect data to appear in files which were written shortly before the crash. This mode will typically provide the best ext4 performance.
> 
> 
> 

Even more smoke
===============

To squeeze even more performance add `fstab` options: `data=writeback,noatime,nodiratime`

i.e., edit your `/etc/fstab` find the UUID for your drives and add/replace existing options

```
/dev/sdXX /opt ext4 defaults,data=writeback,noatime,nodiratime 0 0

```

Ensure you have used tune2fs to turn on writeback mode BEFORE you edit your fstab file and BEFORE you reboot. I say BEFORE because I rebooted after I altered my fstab but before I turned on writeback mode and borked my boot. Nothing lost but I had to use a live CD to gain access and change my fstab. Safer if you enable on a non boot drive to test first.

Massive improvement in speed in both boot and shutdown and day to day use.

You can also turn off Journal mode that will give an added boost, for added safety make sure you have a UPS connected and working because with these features turned off your data isn't as safe, having said that my system doesn't have a UPS and it's power has been interrupted at least three times and I've suffered no data loss, but your mileage may vary.