On Tue, Mar 29, 2022 5:15 PM Hou, Zhijie/侯 志杰 <houzj.f...@fujitsu.com> wrote: > > Thanks for the comment. > Attach the new version patch with this change. >
Hi, I did a performance test for this patch to see if it affects performance when publishing empty transactions, based on the v32 patch. In this test, I use synchronous logical replication, and publish a table with no operations on it. The test uses pgbench, each run takes 15 minutes, and I take median of 3 runs. Drop and recreate db after each run. The results are as follows, and attach the bar chart. The details of the test is also attached. TPS - publishing empty transactions (scale factor 1) -------------------------------------------------------------------- 4 threads 8 threads 16 threads HEAD 4818.2837 4353.6243 3888.5995 patched 5111.2936 4555.1629 4024.4286 TPS - publishing empty transactions (scale factor 100) -------------------------------------------------------------------- 4 threads 8 threads 16 threads HEAD 9066.6465 16118.0453 21485.1207 patched 9357.3361 16638.6409 24503.6829 There is an improvement of more than 3% after applying this patch, and in the best case, it improves by 14%, which looks good to me. Regards, Shi yu
Some parameters specified in postgresql.conf ===================================================== shared_buffers = 8GB checkpoint_timeout = 30min max_wal_size = 20GB min_wal_size = 10GB autovacuum = off Steps ===================================================== -- in publisher -- using scale factor 100 pgbench -i postgres -p 5432 -s 100 -- using default scale factor, 1 pgbench -i postgres -p 5432 -- create table in publisher and subscriber CREATE TABLE tbl_empty (a int); -- create publication create publication pub for table tbl_empty; -- create subscription CREATE SUBSCRIPTION sub CONNECTION 'host=localhost port=5432 dbname=postgres' PUBLICATION pub;" Then set synchronous replication and restart publisher server. Run pgbench and record the TPS. pgbench -b tpcb-like -c 4 -j 4 -T 900 -n postgres About the test machine ===================================================== The processor spec of the test machine is Intel® Xeon® Silver 4210 CPU @2.20GHz with 10 cores/20 threads/2 sockets.