Ubuntu on low performance laptop

Here are some ways to optimize ubuntu for performance:

1. Optimize disk access with noatime:

Each file and folder on your linux system has a file-creation timestamp and a modification timestamp. Apart from that, linux tries to keep track of “access time” for each of these files. Now keeping track of the access time has its performance-cost, and if you want to remove this performance cost, you need to specify “noatime” attribute in the disk partition entries in your /etc/fstab file. Edit this file in your text-editor and add the noatime option for your disk partition:

UUID=97102801-14e3-9752-7412-d9c57e30981w / ext4 errors=remount-ro 0,noatime 1

2. Optimize Swappiness:

Swappiness is the tendency of the linux kernel to prefer disk-swapping vis-a-vis physical memory. The default swappiness value of 60 was kept considering server installations. If you are a desktop user having a machine with good RAM, you would normally prefer disk-swapping to be minimal. You can safely reduce this value to 10. To do so edit the file /etc/sysctl.conf and add the following:

vm.swappiness=10

(Just change the entry if it already exists, don’t make a duplicate!)

3. Install preload:

If you typically use the same programs regularly, preload will help you by loading into memory, the programs that you use most frequently and thus speed them up. To install:

sudo apt-get install preload

4. Place your mission critical apps in /dev/shm:

Few weeks back, I was having performance issues with running Eclipse on ubuntu. After tweaking and optimizing various JVM settings in vain, the thing that really made the difference was placing the entire JDK folder on ramdisk. The /dev/shm folder is like a virtual ramdisk (on ubuntu and derivatives) where you can place your temporal, high-priority stuff to run them in “best performance” mode. Assuming you have to place your JDK folder on the virtual ramdisk, the command is:

cp -r jdk1.7.0_05/ /dev/shm/

5. Remove unwanted programs from startup:

Ubuntu comes loaded with a ton of baggage, and if you are someone like me, you might feel obliged to reduce some burden off your system by disabling unwanted software from startup. You can do this by going to “Startup Applications” in the System menu, but ubuntu hides the pre-installed apps by default. To overcome this limitation, open your terminal and issue the below command:

sudo sed -i 's/NoDisplay=true/NoDisplay=false/g' /etc/xdg/autostart/*.desktop

ubuntu startup

Now you can go through the startup programs list and can disable the unwanted ones. Common sense will tell you that if you don’t use bluetooth on your machine, you can get rid of the "Bluetooth Manager". Similar is the case with “Backup Monitor” in case you don’t need to sync your backups in real-time. Here is the list of services that I’ve safely disabled without causing any issues:

Backup Monitor
Bluetooth Manager
Chat
Desktop sharing
Gwibber
Ocra screen reader
Personal file sharing
Screen saver
Ubuntu one
update notifier

6. Uninstall software that you don’t use:

The next step is to remove those software that you don’t use at all. Again, some common sense but with some caution is needed here. There are some programs (like empathy) that form the core part of ubuntu, so it won’t allow you to apt-get remove.. them without removing unity itself. In such cases, we will disable such programs from starting up as services (next step). Some of the programs that you may safely remove are:

apt-get remove samba-common
apt-get remove cups
apt-get remove avahi-daemon avahi-autoipd

I typically uninstall all three after a new installation. The first one is needed for file-sharing in the local network if you have one. Second is the print daemon, and third is used to broadcast common network services across the local network and finding local hosts by using friendly names like “local.workstation”.

7. Disable unwanted daemons:

In case you don’t want to remove the cups program as you might need printing in future, you can disable it for the time being. To do so, issue the below command:

echo manual | sudo tee /etc/init/cups.override

You can disable any daemon in this manner by doing a manual override, just replace the “cups.override” with the daemon name that you want removed such as:

echo manual | sudo tee /etc/init/bluetooth.override
echo manual | sudo tee /etc/init/ufw.override
echo manual | sudo tee /etc/init/mysql.override
echo manual | sudo tee /etc/init/tty2.override
echo manual | sudo tee /etc/init/tty3.override
echo manual | sudo tee /etc/init/tty4.override
echo manual | sudo tee /etc/init/tty5.override
echo manual | sudo tee /etc/init/tty6.override

Later, if you want to enable that daemon, all you to do is delete the .override file.

8. Optimize Nautilus to behave in a speedy manner:

This is totally optional. Nautilus, by default, tries to show thumbnails of each and every file in a directory. If the directory contains a lot of files, this causes a noticeable delay. Now if you are in the habit of regularly previewing thumbnails of your images, don’t do this optimization. Otherwise, if previewing thumbnails don’t matter to you and all you are interested in is speed (like me), you can go to Edit->Preferences->Preview-tab and set the preview settings to Never.

9. Disable translation downloads in aptitude:

This setting is for speeding up the downloads from apt repositories rather than your machine. By default, ubuntu adds additional translation repos when you issue “apt-get update” command to update your repository settings. If you only need English, you can disable translation downloads by editing /etc/apt/apt.conf.d/00aptitude and adding this line to it:

Acquire::Languages "none";

Source: My blog post


Install ccsm, open terminal (Ctrl + Alt + T or from the dash) and paste line below:

sudo apt-get install compizconfig-settings-manager

Run it from the dash or in terminal ccsm. Choose OpenGL in General category and change Texture Filter from Good/Best to Fast. Go back and choose Ubuntu Unity Plugin in Desktop category and change Dash Blur from Active Blur to No Blur

Tags:

Performance