I recently purchased a netbook as I was looking for a small, lightweight machine for traveling. Overall I am happy with it and over the last two weeks have gotten it configured. I did find it is slightly under powered and as such there are a number of performance tweaks I learned along the way.
I am limiting this blog to those changes that I feel make a difference, either in boosting performance or reducing the hard drive activity. Many of these tweaks can be used on most any netbook, laptop, or desktop although you may need to make some (minor) modifications to some to the paths.
Note: Thank you to tinivole for reviewing some of these settings and suggesting moving some of them into /etc/sysctl.conf .
Choosing an operating system
In general use the most up to date OS / kernel you can. For example Ubuntu 9.04 > Ubuntu 8.10 > Ubuntu 8.04 (and Fedora 11 > Fedora 10). If you can tolerate the potential of an Alpha or Beta release, all the better.
In general, a newer kernel offers better hardware support and in general you are going to have less problems with wireless, usb, SSD, etc.
In general the newer kernels are going to give you better performance (there will always be specific exceptions for specific hardware of course).
Netbook specific re-spins
There are several netbook specific respins. Examples include UNR, Moblin, and Linpus. There is also Joilcloud, but it is in Alpha right now and by “invite only”. As of this writing I have not received an response to my request for an “invite” so I do not know if the distro is still active.
In general these include a custom GUI (graphical Interface) optimized for the small screens found on most netbooks. As with most customizations, it is a matter of preference as to what kind of interface one finds comfortable. I suggest you at least try one of these respins (they are all fairly similar).
In general I did not find these distributions were particularly optimized for netbooks either in terms of performance or in terms of kernel improvements / hardware detection. Things such as netbook specific modifications for lm_sensors, wireless drivers, Video Intel GMA500 (Poulsbo) drivers, etc were absent.
In summary, these netbook specific respins, at the moment, seemed to be primarily a reworking of the GUI (Graphical Interface) and not of much benefit (at least on my hardware) in terms of hardware recognition or performance.
Netbook specific kernels
There are several netbook specific kernels available. In general these did not work well (some did not install at all) and I suspect they are very CPU specific. If you are interested in such things, I would advise you compile a custom kernel yourself. If you do not know how to do this, custom kernels are probably not for you =)
In summary, custom kernels are, IMO, a labor of love and in my experience with them I have not found the give a significant performance boost. I suggest using the most up to date kernel possible (as of this writing Fedora 11, rawhide (Fedora testing), Ubuntu 9.04, or Ubuntu 9.10 Alpha).
Optimize X
X , or your graphical interface, can slow down your computer if it is not configured properly. Unfortunately optimizing X varies with hardware and so it is almost impossible to be more specific.
Many netbooks contain the Intel GMA500 (Poulsbo) and there are no opensource drivers. Installing the Poulsbo driver will improve performance.
There are some repositories for the drive for both Fedora and Ubuntu. These drivers may work on other systems (Debian, SUSE, etc), but I have not tried.
Fedora : AdamW’s repository .
Ubuntu :
1. See the AspireOne page on the Ubuntu Wiki .
2. There is a second repository here maintained by alberto milone.
File system
ext2 and ext4 are both noticeably faster then ext3. No I do not have any hard and fast benchmarks to prove it nor have I bench-marked other file systems.
Maximize your use of RAM
Linux does not use RAM the same way as other operating systems and, in general, unused RAM is wasted RAM. In addition RAM is much much faster then using your swap file. Optimizing your RAM will both improve speed and reduce wear and tear on your hard drive.
This section will be a little long and perhaps a tad intimidating, especially if you are new to Linux, but hang in there =)
Mount a /tmp /var/log and /var/tmp in RAM
This is done by editing /etc/fstab and RAM is termed “/dev/shm” and “tmpfs”.
Using any editor (gksu gedit or sudo nano), add these lines to /etc/fstab :
# This first line is not strictly necessary.
tmpfs /dev/shm tmpfs defaults 0 0
tmpfs /var/log tmpfs noexec,nosuid 0 0
tmpfs /tmp tmpfs noexec,nosuid 0 0
tmpfs /var/tmp tmpfs noexec,nosuid 0 0
*noexec and nosuid were added for security, I am not sure if they are necessary for tmpfs.
Advantages:
i – Less wear and tear on your hard drive / SSD.
ii – tmp file are also faster if they are in RAM. We will take advantage of this later with Firefox.
Disadvantages:
i – You will loose your logs and when your reboot. This is important if you are trying to debug an application / service / kernel or if you need to perform forensics (on a cracked system).
ii – Your cached pages will be lost when you reboot.
iii – I am not sure what will happen if you fill your RAM, via say burning a DVD, my netbook does not have either a CD or DVD burner =).
Fix services
Do not reboot yet, some services will not like it when the now empty /var/log . Using any editor, add these lines to /etc/rc.local (varies with your Operating system).
Fedora:
#Fix logs
for dir in audit ConsoleKit cups dirmngr prelink fsck gdm ntpstats samba setroubleshoot ; do
if [ ! -e /var/log/$dir ] ; then
mkdir /var/log/$dir
fi
done
Ubuntu:
#Fix logs
for dir in apparmor apt ConsoleKit cups dist-upgrade fsck gdm installer news ntpstats samba unattended-upgrades ; do
if [ ! -e /var/log/$dir ] ; then
mkdir /var/log/$dir
fi
done
Reduce swappiness
Swappiness it the tendency of your system to use swap (vs RAM) and varies from 0 (almost never use swap) to 100 (prefer swap to ram).
Using any editor, add these lines to /etc/rc.local (you may need to confirm the path for some of these options). Some of these options are for power savings, the vm.swappiness will give you the most noticeable gain in performance.
# As in the rc.last.ctrl of Linpus
echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
#All one line
cat /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate_max > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate
#All one line
cat /sys/devices/system/cpu/cpu1/cpufreq/ondemand/sampling_rate_max > /sys/devices/system/cpu/cpu1/cpufreq/ondemand/sampling_rate
echo 1 > /sys/devices/system/cpu/sched_smt_power_savings
echo 10 > /sys/module/snd_hda_intel/parameters/power_save
Using any editor, add the following values to the bottom of /etc/sysctl.conf
# Netbook performance
vm.swappiness = 1
vm.vfs_cache_pressure = 50
vm.dirty_writeback_centisecs = 60000
vm.dirty_ratio = 90
vm.dirty_background_ratio = 1
vm.laptop_mode = 5
Tuning Firefox
There are many tutorials on how to improve Firefox on the Internet, I find these useful.
Minimize your use of Add-ons.
In general, the more add-ons the slower Firefox will perform.
about:config
Open Firefox and enter “about:config” (without quotes) in the address box.
Use the search function to find and set the following values:
#Turn your cache off for off line use
browser.cache.offline.capacity 0
browser.cache.offline.enable false
# Add this one manually (as a string).
# It instructs Firefox to use /tmp/firefox which if you recall is mounted in RAM, thus it is fast.
browser.cache.disk.parent_directory /tmp/firefox
network.http.max-connections 96
network.http.max-connections-per-server 32
network.http.pipelining true
network.http.pipelining.maxrequests 8
Optimize the database
Firefox uses SQLite and it is helpful to clean the databases.
Using any editor, add this line to /etc/rc.local :
for i in /home/*/.mozilla/firefox/*/*.sqlite; do sqlite3 $i ‘VACUUM;’; done
Lower the ondemand threshold
When idle your CPU will slow down. Obviously if you are not performing CPU intensive tasks this makes sense (think power savings). Ondemand is the threshold at which the CPU will run faster. I add this as all one line in /etc/rc.local :
#This is one long line
echo -n 40 >| /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold | tee >| /sys/devices/system/cpu/cpu1/cpufreq/ondemand/up_threshold
Lighten your Window manager
Obviously this is a matter of preference, but not all window managers are created equal, some are lighter and faster then others. Basically it comes down to features and personal preferences. Try performing a minimal installation and add in a light weight window manager and, rather then a full Desktop Environment such as Gnome or KDE, add in only those applications you will use.
Personally I prefer XFCE, Fluxbox, and Enlightenment. Other options include a minimal gnome, minimal KDE, Openbox, LXDE, ICEWM, and many others.
Use light weight applications
Again it is a matter of preference, but there are a number of lighter weight applications you can use and most of these will run faster. For example, if you are performing text editing (word processing) you could use vim, emacs, nano, gvim, notepad, leafpad, gedit, kate, or abiword in place of Open Office.
Similar you can use a light weight browser such as links or dillo in place of Firefox.
The point is, try new lighter applications and decide for yourself if you like the trade off of features vs. speed.
References
Ubuntu Wiki “Aspire One” page
Fedora 11 on the Acer One
Tips on Firefox optimization
Pingback: Shadows of epiphany » Blog Archive » Netbook optimization » NetbookBlog
Pingback: Twitter Trackbacks for Shadows of epiphany » Blog Archive » Netbook optimization [bodhizazen.net] on Topsy.com
Very nice article. I actually run Windows XP on my netbook currently as I could not get flash videos to play full screen without being choppy in Linux. I may take some of your tips and give it another try.
I’d also like to say that Jolicloud is a wonderful little OS. I love the interface they created (based on GNOME). The only gripe is the graphics lag when you switch between apps. It seems they are alive and well, although the blog hasn’t been updated in a week (http://www.jolicloud.com/blog/). The only thing I am waiting for is Intel Atom optimizations at the kernel level, which they promise in their next alpha release.
Pingback: My PC Tweaks - Video Course On PC Optimization. | 7Wins.eu
I have to try this! Thanks bodhi! If you are interested I have some battery life tweaks series going on at my blog. :)
Pingback: Ubuntu 9.10 and USB hard Drive/flash Drive - Ariotek Forums
Perfect, it worked 100%!
Tested on a Lenovo S10, Ubuntu/Debian 9.04
Thanks in the name of all humans.
I have found installing rt-linux and tweaking /etc/security/limits.conf to greatly improve the performance on my asus eee to the point that LMMS and youtube work quite well actually ;-)
@ Steve linky ?
Nice article.
FYI, when the memory is filled up anything in tmpfs will be written to the swap file. That is the advantage of tmpfs over ramfs. Same thing happens if tmpfs is filled up, it is written to the swap file.
@Steve: Glad you liked it, thank you for the comments.
Great article and some interesting advice Bodhi. I esp like the use of a Ram Disk. I am currently using Bodhi Linux on an Acer aspire one netbook and it works great. No sluggishness or any problems with flash. I never really understood the complaints about flash on linux as I have never had any problems with it in any distro, perhaps it is an issue with certain video cards.
But anyway you should give Bodhi Linux a try, it has your name, lol. But regardless of that it is currently based on ubuntu 10.04 and uses enlightenment as a window manager and a default install is very minimal. I am coming to love enlightenment. I highly recommend it to anyone using a netbook or even a ‘real’ computer.
Also of interest is slitaz. Slitaz is awesome, more minimal than Bodhi and uses Openbox. I plan on also installing it on the netbook but for now I am preoccupied with things Bodhi.