From: Greg Smith <greg@2ndQuadrant.com>
To: pgsql-performance@postgresql.org
Subject: Re: The right SHMMAX and FILE_MAX
Date: Mon, 02 May 2011 11:18:52 -0400
Message-ID: <4DBECB5C.20104@2ndQuadrant.com> (raw)
In-Reply-To: <4DBE38BB.7040106@orkash.com>
References: <BANLkTinCr_+Hs_zzHPb+tBdtuLFhrsfKdg@mail.gmail.com>
<4DBE38BB.7040106@orkash.com>
On 05/02/2011 12:53 AM, Adarsh Sharma wrote:
> I am also in need of a proper documentation that explains how to set
> SHMAX and SHMALL variables in Postgres.
>
> What things need to be taken in consideration before doing that ?
> What is the value of SHMAX & SHMALL if u have 16 GB RAM for Postgres
> Server ?
Running the script I provided on a Linux server with 16GB of RAM:
$ cat /proc/meminfo | grep MemTotal
MemTotal: 16467464 kB
$ getconf PAGE_SIZE
4096
$ ./shmsetup
# Maximum shared segment size in bytes
kernel.shmmax = 8431341568
# Maximum number of shared memory segments in pages
kernel.shmall = 2058433
That sets SHMMAX to 50% of total RAM, which should be sufficient for any
reasonable installation of PostgreSQL. shmmall is a similar limit
expressed in system pages instead, so as seen here you have to divide by
the system page size of 4096 to figure it out.
--
Greg Smith 2ndQuadrant US greg@2ndQuadrant.com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books
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: greg@2ndQuadrant.com
Subject: Re: The right SHMMAX and FILE_MAX
In-Reply-To: <4DBECB5C.20104@2ndQuadrant.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