On Tue, Nov 11, 2008 at 02:17:20PM -0300, Alvaro Herrera wrote:
> Thom Brown escribió:
> > I've noticed that if I set my SHMMAX to 256 * 1024 * 1024 (268435456)
> > and my shared_buffers value in postgresql.conf to 256MB the server
> > fails to start. I managed to find a tipping point: 249MB seems to be
> > too much and 248MB seems to be okay.
> >
> > Could someone explain what I'm missing here? I thought the
> > shared_buffers could be anything up to SHMMAX?
>
> shared_buffers is not the only factor to shared memory, so you need to
> provide some extra SHMMAX slop.
what is this "extra slop" needed for? I'd always ignored it before and
just made SHMMAX a bit bigger until PG stopped complaining and started.
But computers are supposed to be deterministic; what's taking up the
extra space? I expect this knowledge to be most useful to people like
Greg Smith who's making a config auto-tuner, it would be bad if it said
to set SHMMAX to xMB and it really needs to be set to (x+12)MB.
I've just found a table[1] in the docs that attempts to explain what's
going on, but I get 10.5MB of extra shared memory being used (default
config values, expect for shared_buffers going up to 256MB).
Sam
[1] http://www.postgresql.org/docs/current/static/kernel-resources.html#SHARED-MEMORY-PARAMETERS