pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: sobomax@freebsd.org
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #14206: Switch to using POSIX semaphores on FreeBSD
Date: Tue, 21 Jun 2016 15:59:25 -0400
Message-ID: <16860.1466539165@sss.pgh.pa.us> (raw)
In-Reply-To: <20160621193412.5792.65085@wrigleys.postgresql.org>
References: <20160621193412.5792.65085@wrigleys.postgresql.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

sobomax@freebsd.org writes:
> However, according to the analysis done by Konstantin Belousov here
> https://www.kib.kiev.ua/kib/pgsql_perf_v2.0.pdf there is at the very least
> some performance benefit on using POSIX semaphones instead of SYSV
> semaphones in the PG running on FreeBSD host.

I wonder how thorough that performance testing was.  The reason that the
named-POSIX-semaphore code exists is that it used to be the only kind of
semaphore available on ancient OS X versions.  But we got rid of that as
soon as we could, for the reason explained in 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.

The extra FDs slow down launching of new backends (due to having to dup
all the postmaster's FDs for the semaphores) and if max_connections is
large they can take a pretty serious chunk out of your system-wide file
table, at worst max_connections squared.

Now maybe FreeBSD is different enough from OSX that these are not problems
for you, but I'm dubious.

Have you got unnamed POSIX semaphores, and if so have you tried that
variant?

			regards, tom lane


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (14+ messages)  latest in thread

Message-ID: <16860.1466539165@sss.pgh.pa.us>
Permalink:  ../16860.1466539165@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/16860.1466539165@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sobomax@freebsd.org
  Subject: Re: BUG #14206: Switch to using POSIX semaphores on FreeBSD
  In-Reply-To: <16860.1466539165@sss.pgh.pa.us>
  References: <20160621193412.5792.65085@wrigleys.postgresql.org> <16860.1466539165@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox