Sample Header Ad - 728x90

PostgreSQL: does the WAL group commit affect synchronous replication performance?

0 votes
1 answer
465 views
I'm curious if PostgreSQL's Group Commit mechanism (controlled by commit_delay and commit_siblings parameters) only affects disk fsync calls. Or does it also allow multiple on-the-fly transactions to be batched concurrently in WAL synchronous replication? From [here](https://wiki.postgresql.org/wiki/Group_commit) it should affect synchronous replication ("The proposed implementation this page describes is **heavily based on the existing synchronous replication implementation**. ")? But [here](https://www.postgresql.org/docs/current/wal-configuration.html) says: "No sleep will occur **if fsync is not enabled**", so it seems that Group Commit mechanism only reduces local fsync, and does not support batch confirmation of WAL remote synchronous replication? --------UPDATE: My understanding: In synchronous (strongly consistent) replication, each commit on the local node waits until the remote standby node returns ack before continuing. So my question is: During this waiting time for ack signaling (at least one RTT - Round Trip Time): **[A]** will the transactions on the concurrent connections of other clients continue to be replicated and committed to the standby node **without blocking**? **[B]** Or does each transaction have to **wait** for the end of the previous transaction to initiate a commit to the remote standby node (stop-and-wait protocol)? As you can see, action [A] is much like group commit, and [B] is like no group commit optimization. Coupled with the descriptions on the pg's official wiki (It says "The group commit is heavily based on the existing synchronous replication implementation."), that's why I associate it with group commit optimization.
Asked by ASBai (103 rep)
Sep 27, 2022, 10:48 PM
Last activity: Sep 28, 2022, 09:47 PM