Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Nov 2006 14:16:53 -0500
From:      Vivek Khera <vivek@khera.org>
To:        Nguyen Tam Chinh <chinhngt@sectorb.msk.ru>
Cc:        stable@freebsd.org
Subject:   Re: Running large DB's on FreeBSD
Message-ID:  <92D6756F-12EA-43CF-95C3-33CB8A25FDC0@khera.org>
In-Reply-To: <20061111022925.Q953@it.hackers>
References:  <453D49D2.1010705@rogers.com> <6DBE5906-CD84-44C5-AF40-FFCC78C7561E@khera.org> <20061024202408.U923@it.hackers> <6611C68B-1492-48A7-9425-3E23271CC940@khera.org> <20061111022925.Q953@it.hackers>

next in thread | previous in thread | raw e-mail | index | archive | help

--Apple-Mail-9-454619936
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=US-ASCII;
	delsp=yes;
	format=flowed


On Nov 10, 2006, at 6:35 PM, Nguyen Tam Chinh wrote:

>> For the pg configuration,  I use this on a 4Gb box:
>>
>> max_connections = 100
>> shared_buffers = 70000                  # min 16 or  
>> max_connections*2, 8KB each
>> work_mem = 262144                       # min 64, size in KB
>
> Thank you very much. And how did you set the semaphore's  
> parameters? Do you have any trick or experience? I just think it's  
> just weird to inceremently increase ipc.shm* and ipc.sem* to get  
> the right values. The documentation of PostGreSQL gives us some  
> examples but without explanation how they found those values.

The SEM parameters are the bare minimum.  Pg uses a small number of  
semaphores, so unless you have a bazillion connections allowed, just  
use these settings:

kern.ipc.semmsl=512
kern.ipc.semmap=256

kern.ipc.semmni=32
kern.ipc.semmns=512


Now, for the SHM usage, it is just arithmetic.  You now how many  
buffers you're asking for, you know how big they are, and you just  
need to add some for overhead and you've got  your number.  If you  
want Pg to compute it for you, just read the error log when you fire  
up Pg with a small shm setting in the OS.


--Apple-Mail-9-454619936--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?92D6756F-12EA-43CF-95C3-33CB8A25FDC0>