350

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.

11
  • 44
    It would be a good idea to mention how effective your tip is: how much of an improvement did you notice, or even better, measure? – Gilles 'SO- stop being evil' Aug 13 '10 at 17:47
  • 5
    I have not found any evidence that changing the swappiness has any positive effect. It might give a temporary feeling of performance increase, that seems to subside quite fast. I have not seen any concrete evidence in form of benchmarks that would proof the effectiveness of changing the swapiness parameter – txwikinger Aug 14 '10 at 14:27
  • 5
    I doubt it has any noticeable performance impact. The ttys used hardly any memory, nor would there be any significant cpu usage. – txwikinger Aug 16 '10 at 14:37
  • 6
    Isn't "premature optimization the root of all evil"? (en.wikipedia.org/wiki/Program_optimization#Quotes) – Alejandro Sep 26 '10 at 2:11
  • 2
    @Alejandro that quote assumes that you've done it as well as you could in the first place. – Thorbjørn Ravn Andersen May 16 '12 at 13:26

37 Answers 37

1
2
1

I find strange that no one has mentioned anything about Unity. Unity is definitely something that one should consider removing if the system has to work faster (I shall not discuss whether Unity boost the user's productivity or not since this is quite subjective for many people).

I just got my hands on a virtual appliance created with VirtualBox with Ubuntu 14.04 with Unity in it. The default machine settings were 32MB memory for video, 2GB for RAM and 100% performance cap on the CPU (single one was chosen). Of course my CPU is a bad one (a 5-6 years old i3 from Intel with 1.66GHz and two cores). Because of the huge amount of RAM that was dedicated to the VM and the presence of only 3.8GB physical memory on my host I decided to reduce it to 512MB. It was unbelievable how sluggish the system was.

The recommended minimum system requirements given by Canonical are a joke. I cannot imagine anyone working at all under such conditions. Yes, these are minimum requirements but what is usually understood by that is that the system is still usable to a some non-suicidal degree with the exception of working with applications that require a lot more. The window manager should not put such a huge restriction on the hardware used (Windows Vista anyone?) especially since Canonical removed the Gnome 2 Classic option upon login (currently there are of course alternative, which are however not officially supported by Canonical). Appearance is something important especially if we follow one of the most profound rules in design and usability - "Form follows function". It should not however do what Unity does to the system resources. I strongly recommend starting from reducing the fancy-pancy garbage on your system and the first thing towards that is to replace Unity with for example LXDE, which looks great, offers a lot of room for customization (Unity and customization - pfffff...) and is a beast when it comes to small CPU usage and miniature memory footprint combined with the functionality it provides. My VM is currently flying after a single step of installing vanilla lxde:

$ sudo apt-get install lxde

A much more better way is to go for one of the variations of Ubuntu such as Lubuntu (LXDE) or Xubuntu (XFCE), which profit from the fact they share the same repositories, security updates, patches etc. with Ubuntu yet do not suck the life out of your machine. Installing another window manager on top of Ubuntu (which defaults to Unity) definitely helps a lot but Ubuntu's default installation also comes with a huge amount of resource-hungry services and applications most (all?) of which have more lightweight alternatives.

1
  • I find that Unity is actually very fast on some computers and very slow on others. I think this might just be a video card driver issue or something. I use Xubuntu, myself, though, as I find more utility in it, and Unity is slow on my current computer (which far exceeds Unity's requirements). – Brōtsyorfuzthrāx May 21 '15 at 3:52
1

If you edit video files, set up a stripped RAID 0 configuration for your video files. I noticed significant improvement in the smoothness of video editing after I did this.

http://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_0

Of course you will need a minimum to two hard drives to do this, and it's easier if they are separate from the drive the OS is on (If you only have two hard drives, as I did, you can create a mirrored, RAID 1, boot partition and then a RAID 0 partition for everything else).

Note that since RAID 0 provides no fault tolerance or redundancy, the failure of one drive will cause the entire array to fail; as a result of having data striped across all disks, the failure will result in total data loss.

0

ADVANCED, DO NOT DO IF YOU DO NOT KNOW WHAT YOU ARE DOING

Compile your own kernel. http://www.overclock.net/a/how-to-configure-and-compile-a-custom-linux-kernel-for-ubuntu It may take quite some time, so do something else while you compile it. Once you're done, install the files and celebrate. Especially if you get huge speed improvements. :D

3
  • 9
    Does anyone know if there are any remotely recent benchmarks that substantiate the idea that using a self-configured, self-built kernel is likely to produce significant speed improvements in current Ubuntu desktop systems? (If so, perhaps that information could be added to this answer.) – Eliah Kagan Jun 1 '12 at 22:43
  • Even if compiling your own kernel does not dramatically improve speed, it is a good Linux exercise that you should certainly do if you want to get more experienced with Linux (or, alternatively, if you are just super curious and want to find out what is happening under the hood). – fouric Oct 24 '12 at 21:38
  • 1
    For the time spent configuring your own kernel, the 0.2 seconds shaved off boot time and the <0.1% performance improvement under load is definitely worth the hassle </sarcasm> * numbers from my own experience. – Mark K Cowan Nov 5 '13 at 2:10
0

Using localhost as the the host name

This method could improve the speed of start the application .

nano /etc/hosts

127.0.0.1          localhost Ubuntu
127.0.1.1          Ubuntu

In the end of the first line, add the host name, which is the name of the second line.

4
  • I'm curious about what that tweak is supposed to accomplish? – FuzzyQ Jun 28 '12 at 12:41
  • 6
    That doesn't answer the question and I didn't ask because I don't believe it. I wanted technical details. Thanks for your reply though. – FuzzyQ Jun 28 '12 at 14:28
  • gui load faster ..tested in redhat 5 – One Zero Jun 28 '12 at 15:13
  • 3
    This provides no information as to why we should follow your advice. Some context and benchmarks please. – reducing activity Apr 16 '16 at 6:16
0

Use EXT4 file system

Adding noatime and nodiratime Edit fstab file

# nano /etc/fstab

Add discard to your ssd drives or partitions, after ext4

UUID=bef10b86-494d-41c6-aa46-af72cfba90fd / ext4 discard,noatime,nodiratime,errors=remount-ro 0 1

Disable hibernation Edit

# nano /usr/share/polkit-1/actions/org.freedesktop.upower.policy

Look for

<allow_active>yes</allow_active>

Change from “yes” to “no”, there are two, one for hibernation, and another one for suspend. If you have to disable them both, make sure to replace them both from yes to no.

<allow_active>no</allow_active>

Tmpfs

Edit fstab file

# nano /etc/fstab

Add the line to the end of fstab file

tmpfs /tmp tmpfs defaults,noatime,mode=1777 0 0

If logs aren’t important for you (laptop or desktop), you can also mount /var/log to

tmpfs. Add the line to the end of fstab file
tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0

Preload To install preload on Ubuntu, Linux Mint or debian based distributions

# apt-get update && apt-get install preload

To install preload on Fedora, Centos or Redhat based distributions

# yum install preload

Swap and Swapiness To change swappiness setting:

$ su -
# nano /etc/sysctl.conf

And add this line into sysctl.conf file.

vm.swappiness = 10

You can read more at nam huy linux blog How to tweak and optimize SSD for Ubuntu, Linux Mint http://namhuy.net/1563/how-to-tweak-and-optimize-ssd-for-ubuntu-linux-mint.html

1
  • 1
    Welcome to Ask Ubuntu. A few remarks. You don't explain how to use EXT4 or how to check if you are already using it. The fstab thing only applies if you are running a SSD. Please explain this before telling what to change. How will disabling hibernation improve performance? yum should be apt-get I guess. – MadMike Nov 5 '13 at 7:21
0

The other answers say a lot, already. However, make sure you're using the optimal video card driver for your system. Using the wrong one can really slow it down. The best one for my system on Xubuntu 15.04 is the legacy Nvidia one. The newest version and the open source one are either slower with certain applications (such as Tkinter apps and SciTE), or they crash my computer.

I might recommend not using lightdm for locking your screen and such, because unless they've fixed it in this new release, it's a lot slower going to sleep and waking up than what they used to use. That might seem program-specific, but it really does go a long way toward a faster computer, practically speaking, in my opinion.

I would recommend looking at hardware instead of software tweaks, after you've done all the software tweaks you can handle. You might consider a solid state hard drive.

You also might consider using a different window manager.

0

One desktop that I would definitely recommend over Unity, or even XFCE, is i3. There's a website for it here. I have seen major improvements in performance, even on my netbook with 1GB of RAM.

1
2

Not the answer you're looking for? Browse other questions tagged or ask your own question.