Re: Slow standby snapshot

From: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
To: Simon Riggs <simon(dot)riggs(at)enterprisedb(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andres Freund <andres(at)anarazel(dot)de>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, reshkekirill <reshkekirill(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Slow standby snapshot
Date: 2022-11-28 07:19:31
Message-ID: CANtu0oipBkNEo78Dops4d4sq-jSZWiK8V2ydKbVe4gA0CWtaEQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello, everyone.

Benchmarks for the last version of patch are ready.

Executed on two 16CPU machines (AMD EPYC 7763), 5000 max_connections.
Staring from the 60th second, 30 seconds-long transaction was started
on primary. Setup is the same as in (1), scripts here - (2).

For most of the tests, simple-update and simple-select pgbench
scenarios were used on primary and standby.
For one of the tests - just “SELECT txid_current();” and “SELECT 1;”
accordingly.

The name of the line is KAX_COMPRESS_FREQUENCY value.

For 16 connections, 64, 128 and 256 are the best ones.

For 32 - 32, 64, 12, 256.

For 64 - a little bit tricky story. 128 and 256 are best, but
1024-4096 can be faster some small period of time with continuing
degradation. Still not sure why. Three different run sets in
attachment, one with start of long transaction on 20th second.

For 128 - anything < 1024 is good.

For “txid_current+select 1” case - the same.

Also, in all the cases, patched version is better than current master.
And for master (and some big values of KAX_COMPRESS_FREQUENCY) version
it is not possible for performance to recover, probably caches and
locking goes into some bad, but stable pattern.

So, I think it is better to go 128 here.

[1]: https://www.postgresql.org/message-id/flat/CANtu0ohzBFTYwdLtcanWo4%2B794WWUi7LY2rnbHyorJdE8_ZnGg%40mail.gmail.com#379c1be7b8134ada5a574078d51b64c6
[2]: https://gist.github.com/michail-nikolaev/e1dfc70bdd7cfd1b902523dbb3db2f28

--
Michail Nikolaev.

Attachment Content-Type Size
16.png image/png 121.0 KB
32.png image/png 146.7 KB
64_3.png image/png 174.7 KB
64_2.png image/png 171.2 KB
128.png image/png 139.4 KB
select1.png image/png 195.6 KB
64.png image/png 184.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2022-11-28 07:40:52 Re: Remove a unused argument from qual_is_pushdown_safe
Previous Message Peter Smith 2022-11-28 07:19:01 Re: Perform streaming logical transactions by background workers and parallel apply