Re: Suggested swap size for new db?

From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: "Evan D(dot) Hoffman" <evandhoffman(at)gmail(dot)com>
Cc: Postgresql Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Suggested swap size for new db?
Date: 2010-11-15 06:47:17
Message-ID: AANLkTi=+EQ0XKmby5RcVrPCEkJZr4o0dO+haA9qSB6YD@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Nov 14, 2010 at 8:34 PM, Evan D. Hoffman <evandhoffman(at)gmail(dot)com> wrote:
> I'm planning to migrate our pg db to a new machine in the next couple
> of weeks.  The current DB has 32 GB memory; the new one will have 96
> GB.  It's going to be Postgres 8.2.x (we're planning to upgrade to 8.4
> as part of another project) running on CentOS 5.4 or 5.5.  I know the
> old rule of thumb that your swap partition/disk should be equal to the
> physical memory, but when dealing with memory sizes greater than ~16
> GB that starts to seem strange to me; and now with 96 GB of physical
> memory I'm starting to wonder if I'd be better off forgoing swap
> altogether for the new database.

My servers were setup with something like 16G of swap on a machine
with 128G ram. After runnig for about a month of heavy work, kswapd
decided to start thrashing the system for no apparent reason, and
would not stop. The fix was sudo swapoff -a. As soon as kswapd had
swapped everything back in the server returned to normal. Now,
swapoff -a is the last line in my /etc/rc.local on both machines.
Running Ubuntu 10.04 64 bit btw. Note that at the time of this
happening I had 90+G of kernel cache, and nothing NEEDED to be swapped
out. the linux kernel, and virtual memory, with a machine with lots
of memory, has some rather odd behaviour, and I don't really need swap
on these machines.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2010-11-15 07:17:47 Re: Basic Tutorials for 9.0
Previous Message Evan D. Hoffman 2010-11-15 03:34:01 Suggested swap size for new db?