pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Kevin Grittner <kgrittn@gmail.com>
Cc: Kevin Grittner <kgrittn@postgresql.org>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Cc: pgsql-committers@postgresql.org <pgsql-committers@postgresql.org>
Subject: Re: [HACKERS] Re: pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
Date: Wed, 13 Apr 2016 10:35:44 -0700
Message-ID: <20160413173544.wccprqbilckmoacb@alap3.anarazel.de> (raw)
In-Reply-To: <CA+Tgmoako8yQh5HE8qK04_oCBkY3C-AncPkSjaVJvWoOuSqzuA@mail.gmail.com>
References: <E1aq1VF-0001l4-0M@gemulon.postgresql.org>
	<20160412173856.6jumsz7es5zac42o@alap3.anarazel.de>
	<CACjxUsMkZTuMNDsDdM3WwQZDcpmgQqSe8ngORk=jRH1mqBwwPw@mail.gmail.com>
	<20160412185625.g7ixnlpwaqvsqt7v@alap3.anarazel.de>
	<CACjxUsOAAbC=MbPguUtSYJdTBNDwnTAxkMhb5+Cm8MwhBSRuRA@mail.gmail.com>
	<20160412192801.wffn2vjyszyw4qa4@alap3.anarazel.de>
	<CACjxUsP=RaV1ue3ccbq4bA0LbN3e7cJJHYj_MCZr1XTKWAZzAQ@mail.gmail.com>
	<20160413171955.i53me46fqqhdlztq@alap3.anarazel.de>
	<CA+Tgmoako8yQh5HE8qK04_oCBkY3C-AncPkSjaVJvWoOuSqzuA@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-committers>

On 2016-04-13 13:25:14 -0400, Robert Haas wrote:
> > With -c old_snapshot_threshold=0:
> >
> > latency average = 0.218 ms
> > latency stddev = 0.154 ms
> > tps = 584666.289753 (including connections establishing)
> > tps = 584867.785569 (excluding connections establishing)
> >
> >
> > With -c old_snapshot_threshold=10:
> >
> > latency average = 1.112 ms
> > latency stddev = 1.246 ms
> > tps = 114883.528964 (including connections establishing)
> > tps = 114905.555943 (excluding connections establishing)
> >
> >
> > With 848ef42bb8c7909c9d7baa38178d4a209906e7c1 (and followups) reverted:
> > latency average = 0.210 ms
> > latency stddev = 0.050 ms
> > tps = 607734.407158 (including connections establishing)
> > tps = 607918.118566 (excluding connections establishing)
> 
> Yuck.  Aside from the fact that performance tanks when the feature is
> turned on

A quick look at the former shows that it's primarily contention around
the new OldSnapshotTimeMapLock not, on that hardware in that workload,
the spinlock. Which isn't that surprising because it adds an exclusive
lock to a path which doesn't contain any other exclusive locks these
days...

I have to say, I'm *highly* doubtful that it's ok to add an exclusive
lock in a readonly workload to such an hot path, without any clear path
forward how to fix that scalability issue. This doesn't apear to be
requiring just a bit of elbow grease, but a fair bit more.


> it seems that there is a significant effect even with it turned off.

It looks that way, but I'd rather run a bit more careful and repeated
tests to make sure about that part. At a factor of 5, as with the on/off
tests, per-run varitions don't play a large role, but at smaller
percentages it's worthwhile to put more care into it.  If possible it'd
be helpful to avoid a VM too...

Andres


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers



view thread (195+ messages)  latest in thread

Message-ID: <20160413173544.wccprqbilckmoacb@alap3.anarazel.de>
Permalink:  ../20160413173544.wccprqbilckmoacb@alap3.anarazel.de/
Also on:    postgresql.org/message-id/20160413173544.wccprqbilckmoacb@alap3.anarazel.de

 · 

reply

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-committers@postgresql.org
  Cc: andres@anarazel.de, robertmhaas@gmail.com, kgrittn@gmail.com, kgrittn@postgresql.org, pgsql-hackers@postgresql.org
  Subject: Re: [HACKERS] Re: pgsql: Avoid extra locks in GetSnapshotData if old_snapshot_threshold <
  In-Reply-To: <20160413173544.wccprqbilckmoacb@alap3.anarazel.de>
  References: <E1aq1VF-0001l4-0M@gemulon.postgresql.org> <20160412173856.6jumsz7es5zac42o@alap3.anarazel.de> <CACjxUsMkZTuMNDsDdM3WwQZDcpmgQqSe8ngORk=jRH1mqBwwPw@mail.gmail.com> <20160412185625.g7ixnlpwaqvsqt7v@alap3.anarazel.de> <CACjxUsOAAbC=MbPguUtSYJdTBNDwnTAxkMhb5+Cm8MwhBSRuRA@mail.gmail.com> <20160412192801.wffn2vjyszyw4qa4@alap3.anarazel.de> <CACjxUsP=RaV1ue3ccbq4bA0LbN3e7cJJHYj_MCZr1XTKWAZzAQ@mail.gmail.com> <20160413171955.i53me46fqqhdlztq@alap3.anarazel.de> <CA+Tgmoako8yQh5HE8qK04_oCBkY3C-AncPkSjaVJvWoOuSqzuA@mail.gmail.com> <20160413173544.wccprqbilckmoacb@alap3.anarazel.de>

* 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