Ubuntu: How can I improve Ubuntu overall system performance?



Question:

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

You may uninstall some applets you don't use, turn off auto-run command for some programs (or delay their auto-start). Don't forget about pre-load sudo apt-get install preload. This will greatly speed up starting up software you constantly use.


Solution:2

***Each of the kernel parameters are in a field = value format.

For example, the parameter kernel.threads-max = 16379 sets the maximum number of concurrent processes to 16,379.

This is smaller than the maximum number of unique PIDs (65,536). Lowering the number of PIDs can improve performance on systems with slow CPUs or little RAM since it reduces the number of simultaneous tasks. On high-performance computers with dual processors, this value can be large. As an example, my 350 MHz iMac is set to 2,048, my dual-processor 200 MHz PC is set to 1024, and my 2.8 GHz dual processor PC is set to 16,379.

Tip: The kernel configures the default number of threads based on the available resources. Installing the same Ubuntu version on different hardware may set a different value. If you need an identical system (for testing, critical deployment, or sensitive compatibility), be sure to explicitly set this value.

There are two ways to adjust the kernel parameters.

First, you can do it on the command line. For example, sudo sysctl -w kernel.threads-max=16000. This change takes effect immediately but is not permanent; if you reboot, this change will be lost.

The other way to make a kernel change is to add the parameter to the /etc/sysctl.conf file. Adding the line kernel.threads-max=16000 will make the change take effect on the next reboot.

Usually when tuning, you first use sysctl â€"w. If you like the change, then you can add it to /etc/sysctl.conf. Using sysctl â€"w first allows you to test modifications. In the event that everything breaks, you can always reboot to recover before committing the changes to /etc/sysctl.conf.

***I learned that from this extreme tech article.


Solution:3

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.


Solution:4

Another good way to boost performance is to install CompizConfig Settings Manager, and disable animation effects, Fading Windows, and Window Decorations. Desktop wall and Expo are an option, too.

enter image description here

Also, use fast texture filter under OpenGL

enter image description here


Solution:5

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.


Solution:6

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.


Solution:7

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


Solution:8

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.


Solution:9

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.


Solution:10

Try a light-weight community flavour of Ubuntu

Instead of messing with your Ubuntu system: make a fresh installation of a community flavour of Ubuntu, a flavour with the same Ubuntu engine under the hood, but with a lightweight desktop environment, and with lighter application programs.

  • the ultra-light Lubuntu or

  • the medium light Ubuntu MATE or Xubuntu.

Try them live before installing. It is a good idea to keep using LTS releases, and I suggest that you start with 16.04.1 LTS, which is the version with the longest remaining support until End Of Life. See detailed tips at the following links,

The version with longest support time (when this is written)

It is somewhat tricky to find 16.04.1 LTS, the version with the longest support time. The following links work (2017-06-29),


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »