From: Tom Lane <tgl@sss.pgh.pa.us>
To: Robert Haas <robertmhaas@gmail.com>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: Switch to unnamed POSIX semaphores as our preferred sema code?
Date: Sat, 08 Oct 2016 16:52:08 -0400
Message-ID: <29244.1475959928@sss.pgh.pa.us> (raw)
In-Reply-To: <CA+TgmoZ-3UFcD-qBZevXLiw-_S3zm2xHgSy+Oa7-BCM+7g6_Sw@mail.gmail.com>
References: <8536.1475704230@sss.pgh.pa.us>
<15690.1475761593@sss.pgh.pa.us>
<CA+TgmoZ-3UFcD-qBZevXLiw-_S3zm2xHgSy+Oa7-BCM+7g6_Sw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
Robert Haas <robertmhaas@gmail.com> writes:
> On Thu, Oct 6, 2016 at 9:46 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Can anyone think of a test case that would stress semaphore operations
>> more heavily, without being unrealistic?
> I think it's going to be pretty hard to come up with a non-artificial
> test case that has exhibits meaningful lwlock contention on an 8-core
> system. If you go back to 9.1, before we had fast-path locking, you
> can do it, because the relation locks and vxid locks do cause
> noticeable contention on the lock manager locks in that version.
> ...
> Alternatively, get a bigger box. :-)
Well, I did both of the above. I tried 9.1 on "hydra", that 60-processor
POWER7 box, and cranked the parallelism up to ridiculous levels:
pgbench -S -j 250 -c 250 -M prepared -T 60 bench
Median of 3 runs with sysv semaphores:
number of transactions actually processed: 1554570
tps = 25875.432836 (including connections establishing)
tps = 25894.938187 (excluding connections establishing)
Ditto, for unnamed POSIX semaphores:
number of transactions actually processed: 1726696
tps = 28742.486104 (including connections establishing)
tps = 28765.963071 (excluding connections establishing)
That's about a 10% win for POSIX semaphores. Now, at saner loads,
I couldn't see much of any difference between the two semaphore APIs.
So I'm still of the opinion that there's not likely to be any meaningful
performance difference in practice, at least not on reasonably recent
Linux machines. But this does indicate that if there is any difference,
it will probably favor switching.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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-hackers@postgresql.org
Cc: tgl@sss.pgh.pa.us, robertmhaas@gmail.com
Subject: Re: Switch to unnamed POSIX semaphores as our preferred sema code?
In-Reply-To: <29244.1475959928@sss.pgh.pa.us>
References: <8536.1475704230@sss.pgh.pa.us> <15690.1475761593@sss.pgh.pa.us> <CA+TgmoZ-3UFcD-qBZevXLiw-_S3zm2xHgSy+Oa7-BCM+7g6_Sw@mail.gmail.com> <29244.1475959928@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