Re: [HACKERS] kqueue - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: [HACKERS] kqueue
Date
Msg-id CAEepm=3_38iCMg9w61zfxotGw=zWcMGd8SKi+GJ_84YWTao0oA@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] kqueue  (Mateusz Guzik <mjguzik@gmail.com>)
Responses Re: [HACKERS] kqueue  (Thomas Munro <thomas.munro@enterprisedb.com>)
List pgsql-hackers
On Mon, May 21, 2018 at 7:27 PM, Mateusz Guzik <mjguzik@gmail.com> wrote:
> I have benchmarked the change on a FreeBSD box and found an big
> performance win once the number of clients goes beyond the number of
> hardware threads on the target machine. For smaller number of clients
> the win was very modest.

Thanks for the report!  This is good news for the patch, if we can
explain a few mysteries.

> 3 variants were tested:
> - stock 10.3
> - stock 10.3 + pdeathsig
> - stock 10.3 + pdeathsig + kqueue

For the record, "pdeathsig" refers to another patch of mine[1] that is
not relevant to this test (it's a small change in the recovery loop,
important for replication but not even reached here).

> [a bunch of neat output from ministat]

So to summarise your results:

32 connections: ~445k -> ~450k = +1.2%
64 connections: ~416k -> ~544k = +30.7%
96 connections: ~331k -> ~508k = +53.6%

As you added more connections above your thread count, stock 10.3's
TPS number went down, but with the patch it went up.  So now we have
to explain why you see a huge performance boost but others reported a
modest gain or in some cases loss.  The main things that jump out:

1.  You used TCP sockets and ran pgbench on another machine, while
others used Unix domain sockets.
2.  You're running a newer/bleeding edge kernel.
3.  You used more CPUs than most reporters.

For the record, Mateusz and others discovered some fixable global lock
contention in the Unix domain socket layer that is now being hacked
on[2], though it's not clear if that'd affect the results reported
earlier or not.

[1] https://www.postgresql.org/message-id/CAEepm%3D0w9AAHAH73-tkZ8VS2Lg6JzY4ii3TG7t-R%2B_MWyUAk9g%40mail.gmail.com
[2] https://reviews.freebsd.org/D15430

-- 
Thomas Munro
http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data
Next
From: Euler Taveira
Date:
Subject: Re: Add --include-table-data-where option to pg_dump, to export onlya subset of table data