From: Scott Marlowe <scott.marlowe@gmail.com>
To: Jessica Richard <rjessil@yahoo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: how big shmmax is good for Postgres...
Date: Thu, 10 Jul 2008 05:23:12 -0600
Message-ID: <dcc563d10807100423m232f5d0aq44e736c98da1db6e@mail.gmail.com> (raw)
In-Reply-To: <639285.44246.qm@web56404.mail.re3.yahoo.com>
References: <639285.44246.qm@web56404.mail.re3.yahoo.com>
On Thu, Jul 10, 2008 at 4:53 AM, Jessica Richard <rjessil@yahoo.com> wrote:
> On a Linux system, if the total memory is 4G and the shmmax is set to 4G, I
> know it is bad, but how bad can it be? Just trying to understand the impact
> the "shmmax" parameter can have on Postgres and the entire system after
> Postgres comes up on this number.
There are two settings, shmmax for the OS, and shared_buffers for
pgsql. If the OS has a max setting of 4G but pgsql is set to use
512Meg then you'd be safe.
Now, assuming that both the OS and pgsql are set to 4G, and you're
approaching that level of usage, the OS will start swapping out to
make room for the shared memory. The machine will likely be starved
of memory, and will go into what's often called a swap storm where it
spends all its time swapping stuff in and out and doing little else.
> What is the reasonable setting for shmmax on a 4G total machine?
Keep in mind that postgresql's shared buffers are just one level of
caching / buffering that's going on. The OS caches file access, and
sometimes the RAID controller and / or hard drive.
Generally the nominal setting is 25% of memory, but that's variable.
If the working set of your data will fit in 10% then there's no need
for setting shared_memory to 25%...
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: scott.marlowe@gmail.com, rjessil@yahoo.com
Subject: Re: how big shmmax is good for Postgres...
In-Reply-To: <dcc563d10807100423m232f5d0aq44e736c98da1db6e@mail.gmail.com>
* 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