วันพุธ, มิถุนายน 13, 2555

Ubuntu on SSD; application tuning for best performance

Ubuntu on SSD

Tuning application's cache/temp directory for best performance.

    From previous post running-ubuntu-on-ssd-tweak. We already have instruction on howto move Firefox's cache to RAM, the tmpfs. This post will show howto do it with others.

Google Chrome

Change execute parameter in Google Chrome launcher file.
$sudo vi /usr/share/applications/google-chrome.desktop 

...
# Exec=/opt/google/chrome/google-chrome %U
Exec=/opt/google/chrome/google-chrome --disk-cache-dir="/tmp/" %U

...

duplicate old line then comment it. put additional parameter to a duplicated line; --disk-cache-dir="/tmp/" 

If you want to specify the cache size see the reference.

reference:
  1. http://www.ghacks.net/2010/10/19/how-to-change-google-chromes-cache-location-and-size/ 
  2. http://www.joeyconway.com/blog/2011/09/11/ubuntu-ssd-move-chrome-cache-to-ram/

Running Ubuntu on SSD; tweak & configuration for best performance

Ubuntu on SSD 

tweak & configuration for best performance



Start with 1st, 2nd reference (1, 2)

Modify the /etc/fstab & I/O scheduler 
 # <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    nodev,noexec,nosuid 0       0
tmpfs        /tmp        tmpfs        nodev,nosuid,noatime,mode=1777 0    0
# / was on /dev/sda1 during installation
UUID=338c2a9f-8a5f-4e4e-90c5-30d02a7680c5 /               ext4    defaults,noatime,discard,errors=remount-ro 0       1
# /home was on /dev/sdb5 during installation
UUID=68f602b9-5384-4be2-8b7a-cbc1001504d2 /home           ext4    defaults        0       2
# swap was on /dev/sda5 during installation
# ram 8G no need swap
# UUID=2b531fb1-b9fc-4653-859a-58af74951a2c none            swap    sw              0       0
Automatic TRIM  (3)
is supported since kernel 2.6.33 with the EXT4 file system
For automatic TRIM to work, the drive needs to be mounted with the "discard" option in fstab.
...
# / was on /dev/sda1 during installation
UUID=338c2a9f-8a5f-4e4e-90c5-30d02a7680c5 /               ext4    defaults,noatime,discard,errors=remount-ro 0       1
...

Modify /etc/rc.local (1, 2)
...
echo deadline > /sys/block/sda/queue/scheduler
echo 1 > /sys/block/sda/queue/iosched/fifo_batch
...
exit 0
Modify applications (4)
    Firefox puts its cache in your home partition. By moving this cache in RAM you can speed up Firefox and reduce disk writes. Complete the previous tweak to mount /tmp in RAM, and you can put the cache there as well.

Open about:config in Firefox. Right click in an open area and create a new string value called browser.cache.disk.parent_directory. Set the value to /tmp.

reference:

  1. http://askubuntu.com/a/86474
  2. http://itezer.com/blog/ubuntu-linux/125-four-tweaks-for-using-ubuntu-with-ssd.html
  3. TRIM http://askubuntu.com/questions/18903/how-to-enable-trim 
  4. http://tombuntu.com/index.php/2008/09/04/four-tweaks-for-using-linux-with-solid-state-drives/ 

Ubuntu: change,remove gnome-shell network applet

gnome-shell's network applet is a bit unfinished.

1.    disable the gnome-shell's network applet, reverting to the old network-manager applet (nm-applet) by doing sudo mv /usr/share/gnome-shell/js/ui/status/network.js /usr/share/gnome-shell/js/ui/status/network.disabled and execute (via alt+F2) the command 'r' (without quotes), to reload gnome-shell.

2.    run nm-connection-editor to edit the connection (or right click the network icon).

reference: http://askubuntu.com/a/86508