Re: [ADMIN] Increasing the shared memory - Mailing list pgsql-general

From Bill Moran
Subject Re: [ADMIN] Increasing the shared memory
Date
Msg-id 20070402113222.9415258c.wmoran@potentialtech.com
Whole thread Raw
In response to Re: [ADMIN] Increasing the shared memory  ("Sorin N. Ciolofan" <ciolofan@ics.forth.gr>)
Responses Re: [ADMIN] Increasing the shared memory  (David Brain <dbrain@bandwidth.com>)
List pgsql-general
In response to "Sorin N. Ciolofan" <ciolofan@ics.forth.gr>:
>
>             I've a value of 1000 set for shared_buffers, does this means
> that I use 8kbX1000=8Mb of Shared Mem?
>
>
>
> The definition from the manual is quite confusing:
>
>
>
> shared_buffers (integer)
>
> Sets the amount of memory the database server uses for shared memory
> buffers. The default is typically 32 megabytes (32MB), but may be less if
> your kernel settings will not support it (as determined during initdb). This
> setting must be at least 128 kilobytes and at least 16 kilobytes times
> max_connections
> <http://www.postgresql.org/docs/current/static/runtime-config-connection.htm
> l#GUC-MAX-CONNECTIONS> .
>
>
>
> What does the integer number represent? Number of shared buffers? If yes,
> what size does each shared buffer have?
>
> "The default is typically 32 megabytes" suggests that this integer could
> also represent the number of megabytes?!?
>
> In the postgresql.conf file is an ambiguous comment that could induce the
> idea that each shared buffer has 8 kb.
>
> So, which is the meaning of this integer?

Older versions of PostgreSQL, the number was the _number_ of shared buffers.
Each buffer is typically 8K, but this can be altered at compile time (I
believe) and the PGDG has no way to know for sure if whatever packaged version
you installed might have done so.

However, on more recent versions of Postgres (although I don't know exactly
what version first included this) you can specify this value as "M" or "G"
to specify a number of megabytes or gigabytes.  Internally, this is still
converted to a number of 8K buffers, but it makes the config file easier to
read and understand.

--
Bill Moran
http://www.potentialtech.com

pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: COPY command details
Next
From: "Bryan Murphy"
Date:
Subject: Re: Deleted Flag/Unique Constraint