Investigating MySQL Replication Latency in Percona XtraDB Cluster

March 4, 2013
Author
Peter Zaitsev
Share this Post:


Investigating MySQL Replication Latency in Percona XtraDB Cluster

Investigating MySQL Replication Latency in Percona XtraDB Cluster

I was curious to check how Percona XtraDB Cluster behaves in terms of replication latency (or data propagation latency). Specifically, I wanted to see if stale reads could occur on other nodes immediately after a write.

To test this, I wrote a simple script (included at the end) that:

  • Writes to one node
  • Immediately reads from another node
  • Retries until data propagates
  • Measures latency

The setup included 3 cluster nodes (DPE1, DPE2, DPE3) connected via a 1Gbit network, with tests run from a separate client server.

Baseline (No Load)

Key observations:

  • Replication is asynchronous from a propagation standpoint
  • Less than 1% inconsistency observed
  • Average delay under 1ms

With Load on Write Node (DPE1)

Results:

  • ~40% inconsistency rate
  • Average delay still only a few milliseconds

Load on Read Node (DPE2)

Observation:

  • Similar inconsistency frequency
  • Higher latency → read-side load impacts propagation more

Write-Heavy Workload

Surprisingly better than mixed workload (~11% inconsistency).

Write Load on Read Node

Worst-case scenario:

  • Over 50% inconsistency
  • Outliers up to 500ms+

Load on Unused Node (DPE3)

Minimal impact as expected.

Synchronous Reads Option

This ensures reads wait for replication, providing full consistency.

Large Transaction Impact

Key issue:

  • Large transactions cause massive stalls (up to ~45 seconds)
  • Due to certification + replication overhead

Observed Stall Behavior

Certification can stall unrelated operations across nodes.

Summary

  • Excellent performance for small transactions
  • Low latency under normal conditions
  • Synchronous reads available when needed
  • Large transactions can cause severe stalls

Recommendation: Understand transaction size and tolerance for latency when designing applications on Percona XtraDB Cluster.

Appendix: Test Script

Appendix: PXC Configuration

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved