Re: Semaphores was: Increasing the number of semaphores on FreeBSD 4. 1 (clarification) - Mailing list pgsql-general

From Alfred Perlstein
Subject Re: Semaphores was: Increasing the number of semaphores on FreeBSD 4. 1 (clarification)
Date
Msg-id 20001110075643.E11449@fw.wintelcom.net
Whole thread Raw
In response to Semaphores was: Increasing the number of semaphores on FreeBSD 4. 1 (clarification)  (Roger Wernersson <roger.wernersson@mindark.com>)
List pgsql-general
> * Philip Hallstrom <philip@adhesivemedia.com> [001109 20:37] wrote:
> >
> > Yeah, that's what I've seen... I guess I was wondering if there were any
> > guidelines to raising them..  I mean should I up the defaults by 10?  Or
> > up them by a percentage (to keep the relationship), etc...
>
> here's what I use:
>
> options         SHMMAXPGS=512000
> options         SHMSEG=128
> options         SEMMNI=40       #       /* # of semaphore identifiers */
> options         SEMMNS=240      #       /* # of semaphores in system */
> options         SEMUME=40       #       /* max # of undo entries per process
> */
> options         SEMMNU=120      #       /* # of undo structures in system */
>
> I have a gig of RAM though.
>

* Roger Wernersson <roger.wernersson@mindark.com> [001110 03:00] wrote:
> Whoa! Shit! I'm working on a system which probably will use ALOT of
> semaphores and mutexes. Is this the limits, <1000? I was hoping for
> millions. I have asked around but no-one I have asked seems to know the
> answer.
>
> I'm using pthreads on Linux right now but will probably use HP-UX, AIX,
> True64 or Solaris when going live.
>
> How many semaphores and mutexes can one have, both in theory and
> practically?

Please don't drop me from the CC' list if you expect me to reply.

As far as system tunables, well, it depends on how much memory you
have available and what the OS is capable of.  I just didn't want
Phill to go nuts and try values that were 1000x some reasonable
figure.  In FreeBSD a lot of it is dynamically allocated so there
shouldn't have been a problem in configuring that many segments/semaphores.

The problem is when you actually use them and you run out of kernel
memory, this is _BAD_ and why there are limits in place on most
systems.

Oh, and I'd take a shot at use FreeBSD in production, we do, Yahoo
does and it kicks butt. :)

bye,
-Alfred


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Union & Nested queries
Next
From: Peter Eisentraut
Date:
Subject: Re: Increasing the number of semaphores on FreeBSD 4.1 (clarification)