Re: PostgreSQL's share_buffer calculation using shmget() versus kernel.shmmax

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Mel Llaguno <mllaguno(at)coverity(dot)com>
Cc: Pavan Deolasee <pavan(dot)deolasee(at)gmail(dot)com>, "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: PostgreSQL's share_buffer calculation using shmget() versus kernel.shmmax
Date: 2013-02-07 05:49:29
Message-ID: 27677.1360216169@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Mel Llaguno <mllaguno(at)coverity(dot)com> writes:
> Thanks for your reply. I agree with your statement that you should set the configuration parameters first, but I would like to be able to calculate the SHMMAX value based on those parameters. This is particularly useful when suggesting postgresql.conf optimizations to our customers whose machine have a lot of RAM (64+GB). Having to guess this value is far from ideal; what I'd like is the formula used by postgresql that generates the shmget() value displayed in the pgctl.log.

There's some rather old information in Table 17-2 here:
http://www.postgresql.org/docs/9.2/static/kernel-resources.html#SYSVIPC

As Pavan says, the shared_buffers term is usually the only one worth
worrying about. The traditional advice is to not set that to more than
about a quarter of your physical RAM, which would mean that this script
you're using to set SHMMAX is leaving lots of headroom, which is
perfectly OK. (AFAIK there is no penalty to setting SHMMAX larger than
you need.)

There's more info worth looking at here:
https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server

regards, tom lane

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Mel Llaguno 2013-02-07 05:58:00 Re: PostgreSQL's share_buffer calculation using shmget() versus kernel.shmmax
Previous Message Mel Llaguno 2013-02-07 05:43:33 Re: PostgreSQL's share_buffer calculation using shmget() versus kernel.shmmax