RE: speed up a logical replica setup
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
Commits
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
pg_createsubscriber: Remove obsolete comment
- 71795d1cb41b 17.0 landed
- 1330843bb78e 18.0 landed
-
pg_createsubscriber: Fix an unpredictable recovery wait time.
- e5ba6a5ab62c 17.0 landed
- 03b08c8f5f3e 18.0 landed
-
Fix unstable test in 040_pg_createsubscriber.
- ae4e072bad5f 17.0 landed
- 9fd8b331dfe1 18.0 landed
-
Fix the testcase introduced in commit 81d20fbf7a.
- ae395f0f7edb 18.0 landed
- 14387ab06503 17.0 landed
-
Further weaken new pg_createsubscriber test on Windows.
- 55c309fc5b08 17.0 landed
- a1333ec048fb 18.0 landed
-
Temporarily(?) weaken new pg_createsubscriber test on Windows.
- 54508209178b 17.0 landed
-
Make pg_createsubscriber warn if publisher has two-phase commit enabled.
- 917754557cc0 17.0 landed
-
Make pg_createsubscriber more wary about quoting connection parameters.
- b3f5ccebd79d 17.0 landed
-
pg_createsubscriber: Remove failover replication slots on subscriber
- 81d20fbf7a03 17.0 landed
-
pg_createsubscriber: Remove replication slot check on primary
- b96391382626 17.0 landed
-
pg_createsubscriber: Only --recovery-timeout controls the end of recovery process
- 04c8634c0c4d 17.0 landed
-
pg_createsubscriber: creates a new logical replica from a standby server
- d44032d01463 17.0 landed
-
Add some const decorations
- 48018f1d8c12 17.0 landed
-
Add option force_initdb to PostgreSQL::Test::Cluster:init()
- ff9e1e764fcc 17.0 cited
-
Remove MSVC scripts
- 1301c80b2167 17.0 cited
Attachments
- run.sh (application/octet-stream)
- perf_result.xlsx (application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
- add_debug_log.diff (application/octet-stream) patch
Dear hackers, Based on the requirement, I have profiled the performance test. It showed bottlenecks are in small-data case are mainly two - starting a server and waiting until the recovery is done. # Tested source code V7 patch set was applied atop HEAD(0eb23285). No configure options were specified when it was built. # Tested workload I focused on only 100MB/1GB cases because bigger ones have already had good performance. (Number of inserted tuples were same as previous tests) I used bash script instead of tap test framework. See attached. Executed SQLs and operations were almost the same. As you can see, I tested only one-db case. Results may be changed if the number of databases were changed. # Measurement Some debug logs which output current time were added (please see diff file). I picked up some events and done at before/after them. Below bullets showed the measured ones: * Starting a server * Stopping a server * Creating replication slots * Creating publications * Waiting until the recovery ended * Creating subscriptions # Result Below table shows the elapsed time for these events. Raw data is also available by the attached excel file. |Event category |100MB case [sec]|1GB [sec]| |Starting a server |1.414 |1.417 | |Stoping a server |0.506 |0.506 | |Creating replication slots |0.005 |0.007 | |Creating publications |0.001 |0.002 | |Waiting until the recovery ended|1.603 |14.529 | |Creating subscriptions |0.012 |0.012 | |Total |3.541 |16.473 | |actual time |4.37 |17.271 | As you can see, starting servers and waiting seem slow. We cannot omit these, but setting smaller shared_buffers will reduce the start time. One approach is to overwrite the GUC to smaller value, but I think we cannot determine the appropriate value. Best Regards, Hayato Kuroda FUJITSU LIMITED