Use `commit_delay` to reduce amount of fsyncs
PostgreSQL provides a way to group concurrently committing transactions together and only fsync once per group ("group commit"). The amount of time that is spent to form this group of transactions is commit_delay
. This only happens if commit_siblings
number of transactions are active.
The trade-off here is latency vs. throughput.
It might be worth to look into:
- What is our current fsync = commit rate?
- Can we improve throughput (transaction rate) by increasing
commit_delay
? - Does increasing
commit_delay
improve IO load on the primary?
Note that increasing commit_delay
is going to delay commits of participating transactions by that amount of time (microseconds). Increasing this does not affect consistency/durability guarantees.