Re: the number of file descriptors when using POSIX semaphore - Mailing list pgsql-hackers

From Tom Lane
Subject Re: the number of file descriptors when using POSIX semaphore
Date
Msg-id 9111.1293567523@sss.pgh.pa.us
Whole thread Raw
In response to Re: the number of file descriptors when using POSIX semaphore  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> flyusa2010 fly wrote:
>> in src/template/darwin:
>> 
>> # Select appropriate semaphore support. Darwin 6.0 (Mac OS X 10.2) and up
>> # support System V semaphores; before that we have to use POSIX semaphores,
>> # which are less good for our purposes because they eat a file descriptor
>> # per backend per max_connection slot.

>> So, what would the number of file descriptors be, when using POSIX
>> semaphore?

> I thought the text was wrong, but this commit reinforces that text:

The text is correct, or at least as correct as it's possible to get
without expending three times the verbiage.  If you look in
InitProcGlobal you will find that the postmaster creates MaxConnections
plus autovacuum_max_workers + 1 plus NUM_AUXILIARY_PROCS semaphores.
In a POSIX-semaphores implementation, each of these eats a file
descriptor in the postmaster, plus another file descriptor in each child
process of the postmaster.

The OP claims the text is wrong, but since he failed to state what he
observed, it's pretty hard to comment further.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: "writable CTEs"
Next
From: Gurjeet Singh
Date:
Subject: Re: pg_dump --split patch