Re: Final Thoughts for 8.3 on LWLocking and Scalability

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Final Thoughts for 8.3 on LWLocking and Scalability
Date: 2008-03-19 18:16:44
Message-ID: 1205950605.4285.468.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Wed, 2008-03-19 at 12:24 -0400, Tom Lane wrote:

> > [ sinval lock management needs redesign ]
>
> Yup it does.

I wrote a redesigned, simplified version of my earlier patch. Enclosed
here for discussion only, not expecting this to be the final version.
Comments at top of patch explain it.

The basic idea is to identify a single backend to delete the sinval
message queue, without the need for redesigning the postmaster to handle
single-backend invalidation messages.

> > 4. WALWriteLock is acquired in Shared mode by bgwriter when it runs
> > GetLastSegSwitchTime(). All other callers are Exclusive lockers, so the
> > Shared request will queue like everybody else. WALWriteLock queue length
> > can be long, so the bgwriter can get stuck for much longer than
> > bgwriter_delay when it makes this call; this happens only when
> > archive_timeout > 0 so probably has never shown up in any performance
> > testing. XLogWrite takes info_lck also, so we can move the
> > lastSegSwitchTime behind that lock instead. That way bgwriter need never
> > wait on I/O, just spin for access to info_lck. Minor change.
>
> This seems like a possibly reasonable thing to do; did you ever write
> a patch for it?

No, but happy to do so.

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com

PostgreSQL UK 2008 Conference: http://www.postgresql.org.uk

Attachment Content-Type Size
sinval_contention.v3.patch text/x-patch 7.7 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Richard Huxton 2008-03-19 18:48:20 Re: tsearch2 in postgresql 8.3.1 - invalid byte sequence for encoding "UTF8": 0xc3
Previous Message Andrew Dunstan 2008-03-19 18:07:29 Re: [COMMITTERS] pgsql: Enable probes to work with Mac OS X Leopard and other OSes that

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-03-19 18:39:11 Re: ALTER TYPE RENAME
Previous Message Volkan YAZICI 2008-03-19 17:55:22 Re: Text <-> C string