From: Robert Haas <robertmhaas@gmail.com>
To: Ivan Voras <ivoras@freebsd.org>
Cc: pgsql-performance@postgresql.org
Subject: Re: Performance under contention
Date: Mon, 6 Dec 2010 14:07:05 -0500
Message-ID: <AANLkTi=FosOakJr84x5pchZ65Fi9Gt4yqcsvSHTazLyR@mail.gmail.com> (raw)
In-Reply-To: <AANLkTinFqxaUnpq9E+oh6KcoyqPHDMxjS-_g3AJSPxmk@mail.gmail.com>
References: <icccng$kpg$1@dough.gmane.org>
<AANLkTinFqxaUnpq9E+oh6KcoyqPHDMxjS-_g3AJSPxmk@mail.gmail.com>
On Mon, Dec 6, 2010 at 12:10 PM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Sun, Nov 21, 2010 at 7:15 PM, Ivan Voras <ivoras@freebsd.org> wrote:
>> The "sbwait" part is from FreeBSD - IPC sockets, but so much blocking on
>> semwait indicates large contention in PostgreSQL.
>
> I can reproduce this. I suspect, but cannot yet prove, that this is
> contention over the lock manager partition locks or the buffer mapping
> locks.
I compiled with LWLOCK_STATS defined and found that exactly one lock
manager partition lwlock was heavily contended, because, of course,
the SELECT-only test only hits one table, and all the threads fight
over acquisition and release of AccessShareLock on that table. One
might argue that in more normal workloads there will be more than one
table involved, but that's not necessarily true, and in any case there
might not be more than a handful of major ones.
However, I don't have a very clear idea what to do about it.
Increasing the number of lock partitions doesn't help, because the one
table you care about is still only in one partition.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
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-performance@postgresql.org
Cc: robertmhaas@gmail.com, ivoras@freebsd.org
Subject: Re: Performance under contention
In-Reply-To: <AANLkTi=FosOakJr84x5pchZ65Fi9Gt4yqcsvSHTazLyR@mail.gmail.com>
References: <icccng$kpg$1@dough.gmane.org> <AANLkTinFqxaUnpq9E+oh6KcoyqPHDMxjS-_g3AJSPxmk@mail.gmail.com> <AANLkTi=FosOakJr84x5pchZ65Fi9Gt4yqcsvSHTazLyR@mail.gmail.com>
* 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