Re: The right SHMMAX and FILE_MAX

From: Greg Smith <greg(at)2ndQuadrant(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: The right SHMMAX and FILE_MAX
Date: 2011-05-02 15:18:52
Message-ID: 4DBECB5C.20104@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

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(at)2ndQuadrant(dot)com Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2011-05-02 16:04:56 Re: 8.4.7, incorrect estimate
Previous Message Tom Lane 2011-05-02 15:11:58 Re: 8.4.7, incorrect estimate