Re: Need suggestions on kernel settings for dedicated FreeBSD/Postgresql machine

From: Ivan Voras <ivoras(at)freebsd(dot)org>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Need suggestions on kernel settings for dedicated FreeBSD/Postgresql machine
Date: 2009-08-18 14:12:17
Message-ID: h6ecs1$qls$1@ger.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Culley Harrelson wrote:
> I will definitely look into this. I suspect I need to tune my kernel
> settings first though...

No, not much. Sysctl and loader.conf settings are enough.

>>> $ cat /etc/sysctl.conf
>>>
>>> kern.ipc.shmmax=268435456
>>> kern.ipc.shmall=65536

shmmax is in bytes, so this is 256 MB - way too low.
shmall is in pages, so this is 256 MB also - which is in sync with the
above but will fall apart if some other service needs shm memory.

Set shmall to 2 GB and shmmax to 1.9 GB.

>>> $ cat /boot/loader.conf
>>> kern.ipc.semmni="256"
>>> kern.ipc.semmns="512"
>>> kern.ipc.semmnu="256"

I think these are way too low also. I use 10240 and 16384 for semmni and
semmns habitually but these might be overtuned :)

>>> In postgresql.conf I have:
>>>
>>> max_connections = 180
>>> shared_buffers = 28MB

Definitely too low and out of sync with the above settings.

Set shared_buffers to around 1800 MB or 1900 MB.

These settings are a good start, but you can find many tutorials and
documents on tuning pgsql if you search around.

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Lane 2009-08-18 15:05:23 Re: Weird index or sort behaviour
Previous Message Matthew Wakeling 2009-08-18 13:20:21 Weird index or sort behaviour