Thursday, May 12, 2016

How to speed up and tweak Ubuntu 16.04

1.Unity Tweak Tool:

Unity Tweak Tool is a settings manager for the Unity desktop. It provides users with a fast, simple and easy-to-use interface with which to access many useful and little known features and settings of the desktop environment that one may want to configure.

To install unity tweak tool copy paste the the following commands into your terminal 

(ctrl+alt+t) :

sudo apt install unity-tweak-tool



(Unity Tweak Tool can be opened by doing a Dash search as well )

To speed up Unity go to General  set texture quality to fast under hardware acceleration and turn off animations .

2.Install Compiz Config :

Compiz is a compositing window manager for the X Window System, using 3D graphics hardware to create fast compositing desktop effects for window management. Effects, such as a minimization animation or a cube workspace, are implemented as loadable plugins.

To install CompizConfig , open a terminal (ctrl+alt+t) :

sudo apt install compiz compizconfig-settings-manager 

After the installation is done you can open the settings-manager 

from Dash .

Go to Composite and uncheck Detect Refresh Rate:

Hit back and return to the main configuration window . Next click on OpenGL and uncheck
Sync to VBlank. (caution using compizconfig-settings-manager as it can break your system)

3.Moving Temporary Files to Memory (RAM):

Before starting this process it’s a good idea to backup the fstab file:

sudo cp /etc/fstab /etc/fstab.bak

The next step is to edit fstab:

sudo gedit /etc/fstab 

Add the following lines at the end of the file :

tmpfs /tmp tmpfs defaults,noatime,size=1G,mode=1777 0 0

tmpfs /var/tmp tmpfs defaults,noatime,mode=1777 0 0
tmpfs /var/log tmpfs defaults,noatime,mode=0755 0 0 
tmpfs /var/log/apt tmpfs defaults,noatime 0 0

The first line mounts /tmp in memory with a size limit of 1 gig. This may be larger than you need. If you exceed this limit the swap area will be used.
The second line mounts /var/tmp into memory. The third mounts the logfiles in /var/log–note this means that a reboot will clear your log files which may not be what you want. The fourth line mounts the temporary files associated with apt into memory.
The new mount points will become active on your next reboot.

4.Control Startup Applications:
Ubuntu hides most of the system’s default autostart entries from this dialog. To view them, run the following command in a terminal:

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

Don’t disable an autostart entry unless you understand what it does.
5. Tune Swappiness

If you have alot of RAM this tweak is for you . The swappiness value controls the Linux kernel's tendency to swap - that means moving information out of RAM and onto the swap file on the disk. It accepts a value between 0 and 100. In order to change swappiness value we need to edit /etc/sysctl.conf :

sudo gedit /etc/sysctl.conf
Look for vm.swappiness in the file and change its value. If it doesn’t exist, add it to the end of the file on a new line.

vm.swappiness = 1 (1” is the minimum possible “active swapping” setting while “0” means disable swapping completely and only revert to when RAM is completely filled. Using these settings in low-spec systems of 2GB RAM or less may cause freezes and make the OS completely unresponsive)

Save the file after making the change.


6. Install Preload: 
Preload is an adaptive readahead daemon that prefetches files mapped by applications from the disk to reduce application startup time.

sudo apt-get install preload

7. Disable Ping Response:

sudo gedit /etc/sysctl.conf

and add the following line at the bottom page . Make sure there is no "#" ahead of the line as it will uncomment it :

net.ipv4.icmp_echo_ignore_all = 1

Other network tweaks  

In the same file you can also add :

net.core.somaxconn = 1000
net.core.netdev_max_backlog = 5000
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_wmem = 4096 12582912 16777216
net.ipv4.tcp_rmem = 4096 12582912 16777216
net.ipv4.tcp_max_syn_backlog = 8096
net.ipv4.tcp_slow_start_after_idle = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.ip_local_port_range = 10240 65535

Once you have completed editing the file save the file and close it.

Before network tweaks: