valkey icon indicating copy to clipboard operation
valkey copied to clipboard

Enable dual-channel replication by default

Open naglera opened this issue 7 months ago • 5 comments

Dual-channel replication has proven to be reliable in our current version and provides substantial improvements in full sync performance and resource utilization.

Background

The feature provides substantial improvements in full sync performance and resource utilization.

Benefits

  1. Reduced memory load on primary nodes through:

    • Moving COB tracking to replica side
    • Decreased chance of COB overruns
  2. Improved CPU efficiency on primary:

    • Dedicated connection for RDB transfer allowing direct access for child processes
    • Reduced load on primary's main process
    • Better processing of client queries during sync

Performance improvements:

  • 5-7.5% improvement in write latency during sync sessions
  • Up to 50% shorter sync times during heavy read operations
  • More then 60% reduction in memory usage for storing replication data in some cases

Proposal

Enable dual-channel replication as the default configuration in valkey 9, with the option to disable it if needed.

Impact

This change will enhance valkey's overall performance during full sync operations, without requiring additional configuration from users.

References

  • Original dual-channel replication PR implementation - https://github.com/valkey-io/valkey/pull/60

naglera avatar May 14 '25 09:05 naglera

This is one of the topics in next Monday meeting.

hwware avatar May 14 '25 14:05 hwware

This is one of the topics in next Monday meeting.

Indeed. But we would like to be more data driven and try to gather community feedback, hence we created this issue.

ranshid avatar May 15 '25 13:05 ranshid

Just before Valkey 9.0 GA let's review this again to see what the adoption sees like.

madolson avatar May 19 '25 14:05 madolson

Is there any downside we can expect or scenarios were dual channel replication would be worse ?

hpatro avatar Oct 17 '25 18:10 hpatro

Before we enable it globally, I would like this bugfix to be merged (and tested):

  • https://github.com/valkey-io/valkey/pull/2846

jdheyburn avatar Nov 14 '25 18:11 jdheyburn