Re: Recommended Swap space

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Nik Tek <niktek2005(at)gmail(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Recommended Swap space
Date: 2013-04-12 21:15:49
Message-ID: CAOR=d=1tZHBnfDihnEqKD5ZR+HM-PzOf8Ramd6k2+rGoRUZ6Cw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-performance

My experience is that you're best off either with a swap space that matches
or exceeds physical memory, or none at all. The linux kernel swap daemon
(kswapd) gets confused and behaves badly with small swap spaces, especially
the more memory you have. Good news is that hard drives are cheap and 32G
isn't a lot of memory so I'd set it up for 32G + a tiny bit. Once a
machine gets to larger memory sizes (128G and more) I just turn off swap.

The really messed up bit is that the problems with the kswapd won't show up
for weeks, months, or sometimes even longer. The symptoms of a kswapd
problem is that swap is mostly full, but there's LOTS of free memory /
kernel cache, and the kswapd is busily swapping in / out. Page faults
skyrocket and the problem can last for a few minutes or a few hours, then
clear up and not occur again for a long time.

tl;dr: Either physical memory + a little or none.

On Fri, Apr 12, 2013 at 3:05 PM, Nik Tek <niktek2005(at)gmail(dot)com> wrote:

> Hi,
>
> What is the recommended swap space for postgres or 9.0.11 or 9.2.3 on
> linux(3.0.58-0.6)
> RAM on the hox is 32GB.
>
> Thank you
> Nik
>

--
To understand recursion, one must first understand recursion.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Claudio Freire 2013-04-12 21:21:44 Re: Recommended Swap space
Previous Message Nik Tek 2013-04-12 21:05:40 Recommended Swap space

Browse pgsql-performance by date

  From Date Subject
Next Message Claudio Freire 2013-04-12 21:21:44 Re: Recommended Swap space
Previous Message Nik Tek 2013-04-12 21:05:40 Recommended Swap space