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 1D86B528BB for ; Fri, 3 Jun 2005 00:46:28 -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 11324-08 for ; Fri, 3 Jun 2005 03:45:44 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.207]) by svr1.postgresql.org (Postfix) with ESMTP id 8D5F152802 for ; Fri, 3 Jun 2005 00:45:43 -0300 (ADT) Received: by wproxy.gmail.com with SMTP id 68so663611wra for ; Thu, 02 Jun 2005 20:45:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hqYdIPCd1Vefe4fx559zZutIL05EuPajyuIR7dcGTn+sQ3oaXbZa5y2STt5WXJtJFH5YSV8il+/d146boIDed0/Hs1mUSUW52TZPJ42n6keaDnWkLkwNDk2w0vCvGjespDO88doESq6CFOYaYKS0ayrodub/JbIaE0ECaBHMldQ= Received: by 10.54.150.2 with SMTP id x2mr962802wrd; Thu, 02 Jun 2005 20:45:38 -0700 (PDT) Received: by 10.54.91.14 with HTTP; Thu, 2 Jun 2005 20:45:37 -0700 (PDT) Message-ID: Date: Fri, 3 Jun 2005 13:45:38 +1000 From: Paul McGarry Reply-To: paul@paulmcgarry.com To: Mark Kirkwood Subject: SHMMAX / SHMALL Was (Re: postgresql-8.0.1 performance tuning) Cc: Cosimo Streppone , Martin Fandel , Postgresql Performance list In-Reply-To: <429D56B2.9070302@paradise.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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-Archive-Number: 200506/57 X-Sequence-Number: 12695 On 6/1/05, Mark Kirkwood wrote: > Cosimo Streppone wrote: > > ######### Config ############ > >> /etc/sysctl.conf: > >> kernel.shmall =3D 786432000 > >> kernel.shmmax =3D 786432000 > > > > I think you have a problem here. > > kernel.shmmax should *not* be set to an amount of RAM, but > > to maximum number of shared memory pages, which on a typical linux syst= em > > is 4kb. Google around: > > > This is somewhat confusing : >=20 > kernel.shmmax is in bytes (max single segment size) > kernel.shmall is in (4k) pages (max system wide allocated segment pages) Can someone resummarize the situation with these linux parameters for the dummies? I thought I had my calculations all sorted out but now I've confused myself again. The documentation at http://www.postgresql.org/docs/8.0/interactive/kernel-resources.html puts the same figure into both values but the posts here seem to suggest that is wrong? Or is it different on a 2.4 kernel and the documentation needs updating? In my specific case I have about 800meg of memory on a linux 2.4 kernel box= . 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 Paul [1] http://www.powerpostgresql.com/PerfList/ [2] http://www.powerpostgresql.com/Downloads/annotated_conf_80.html