From: Kevin <kev@drule.org>
To: Tobias Brox <tobias@nordicbet.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Swappiness setting on a linux pg server
Date: Thu, 19 Oct 2006 14:39:01 -0600 (MDT)
Message-ID: <49298.209.244.4.106.1161290341.squirrel@www.drule.org> (raw)
In-Reply-To: <20061019135428.GD20328@oppetid.no>
References: <20061019135428.GD20328@oppetid.no>
> I just came to think about /proc/sys/swappiness ...
>
> When this one is set to a high number (say, 100 - which is maximum), the
> kernel will aggressively swap out all memory that is not beeing
> accessed, to allow more memory for caches. For a postgres server, OS
> caches are good, because postgres relies on the OS to cache indices,
> etc. At the other hand, for any production server it's very bad to
> experience bursts of iowait when/if the swapped out memory becomes
> needed - particularly if the server is used for interactive queries,
> like serving a web application.
This is very useful on smaller systems where memory is a scarce commodity.
I have a Xen virtual server with 128MB ram. I noticed a big improvement
in query performance when I upped swappiness to 80. It gave just enough
more memory to fs buffers so my common queries ran in memory.
Yes, throwing more ram at it is usually the better solution, but it's nice
linux gives you that knob to turn when adding ram isn't an option, at
least for me.
--
Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: kev@drule.org, tobias@nordicbet.com
Subject: Re: Swappiness setting on a linux pg server
In-Reply-To: <49298.209.244.4.106.1161290341.squirrel@www.drule.org>
References: <20061019135428.GD20328@oppetid.no> <49298.209.244.4.106.1161290341.squirrel@www.drule.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox