Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id D14A41337990 for ; Mon, 2 May 2011 08:01:51 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 91033-05 for ; Mon, 2 May 2011 11:01:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from smtp110.dfw.emailsrvr.com (smtp110.dfw.emailsrvr.com [67.192.241.110]) by mail.postgresql.org (Postfix) with ESMTP id 3227B13364DE for ; Mon, 2 May 2011 08:01:32 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp21.relay.dfw1a.emailsrvr.com (SMTP Server) with ESMTP id 0465A24063D; Mon, 2 May 2011 07:01:33 -0400 (EDT) X-Virus-Scanned: OK Received: by smtp21.relay.dfw1a.emailsrvr.com (Authenticated sender: adarsh.sharma-AT-orkash.com) with ESMTPSA id AB7E8240112; Mon, 2 May 2011 07:01:31 -0400 (EDT) Message-ID: <4DBE8F17.9060204@orkash.com> Date: Mon, 02 May 2011 16:31:43 +0530 From: Adarsh Sharma User-Agent: Thunderbird 2.0.0.22 (X11/20090625) MIME-Version: 1.0 To: Tomas Vondra CC: pgsql-performance@postgresql.org Subject: Re: The right SHMMAX and FILE_MAX References: <4DBE38BB.7040106@orkash.com> <4DBE8C6B.9070208@fuzzy.cz> In-Reply-To: <4DBE8C6B.9070208@fuzzy.cz> Content-Type: multipart/alternative; boundary="------------080905050803000208060906" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.899 tagged_above=-10 required=5 tests=BAYES_00=-1.9, HTML_MESSAGE=0.001 X-Spam-Level: X-Archive-Number: 201105/14 X-Sequence-Number: 43523 This is a multi-part message in MIME format. --------------080905050803000208060906 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Tomas Vondra wrote: > Dne 2.5.2011 06:53, Adarsh Sharma napsal(a): > >> 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 ? >> > > Well, those two values actually define kernel limits for shared memory > segments (i.e. memory shared by multiple processes, in this case the > postmaster proces and backends). So it's rather a question of tuning > shared_buffers (because that's the shared memory segment) and then > setting those two values. > When I was tuning Postgresql for best Performance, I set my shared_buffers= 4096 MB as I set 25% of RAM ( 1/4 ) So Do I need to set my SHMMAX =4096 MB. What is the SHMALL size now ? > SHMMAX - max. size of a single shared segment (in bytes) > SHMALL - total size of shared segments (in pages, page is usually 4kB) > > So if you decide you want 1GB shared buffers, you'll need at least this > > SHMMAX = 1024 * 1024 * 1024 (i.e. 1GB) > SHMALL = 1024 * 256 (1GB in 4kB pages) > > (althouth the SHMALL should be higher, as there will be other processes > that need shared memory). > > There's a lot of docs about this, e.g. this one (it's mostly for Oracle, > but it describes the shared memory quite nicely): > > http://www.puschitz.com/TuningLinuxForOracle.shtml#SettingSharedMemory > > regards > Tomas > > --------------080905050803000208060906 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Tomas Vondra wrote:
Dne 2.5.2011 06:53, Adarsh Sharma napsal(a):
  
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 ?
    

Well, those two values actually define kernel limits for shared memory
segments (i.e. memory shared by multiple processes, in this case the
postmaster proces and backends). So it's rather a question of tuning
shared_buffers (because that's the shared memory segment) and then
setting those two values.
  

When I was tuning Postgresql for best Performance, I set my shared_buffers= 4096 MB as I set 25% of RAM ( 1/4 )

So Do I need to set my SHMMAX =4096 MB.

What is the SHMALL size now ?

SHMMAX - max. size of a single shared segment (in bytes)
SHMALL - total size of shared segments (in pages, page is usually 4kB)

So if you decide you want 1GB shared buffers, you'll need at least this

SHMMAX = 1024 * 1024 * 1024 (i.e. 1GB)
SHMALL = 1024 * 256 (1GB in 4kB pages)

(althouth the SHMALL should be higher, as there will be other processes
that need shared memory).

There's a lot of docs about this, e.g. this one (it's mostly for Oracle,
but it describes the shared memory quite nicely):

http://www.puschitz.com/TuningLinuxForOracle.shtml#SettingSharedMemory

regards
Tomas

  

--------------080905050803000208060906--