Re: Configure template change to use SysV Semaphors on darwin

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Marcellino <cmarcellino(at)apple(dot)com>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Configure template change to use SysV Semaphors on darwin
Date: 2007-09-25 23:58:06
Message-ID: 9120.1190764686@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

I wrote:
> Awhile back, Chris Marcellino <cmarcellino(at)apple(dot)com> wrote:
>> If this is in fact the case, I have a trivial patch to conditionally
>> enable SysV semaphores based on the OS release:

> I've tried this patch on my Mac laptop, and while it seems to work as
> advertised in terms of not eating a boatload of file descriptors,
> I was disturbed to find that it seems consistently a couple percent
> slower than the POSIX-sema code according to pgbench.

I rechecked this using PG CVS HEAD and can no longer reproduce a
slowdown --- in fact, the SYSV-sema code is marginally faster.
It's well within the noise level of pgbench, but anyway this seems
enough to allay my fears of a performance drop:

posix:

g42:~ tgl$ pgbench -c 10 -t 1000 bench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 10
number of clients: 10
number of transactions per client: 1000
number of transactions actually processed: 10000/10000
tps = 107.051937 (including connections establishing)
tps = 107.207220 (excluding connections establishing)

sysv:

g42:~ tgl$ pgbench -c 10 -t 1000 bench
starting vacuum...end.
transaction type: TPC-B (sort of)
scaling factor: 10
number of clients: 10
number of transactions per client: 1000
number of transactions actually processed: 10000/10000
tps = 107.565526 (including connections establishing)
tps = 107.730181 (excluding connections establishing)

I am not sure what changed since May, but one possibility is that
I just recently boosted the sysv shmem limit on my laptop. I think
the previous runs were probably taken with max_connections of 30
or so, whereas these numbers have max_connections = 100. That's
relevant since there are 3x more semaphores needed.

Anyway, getting rid of all the file descriptors for Posix semas
seems Clearly A Good Idea, so I'll go ahead and apply this patch.
Thanks for sending it in.

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2007-09-26 00:47:54 Re: Optimizer hook
Previous Message Julius Stroffek 2007-09-25 23:40:32 Re: Optimizer hook