Thread: shared_buffer=2*max_connections?

shared_buffer=2*max_connections?

From
"Thalis A. Kalfigopoulos"
Date:
I see in postgresql.conf what seems to be the suggested way to go:

#shared_buffers = 2*max_connections # min 16

This seems to imply that every connection is to take 16kb of shmem on average. From my understanding this depends on
thesize of the query->involved relations, the sort_mem size etc.etc. 

True/false?

TIA,
thalis


Re: shared_buffer=2*max_connections?

From
Tom Lane
Date:
"Thalis A. Kalfigopoulos" <thalis@cs.pitt.edu> writes:
> I see in postgresql.conf what seems to be the suggested way to go:
> #shared_buffers = 2*max_connections # min 16

That's a *minimum allowed* value intended to ensure that you won't see
"out of buffers" failures.  In practice, on any reasonably modern
machine I'd recommend a shared_buffers setting of at least a couple
thousand.  You might need to twiddle kernel parameters to let it go that
high, however.

            regards, tom lane

Re: shared_buffer=2*max_connections?

From
Bruce Momjian
Date:
> I see in postgresql.conf what seems to be the suggested way to go:
>
> #shared_buffers = 2*max_connections # min 16
>
> This seems to imply that every connection is to take 16kb of shmem on average. From my understanding this depends on
thesize of the query->involved relations, the sort_mem size etc.etc. 

It is assuming two 8k buffers per backend.  They are shared.  This is
just an estimate and probably doesn't accurately show how many you will
need for your query load.

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026