Re: Semaphores was: Increasing the number of semaphores on FreeBSD 4. 1 (clarification)

From: Alfred Perlstein <bright(at)wintelcom(dot)net>
To: Roger Wernersson <roger(dot)wernersson(at)mindark(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Semaphores was: Increasing the number of semaphores on FreeBSD 4. 1 (clarification)
Date: 2000-11-10 15:56:44
Message-ID: 20001110075643.E11449@fw.wintelcom.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> * Philip Hallstrom <philip(at)adhesivemedia(dot)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(dot)wernersson(at)mindark(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Peter Eisentraut 2000-11-10 16:08:19 Re: Increasing the number of semaphores on FreeBSD 4.1 (clarification)
Previous Message Tom Lane 2000-11-10 15:41:27 Re: Union & Nested queries