r3dux.org

A number-pimping side project from the valleys in *NEW* upside-down flavour.

  • Home
  • ABOUT
  • OLD SITE
  • SEARCH
  • FEEDBACK

How To: Speed Up Linux by Minimising Swapiness

r3dux | June 10, 2010

Swappiness is a setting in the Linux kernel which controls how amenable to paging things in memory out to disk the kernel is (like using virtual memory in Windows), and in Ubuntu it comes with a default value of 60 – which for a box with lots of memory is too high in my humble opinion. The range of values goes from 0 (never use the swap file unless absolutely critical) to 100 (page stuff out to file whenever it feels like).

You can easily check your current swappiness value like this:

cat /proc/sys/vm/swappiness

And you can change the swappiness of the system on the fly (but it’ll go back to the value in the sysctl.conf file after a reboot) like this:

sudo sysctl vm.swappiness=10

My laptop has 4GB of RAM, and even with a bunch free, Linux decides to swap stuff out to file quite often with a swappiness setting of 60, which can slow the box to a crawl. To fix this, and permanently insist that all physical RAM is used up before starting any paging at all,, simply change the setting to something like 10 like this:

gksudo gedit /etc/sysctl.conf

Then, when the file is open, either add the line vm.swappiness=10 to the bottom of the file, or if it already exists just modify the value, then reboot.

To find out more about the whole swappiness thing, try this article.

Related posts:

  1. How To: Super Easily Speed Up Compiz / CompizFusion
  2. How To: Make VirtualBox Use Your Router’s DHCP to get an IP Address in Linux
  3. ActionScript 3.0 Draw Speed Test: Drawing Primitives Vs. Placing MovieClips
  4. How To: Fix CUPS PDF Printing in Linux
  5. How To: Set up a FTP Server in Linux
Categories
How-To, Linux
Tags
Memory, Paging, RAM, Swap, Swappiness, Virtual
Comments rss
Comments rss
Trackback
Trackback
Print This Post Print This Post

« Think Outside the Box Bettie Serveert – White Dogs »

One Response to “How To: Speed Up Linux by Minimising Swapiness”

  1. Web Hosting says:
    December 7, 2011 at 7:04 am

    Going to try this out on my Ubuntu Server and hope that hosting Apache websites now will first use all the the RAM…

    Reply

Leave a Reply

Click here to cancel reply.

Translate

Categories

Archives

Tags

3D ActionScript ActionScript 3.0 Adobe AI Ballarat Bash C++ Class Convert CS4 Effect Error Film Flash GLSL Gnome Hack How-To install Jaunty Java Kinect Linkage Linux Mash-Up Microsoft Motion OpenGL Particle Problem PS3 Remix Retro script Slides Sound Systems Texture Ubuntu Video VirtualBox Wii Windows XBox

Gamercard

OpenR3dux

Misc.

Flattr this

RSS Feed

r3dux twitter feed



“Blatantly in distress.”

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox