SHMMAX / SHMALL Was (Re: postgresql-8.0.1 performance tuning)

From: Paul McGarry <paul(dot)mcgarry(at)gmail(dot)com>
To: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
Cc: Cosimo Streppone <cosimo(at)streppone(dot)it>, Martin Fandel <martin(dot)fandel(at)alphyra-evs(dot)de>, Postgresql Performance list <pgsql-performance(at)postgresql(dot)org>
Subject: SHMMAX / SHMALL Was (Re: postgresql-8.0.1 performance tuning)
Date: 2005-06-03 03:45:38
Message-ID: a056b1d405060220451b029a15@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On 6/1/05, Mark Kirkwood <markir(at)paradise(dot)net(dot)nz> wrote:
> Cosimo Streppone wrote:
> > ######### Config ############
> >> /etc/sysctl.conf:
> >> kernel.shmall = 786432000
> >> kernel.shmmax = 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 system
> > is 4kb. Google around:
> >
> This is somewhat confusing :
>
> 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(at)localhost:~/data$ cat /proc/sys/kernel/shmmax
33554432
postgres(at)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mark Kirkwood 2005-06-03 06:11:54 Re: SHMMAX / SHMALL Was (Re: postgresql-8.0.1 performance
Previous Message matthew 2005-06-03 03:38:18 Re: How to avoid database bloat