Re: the number of file descriptors when using POSIX semaphore

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: flyusa2010 fly <flyusa2010(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: the number of file descriptors when using POSIX semaphore
Date: 2010-12-28 20:18:43
Message-ID: 9111.1293567523@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruce Momjian <bruce(at)momjian(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gurjeet Singh 2010-12-28 20:44:54 Re: pg_dump --split patch
Previous Message Peter Eisentraut 2010-12-28 20:07:14 Re: "writable CTEs"