Re: Rewrite sinval messaging to reduce contention

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-patches(at)postgresql(dot)org
Subject: Re: Rewrite sinval messaging to reduce contention
Date: 2008-06-19 05:28:43
Message-ID: 28501.1213853323@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

I wrote:
> ... enabling LWLOCK_STATS shows that the contention
> rate on the sinval locks is now completely negligible --- one block
> per thousand acquisitions on SInvalWriteLock, and less than one in
> 10000 on SInvalReadLock. The vast majority of the LWLock contention
> now comes from WALInsertLock and the LockMgr locks:

> Lock # acquisitions # times blocked

> SInvalReadLock 6469840 380
> SInvalWriteLock 240567 163
> WALInsertLock 2388805 89142
> LockMgr partition locks 8253142 177715

For comparison's sake I rebuilt CVS HEAD with LWLOCK_STATS enabled
and repeated the same test. I got

SInvalLock 81090044 505750
WALInsertLock 2382254 62747
LockMgr locks 10657480 171799

The change in sinval numbers is gratifying, but for awhile I didn't
believe these results because of the discrepancy in LockMgr acquisition
figures. I think though that what we are seeing here is that CVS HEAD
has the reset-everyone-on-sinval-queue-overflow behavior, which results
in a whole lot of useless cache resets, which results in a lot of
unnecessary cache reloads, and every one of those requires taking
AccessShareLock on one or more system catalogs in order to suck the data
back in. So the reduction in LockMgr traffic is explained by not doing
so many cache resets.

regards, tom lane

In response to

Browse pgsql-patches by date

  From Date Subject
Next Message Zoltan Boszormenyi 2008-06-19 11:12:32 Re: posix advises ...
Previous Message Tom Lane 2008-06-19 02:37:19 Re: Rewrite sinval messaging to reduce contention