Increasing the number of semaphores on FreeBSD 4.1 (clarification) - Mailing list pgsql-general

From Philip Hallstrom
Subject Increasing the number of semaphores on FreeBSD 4.1 (clarification)
Date
Msg-id Pine.BSF.4.21.0011091855160.64891-100000@oddjob.adhesivemedia.com
Whole thread Raw
Responses Re: Increasing the number of semaphores on FreeBSD 4.1 (clarification)  (Alfred Perlstein <bright@wintelcom.net>)
Re: Increasing the number of semaphores on FreeBSD 4.1 (clarification)  (Peter Eisentraut <peter_e@gmx.net>)
List pgsql-general
Hi -
    I recently tried to start postmaster (7.0.2) with -B 128 -N 64 and
got the "semget failed" error.  Looking in the faq[1] it says I need to
increase the amount allowed in the kernel.  It tells me what I need to do,
but my question is what values should I set them to?  Is there any way to
figure it out based on load, etc?  Also, are there detrimental effects to
setting them too high?

From the faq:

---------------------------------------------------------------------
3)  How to increasing the number of semaphores.

You may need to increase the number of sysv semaphores. By default,
PostgreSQL allocates 32 semaphores, one for each backend connection.
This is just over half the default system total of 60.

The defaults are in /sys/sys/sem.h:

/* Configuration parameters */
#ifndef SEMMNI
#define SEMMNI  10              /* # of semaphore identifiers */
#endif
#ifndef SEMMNS
#define SEMMNS  60              /* # of semaphores in system */
#endif
#ifndef SEMUME
#define SEMUME  10              /* max # of undo entries per process */
#endif
#ifndef SEMMNU
#define SEMMNU  30              /* # of undo structures in system */
#endif

Set the values you want in your kernel config file, e.g.:

options "SEMMNI=40"
options "SEMMNS=240"
options "SEMUME=40"
options "SEMMNU=120"
---------------------------------------------------------------------

Any insight appreciated.  Thanks!

[1]http://postgresql.readysetnet.com/docs/faq-bsdi


pgsql-general by date:

Previous
From: Alfred Perlstein
Date:
Subject: Re: Re: Maybe a strange question, but: "How long may a cursor live?"
Next
From: Alfred Perlstein
Date:
Subject: Re: Increasing the number of semaphores on FreeBSD 4.1 (clarification)