From: Ivan Kartyshov <i.kartyshov@postgrespro.ru>
To: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Cc: pgsql-hackers@postgresql.org
Subject: Re: less expensive pg_buffercache on big shmem
Date: Mon, 5 Sep 2016 19:19:45 +0300
Message-ID: <62b5173f-a0fd-c2d7-2cce-c888b99fd098@postgrespro.ru> (raw)
In-Reply-To: <657c1de5-2982-44a9-c4ee-fc52e60dc445@2ndquadrant.com>
References: <f9d6cab2-73a7-7a84-55a8-07dcb8516ae5@postgrespro.ru>
<CA+TgmoZqSrHH2qpBTs2EmsFwnxhLGN7iAgK8RtCz4Kqvps4Xzw@mail.gmail.com>
<479c08ff-4d11-1e2e-625b-eb72e686b11a@postgrespro.ru>
<657c1de5-2982-44a9-c4ee-fc52e60dc445@2ndquadrant.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>
On 09/03/2016 05:04 AM, Tomas Vondra wrote:
> This patch needs a rebase, as 06d7fd6e bumped the version to 1.2.
Thank you for a valuable hint.
> > If we will replace consistent method, then we should replace it
with the
> > partially consistent method (called "nonconsistent") because:
> > 1) it's based on fast spinlocks (it's not fully up to its name, though)
>
> In other words, it does exactly the thing proposed up-thread, i.e.
> locking only buffer headers.
>
> What do you mean by fast spinlocks? And why aren't they up to the name?
Not they (spinlocks), but the name “nonconsistent” is somewhat
misleading. At the moment we can't implement concurrent shared memory
access without locks in general, so most inconsistent method that has
been proposed was the "nonconsistent" one. But roughly speaking
*nonconsistent* is not as such by the name, because it contains a
locking mechanism (spinlocks).
> > 2) it's *almost* the fastest one (the less time needed for execution of
> > method, the less data core will change and as a consequence the more
> > consistent snapshot will be)
>
> I'm not sure I understand what you're saying here? What do you mean by
> "almost the fastest one"?
I mean the fastest one that has been proposed ("consistent"|
"semiconsistent"| "nonconsistent").
> I'm a bit confused by the results you reported before, i.e. that
>
> 1) nonconsistent is 10% faster than consistent method
> 2) semiconsistent is 5-times slower than nonconsistent method
>
> What does that mean? Are you refering to duration of the queries reading
> data from pg_buffercache, or to impact on the other queries?
Here I mean "working duration time".
> How can be semiconsistent 5x slower than nonconsistent? Wouldn't that
> make it significantly slower than the consistent method?
Firstly, when we want to measure the quality of pg_buffercache, we must
measure several values:
1) Execution time (duration of the queries reading data from pg_buffercache)
2) How it influences the system (and other queries) during its work
Secondly, the semiconsistent is slower than nonconsistent and consistent
method, but it makes less influence on other queries then consistent.
Thirdly, it is slower because it locks the partitions of shared memory
in a different way than in consistent or nonconsistent methods.
The semi-consistent strategy implies that only one buffer is locked at a
time. Therefor has no significant effect on the system, but it takes
more time.
---
Ivan Kartyshov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
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-hackers@postgresql.org
Cc: i.kartyshov@postgrespro.ru, tomas.vondra@2ndquadrant.com
Subject: Re: less expensive pg_buffercache on big shmem
In-Reply-To: <62b5173f-a0fd-c2d7-2cce-c888b99fd098@postgrespro.ru>
References: <f9d6cab2-73a7-7a84-55a8-07dcb8516ae5@postgrespro.ru> <CA+TgmoZqSrHH2qpBTs2EmsFwnxhLGN7iAgK8RtCz4Kqvps4Xzw@mail.gmail.com> <479c08ff-4d11-1e2e-625b-eb72e686b11a@postgrespro.ru> <657c1de5-2982-44a9-c4ee-fc52e60dc445@2ndquadrant.com> <62b5173f-a0fd-c2d7-2cce-c888b99fd098@postgrespro.ru>
* 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