Pin Me

Top Tips to Optimizing Linux - Getting a Faster, Lighter platform

written by: nancydehra•edited by: Lamar Stonecypher•updated: 11/26/2009

Ever thought of how long the boot-up of your Linux system takes? Wouldn’t it be nice if it responded faster at all times? Though, it is faster than Windows PCs, yet we can still optimize and maximize its potential.

  • slide 1 of 10

    Here are four tips that can help you get the best out of your system!

  • slide 2 of 10

    Eliminate Wait Time at Boot-up

    The Linux system is configured to wait for a certain number of seconds ranging from 3 to 30 seconds during boot-up process to enable users to select an operating system. However, if you use only Linux operating system, then you bypass the timeout countdown before Linux boots up saving precious seconds. Follow these steps assuming current timeout countdown is 10 seconds.

  • slide 3 of 10
    • Opening /boot/grub/menu.lst (or /boot/grub/grub.conf) in a text editor with root permissions
    • Locate the line “timeout=10
    • Modify line “timeout=10” to “timeout=0
    • Save and exit text editor
    • Reboot

    Presto, you Linux boots a little faster than before.

  • slide 4 of 10

    Get the Best out of your Hard Disk

    If you have a DMA [Direct Memory Access] compatible Disk, you can increase data throughput manifold with a small tweak. Increase of data throughput automatically translates into faster boot times improving startup times and overall performance since read times will be of shorter duration whenever your hard disk is accessed. Follow these steps:-

  • slide 5 of 10
    • Install hdparm through package manager
    • Fireup a root terminal
    • Type hdparm –d1 /dev/had1 and replace /dev/had1 with the path of your boot partition
    • Gnome users: Head to System > Administration > Services. Use gksudo to add the line as an entry at the start enabling it to run with root permissions and no additional authentication. It will run automatically at each startup.
  • slide 6 of 10

    Try Parallel Thinking

    By default, processes run sequentially. However, parallelism runs multiple processes simultaneously taking lesser time. Users can take advantage of this in Grub.

    • Fire up /etc/init.d/rc in a text editor with root permissions
    • Locate the line that says CONCURRENCY=none
    • Replace “none” with “shell
    • Save and exit text editor
    • Reboot
  • slide 7 of 10

    If all goes well, you should notice decrease in boot times [a few seconds]. If you are using solo processor [and not multi-core processors], then it may not work. Instead, there may be an increase in boot time.

  • slide 8 of 10

    Milk the Memory

    The Linux kernel usually uses swap space or swap partition where it caches data to virtual memory. This is swapped into RAM as and when required. In fact, a similar process is applied to store machine state when system is in hibernation.

  • slide 9 of 10

    However, if your system has lots of memory, then you can take advantage by reducing “swappiness” giving your system a performance boost. Simply put, your kernel caches data in memory more than it does in swap space for quicker access.

    • Open /etc/sysctl.conf in a text editor with root permissions
    • Append the line “vm.swappiness=10” to bottom of file
    • Save and exit text editor
    • Restart session for changes to take effect

  • slide 10 of 10

    The value can be tweaked based on performance in real-time. By lowering value, you use more RAM and less swap space. Some experimentation may be required to get the right values.

    As all of us know, Linux is incredibly customizable. The common thread of the four tweaks discussed here is that they speed up your Linux system whether it is decreasing boot time, taking advantage of DMA compatible hard drive, running processes in parallel or optimizing memory through “swappiness”. However, if you are new user, please tread with caution.