pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tomas Vondra <tomas.vondra@2ndquadrant.com>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Kevin Grittner <kgrittn@gmail.com>
Cc: Andres Freund <andres@anarazel.de>
Cc: pgsql-hackers@postgresql.org <pgsql-hackers@postgresql.org>
Subject: Re: what to revert
Date: Tue, 10 May 2016 20:51:02 +0200
Message-ID: <fa0e77af-8156-6940-e214-95c78c7fb4c4@2ndquadrant.com> (raw)
In-Reply-To: <CA+TgmoZqCNc0ShBt1XgJnh7PDHgPjNmXkCLoSPGJmK2V0yMsrg@mail.gmail.com>
References: <CA+TgmoYOWTtBQEL+Bv=w93bvUjbXSUw3uGnp+R29dduZ==8K0Q@mail.gmail.com>
	<CACjxUsOuf_a6KMsFBNtt8Tn8y7qNLE2Wcb9BQeRFdHD6oAKp3g@mail.gmail.com>
	<20160503162209.ufuezlkovbrdrayp@alap3.anarazel.de>
	<CACjxUsPb63TqU1uBc6zW5fsFynUB=BZ8NbFp6E=jK9qA7twibg@mail.gmail.com>
	<20160503174104.tk7oz4akwbeqsmuq@alap3.anarazel.de>
	<c7ad0f06-52c6-6284-c3a0-251807be9d3f@2ndquadrant.com>
	<20160503224241.rwtxrhgmprzqxhlv@alap3.anarazel.de>
	<eb3d6105-7165-fe71-f753-0a95281c3c19@2ndquadrant.com>
	<e17a7535-09b8-2273-0f7c-2d368390b0ed@2ndquadrant.com>
	<CACjxUsPgmm+LLG1+3d56EhCD8yEKP_b14zHGFOUpJp0Qx-J2pw@mail.gmail.com>
	<CACjxUsOL0s2DWRT5kNgc_498rsrrGXVNWHGiqBiAA2BGv9kxZw@mail.gmail.com>
	<a1338386-752a-485b-fa8c-5b113f10a4e6@2ndquadrant.com>
	<CA+TgmoZqCNc0ShBt1XgJnh7PDHgPjNmXkCLoSPGJmK2V0yMsrg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Hi,

On 05/10/2016 07:36 PM, Robert Haas wrote:
> On Tue, May 10, 2016 at 12:31 PM, Tomas Vondra
> <tomas.vondra@2ndquadrant.com> wrote:
>> The following table shows the differences between the disabled and reverted
>> cases like this:
>>
>>     sum('reverted' results with N clients)
>>    ---------------------------------------- - 1.0
>>     sum('disabled' results with N clients)
>>
>> for each scale/client count combination. So for example 4.83% means with a
>> single client on the smallest data set, the sum of the 5 runs for reverted
>> was about 1.0483x than for disabled.
>>
>>     scale        1       16       32      64      128
>>     100      4.83%    2.84%    1.21%   1.16%    3.85%
>>     3000     1.97%    0.83%    1.78%   0.09%    7.70%
>>     10000   -6.94%   -5.24%  -12.98%  -3.02%   -8.78%
>
> /me scratches head.
>
> That doesn't seem like noise, but I don't understand the
> scale-factor-10000 results either.  Reverting the patch makes the code
> smaller and removes instructions from critical paths, so it should
> speed things up at least nominally.  The question is whether it makes
> enough difference that anyone cares.  However, removing unused code
> shouldn't make the system *slower*, but that's what's happening here
> at the higher scale factor.

/me scratches head too

>
> I've seen cases where adding dummy instructions to critical paths
> slows things down at 1 client and speeds them up with many clients.
> That happens because the percentage of time active processes fighting
> over the critical locks goes down, which reduces contention more than
> enough to compensate for the cost of executing the dummy
> instructions. If your results showed performance lower at 1 client
> and slightly higher at many clients, I'd suspect an effect of that
> sort. But I can't see why it should depend on the scale factor. That
> suggests that, perhaps, it's having some effect on the impact of
> buffer eviction, maybe due to a difference in shared memory layout.
> But I thought we weren't supposed to have such artifacts any more
> now that we start every allocation on a cache line boundary...
>

I think we should look for issues in the testing procedure first, 
perhaps try to reproduce it on a different system. Another possibility 
is that the revert is not perfectly correct - the code compiles and does 
not crash, but maybe there's a subtle issue somewhere.

I'll try to collect some additional info (detailed info from sar, 
aggregated transaction log, ...) for further analysis. And also increase 
the number of runs, so that we can better compare all the separate 
combinations.

regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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



view thread (56+ messages)  latest in thread

Message-ID: <fa0e77af-8156-6940-e214-95c78c7fb4c4@2ndquadrant.com>
Permalink:  ../fa0e77af-8156-6940-e214-95c78c7fb4c4@2ndquadrant.com/
Also on:    postgresql.org/message-id/fa0e77af-8156-6940-e214-95c78c7fb4c4@2ndquadrant.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: tomas.vondra@2ndquadrant.com, robertmhaas@gmail.com, kgrittn@gmail.com, andres@anarazel.de
  Subject: Re: what to revert
  In-Reply-To: <fa0e77af-8156-6940-e214-95c78c7fb4c4@2ndquadrant.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