Re: [HACKERS] Reducing sema usage (was Postmaster dies with many child processes) - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: [HACKERS] Reducing sema usage (was Postmaster dies with many child processes)
Date
Msg-id 199901310142.UAA01549@candle.pha.pa.us
Whole thread Raw
In response to Reducing sema usage (was Postmaster dies with many child processes)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> A considerably more straightforward approach is just to forget about
> incremental allocation of semaphores and grab all we could need at
> postmaster startup.  ("OK, Mac, you told me to allow up to N backends?
> Fine, I'm going to grab N semaphores at startup, and if I can't get them
> I won't play.")  This would force the DB admin to either reconfigure the
> kernel or reduce MaxBackendId to something the kernel can support right
> off the bat, rather than allowing the problem to lurk undetected until
> too many clients are started simultaneously.  (Note there are still
> potential gotchas with running out of processes, swap space, or file
> table slots, so we wouldn't have really guaranteed that N backends can
> be started safely.)
> 
> If we make MaxBackendId settable from a postmaster command-line switch
> then this second approach is probably not too inconvenient, though it
> surely isn't pretty.
> 
> Any thoughts about which way to jump?  I'm sort of inclined to take
> the simpler approach myself...

Semaphore are hard enough without overloading them.  I say just gram
them on startup.  They are cheap.  Many databases use semaphores for
every row/page they lock, and boy that can be a lot of semaphores.  We
are only getting a few.

--  Bruce Momjian                        |  http://www.op.net/~candle maillist@candle.pha.pa.us            |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Re: Reducing sema usage (was Postmaster dies with many child processes)
Next
From: Charles Hornberger
Date:
Subject: Re: [HACKERS] nested loops in joins, ambiguous rewrite rules