Mar 16, 2009

SSD Tweaks for less I/O from eeeUser

The following post was copied from: http://wiki.eeeuser.com/ubuntu:eeexubuntu:customization

Even less disk IO

http://forum.eeeuser.com/viewtopic.php?id=5984.

On machines with a swap partition add the following to:
> sudo mousepad /etc/rc.local

Put these two lines just before the “exit 0” statement at the end:
sysctl -w vm.swappiness=1           # Strongly discourage the swapping of application data to disk
sysctl -w vm.vfs_cache_pressure=50 # Don't shrink the inode cache so aggressively.
This reduces the likelihood of the actual applications, or directory listings, from being paged out. Disk page cache is not nearly as important as random access SSD reads are faster than on HD. As a by-product the above will improve the responsiveness for interactive use (which is the primary use of the EEE), although reducing the overall performance of the system.

Or you can avoid changing the script and edit /etc/sysctl.conf instead. Change the last line to be

vm.swappiness=1

then add the line

vm.vfs_cache_pressure=50

Add noatime to your fstab

By default Linux ext2/3 keeps a tab on access times for every file on the system. This leads to more writes than we need. Add “noatime” to the options for the / mount as shown below.

> sudo mousepad /etc/fstab
# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
# /dev/sda1
UUID=10d03d2a-7732-4f6f-924f-541b39dd9559 / ext2 defaults,noatime,errors=remount-ro 0 1
#/dev/sdb1 /media/cdrom0 udf,iso9660 user,noauto,exec 0 0
You will need to reboot or run …

sudo mount -o remount /

On newer kernels, “relatime” provides much the same advantages while maintaining higher compatibility (some mail clients rely on atime).
Use ramdisk for temp files

RAM-based temporary file systems

This saves SSD disk space and reduces the number of writes to the SSD, which will maximise its lifetime and provide a very small improvement to system performance.

Edit /etc/fstab again

> sudo mousepad /etc/fstab

and add these lines to the end
# enable RAM-based temporary file systems
tmpfs /var/tmp tmpfs noatime 0 0
tmpfs /tmp tmpfs noatime 0 0
This means that anything stored in /var/tmp or /tmp won't survive a reboot. If you're debugging a problem where you need to preserve those files e.g after a crash, then you can temporarily comment out those lines.

.

No comments:

Post a Comment