Re: running two servers on one machine

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Eric Smith <eric_h_smith(at)mac(dot)com>
Cc: Adrian Klaver <aklaver(at)comcast(dot)net>, pgsql-general(at)postgresql(dot)org
Subject: Re: running two servers on one machine
Date: 2009-03-31 03:12:04
Message-ID: 29355.1238469124@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Eric Smith <eric_h_smith(at)mac(dot)com> writes:
> Following the queue on the postgres web page, I created /etc/
> sysctl.conf and added the following five entries:

> kern.sysv.shmmax=4194304
> kern.sysv.shmmin=1
> kern.sysv.shmmni=32
> kern.sysv.shmseg=8
> kern.sysv.shmall=1024

> But when I try to start two servers, I get the same error. Should I
> be bumping these numbers up?

Yes, substantially. That's 4MB of shmem per server (SHMMAX) and
also 4MB system-wide (SHMALL, which for some reason is measured in
4KB pages not bytes).

The *minimum* recommendation for decent performance is 32MB per server,
so you'd want shmmax = 32MB and shmall = at least 64MB, maybe more to
allow for some other apps trying to use some shmem.

It appeared from your log dumps that initdb has set up the parameters
to fit into 4MB of shmem, which is what it's supposed to do when faced
with draconian shmmax settings, but you really want to bump up
shared_buffers and perhaps max_connections once you get this fixed.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-03-31 03:26:10 Re: string_to_array with empty input
Previous Message Eric Smith 2009-03-31 02:58:37 Re: running two servers on one machine