Optimise memory
Another easy way to give a performance boost to your
system
is to modify how swap space is used, or more precisely how the kernel
favors swap over RAM.
vm.swappiness is a kernel parameter that
controls how much the kernel favors swap over RAM. In other words, it
is a parameter which sets the kernel's
balance between reclaiming pages from the page cache and swapping out
process memory. It is also defined as the tendency to steal mapped
memory.
This variable kernel setting takes a value between 0 and
100. At 100, the kernel always prefers to find
inactive pages and swap them
out. With a value of 0, the system behaves so that applications
that need memory can shrink the cache to a tiny fraction of RAM. Under
Ubuntu the default setting for vm.swappiness is 60. To check this for
yourself, type the command below into a console:
sysctl vm.swappiness
To modify this setting, simply open /etc/sysctl.conf
with an editor and add the following line to
the bottom of the file. You need root permissions to do this.
vm.swappiness=20
The lower the value of vm.swappiness the less the system will use swap
space and the more data is cached to memory. We found 20 to
be a good value for systems which have plenty of RAM (at least 1GB). If
you don't have enough RAM, setting vm.swappiness too low will have an
adverse impact on system performance.
Improve hard disk performance
If your system has a DMA-compatible (Direct Memory
Access) hard disk you can improve performance with a couple of tweaks.
Not only will these help the system boot more quickly but the tweaks
also have the added benefit of improving the general
speed of your system too.
You may know that the hdparm tool can be used to speed
test your disk and change a few settings. It can also be used to
optimise drive
performance, and turn on some features that may not be enabled by
default. However, we would advise to back up important data before
experimenting with hdparm, as it can crash a computer and destroy data
if a few parameters are misused.
To measure your hard disk data transfer speed and tweak
the settings you need to install the hdparm utility using the Synaptic
Package manager. Once installed, enter the following command:
sudo hdparm -tT /dev/hda
For a SATA hard disk you would type:
sudo hdparm -tT /dev/sda
These commands show the data transfer speed. Best to run
them a few
times to get an accurate idea of the speed.
Here is some typical output:
/dev/hda:
Timing cached reads: 1932 MB in 2.00 seconds = 966.63 MB/sec
Timing buffered disk reads: 118 MB in 3.02 seconds = 39.06 MB/sec
To improve performance by turning on DMA, start up a
terminal and type:
sudo hdparm -d1 /dev/hda1
(replace hda1 with the location of the boot partition;
look at the output of the command df if you are unsure)
This command will need to be entered each time the
system is started up, or you can modify your system so that this
command is entered every time the machine boots up.
Currently all SATA hard drives
automatically have DMA turned on, so there is no need to enable the -d1
flag. However, performance can still be improved by enabling
read-ahead and write-caching.
Another way of improving hard disk performace is to turn
off Automatic Acoustic Management (AAM). AAM is a method for reducing
acoustic emanations. Since acoustic emanations are a byproduct
of rotational speed, AAM provides a way to quiet a drive by limiting
its rotational speed and power consumption—in effect, sacrificing
performance for quieter operation. But if you are not
concerned about noise, turning AAM off will slightly improve hard disk
performance.
sudo hdparm -M254 /dev/hda1
(replace hda1 with the relevant partition on your system)
Jump ahead:
1. Ubuntu
Tips - Booting - Page 1 (previous page)
2. Ubuntu
Tips - Booting - Page 2 (current page)
3. Ubuntu
Tips - Booting - Page 3 (next page)
4. Ubuntu
Tips - Booting - Page 4
|