Linux uses hard disk space called swap to write information it needs for accessing various temporary programs when system RAM is busy. Writing to hard drive is slower writing to RAM because the hard drive runs 100 times slower than RAM. Therefore, if your computer has much RAM (1G or more) why don't you tell your kernel about that because this helps your kernel using swap less and RAM more to speed up your system. Now, I will let you know how to reduce the tendency for the kernel to use the swap file.
Step 1: see what is the current value for setting
sudo cat /proc/sys/vm/swappiness
(It should give a number 60 here)
Step 2: change to a lower number
sudo sysctl -w vm.swappiness=5
Step 3: check again
sudo cat /proc/sys/vm/swappiness
(Now, it should give a number 5 here)
Step 4: append this line vm.swappiness=5 to file /etc/sysctl.conf

After reboot the new value (say 5) is kept as the default value. Enjoy it! You also read more to know how to disable IPv6 to speed up your Ubuntu Linux

Resources: Linux Journal

6 comments

  1. Bussan // 7/7/07, 2:17 AM  

    I cant get this to work. I am using 7.04 feisty fawn. for me to append the last line I need to log into root and when I go to the file to append I don't know exactly where to append to. I am new to Linux and need an easy explanation please. sadly my windows xp was running faster than gnome.

  2. Anonymous // 8/22/07, 10:02 PM  

    anyone know what determines the optimal value for a given system? Also, what problems will I see if I set this number is too low?

  3. Anonymous // 8/30/07, 6:31 AM  

    @Ore Sama

    Try;

    sudo gedit /etc/sysctl.conf

  4. mtinman // 11/27/08, 9:48 PM  

    Ore Sama: Windows does not require as much RAM as Linux, so "average" Windows PC's usually don't have enough RAM to run Linux "smoothly". I would suggest using at least 1 GB of RAM with any modern Linux distro, preferrably 2GB (or more). Remember, RAM reads & writes approximately a million times faster than your hard disk drive.

  5. Anonymous // 2/27/09, 2:00 PM  

    Modern Linux distribution in the last comment is a misnomer. Ubuntu/SuSe/Fedora use resource-heavy desktop environments and I wouldn't be surprised if the distro-specific internals are a waste of space comparative to what they accomplish. GNU/Linux is very light and speedy when compiled to work on almost any computer and not paired with a bloated desktop environment (ArchLinux with LXDE runs fine on my P2 400MHz 256MB system while XP is generally slower). It's even faster and lighter if you can compile the kernel to only include the parts your computer needs. At least 1GB for a general desktop is humorous for those who avoid the most bloated software.

  6. Anonymous // 4/17/09, 8:27 AM  

    mtinman... WHAT! Try running WinXP with 64MB of RAM. Modern Linux kernals just do preemptive swapping so with a 1GB or 2GB system you might see more of the RAM being used at times but Linux does NOT require more RAM than WinXP