X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C869D52874 for ; Fri, 3 Jun 2005 03:12:07 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 46021-06 for ; Fri, 3 Jun 2005 06:11:58 +0000 (GMT) Received: from linda-5.paradise.net.nz (bm-5a.paradise.net.nz [202.0.58.24]) by svr1.postgresql.org (Postfix) with ESMTP id 9E5E55281D for ; Fri, 3 Jun 2005 03:11:57 -0300 (ADT) Received: from smtp-2.paradise.net.nz (smtp-2b.paradise.net.nz [202.0.32.211]) by linda-5.paradise.net.nz (Paradise.net.nz) with ESMTP id <0IHH00KLQVVWZQ@linda-5.paradise.net.nz> for pgsql-performance@postgresql.org; Fri, 03 Jun 2005 18:11:57 +1200 (NZST) Received: from [192.168.1.11] (218-101-13-183.paradise.net.nz [218.101.13.183]) by smtp-2.paradise.net.nz (Postfix) with ESMTP id A4B369E6A5; Fri, 03 Jun 2005 18:11:55 +1200 (NZST) Date: Fri, 03 Jun 2005 18:11:54 +1200 From: Mark Kirkwood Subject: Re: SHMMAX / SHMALL Was (Re: postgresql-8.0.1 performance In-reply-to: To: paul@paulmcgarry.com Cc: Cosimo Streppone , Martin Fandel , Postgresql Performance list Message-id: <429FF4AA.7090200@paradise.net.nz> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050511) References: <1117201312.7060.6.camel@fandelm.ecommit.de> <429D47FD.7090501@streppone.it> <429D56B2.9070302@paradise.net.nz> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.172 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/58 X-Sequence-Number: 12696 Paul McGarry wrote: > Based on the powerpostgresql.com Performance Checklist [1] and > Annotated Postgresql.conf [2] I understand that: > -I should have less than 1/3 of my total memory as shared_buffers > -For my server 15000 is a fairly reasonable starting point for > shared_buffers which is ~120MB > -I have 100 max_connections. > > So I was going to set SHMMAX to 134217728 (ie 128 Meg) > > What should SHMALL be? > > The current system values are > postgres@localhost:~/data$ cat /proc/sys/kernel/shmmax > 33554432 > postgres@localhost:~/data$ cat /proc/sys/kernel/shmall > 2097152 > > ie SHMALL seems to be 1/16 of SHMMAX > No - shmall is in 4k pages _ so this amounts to 8G! This is fine - unless you wish to decrease it in order to prevent too many shared memory applications running. BTW - the docs have been amended for 8.1 to suggest shmmax=134217728 and shmall=2097152 (was going to point you at them - but I cannot find them on the Postgresql site anymore...). There seems to be some longstanding confusion in the Linux community about the units for shmall (some incorrect documentation from Oracle on the issue does not help I am sure....) - to the point where I downloaded kernel source to check (reproducing here): linux-2.6.11.1/include/linux/shm.h:13-> #define SHMMAX 0x2000000 /* max shared seg size (bytes) */ #define SHMMIN 1 /* min shared seg size (bytes) */ #define SHMMNI 4096 /* max num of segs system wide */ #define SHMALL (SHMMAX/PAGE_SIZE*(SHMMNI/16)) /* max shm system wide (pages) */ #define SHMSEG SHMMNI Hope that helps Best wishes Mark