TheRobotLearns Platform · ProxySQL: from first install to production

ProxySQL Cluster Basics: Roles, Source of Truth, and Checksum Synchronization

  • about 18 min read

Learning objectives

  • Explain Core nodes holding and propagating source of truth while Satellites pull without re-propagating.
  • Identify which ProxySQL configuration modules can be synchronized across cluster nodes.
  • Describe the checksum-triggered cluster sync sequence from detection through optional persistence.
  • Inspect cluster status using `stats_proxysql_servers_checksums`, `stats_proxysql_servers_metrics`, and `runtime_checksums_values`.

Why nodes need one truth

You configure users, servers, and rules on one ProxySQL node. ProxySQL Cluster is a native, peer-to-peer synchronization mechanism. It propagates configuration changes across all nodes, so nodes provide consistent behavior. You can still manage ProxySQL nodes individually with configuration management tools. The feature simplifies administration by propagating changes automatically.

A Core node is one of the primary nodes that holds and propagates the Source of Truth. Core nodes are explicitly defined in each other's proxysql_servers table. A Satellite node fetches configuration from Core nodes but does not propagate changes itself. ProxySQL uses a versioning and epoch-based system to identify the most recent configuration. Satellite nodes do not propagate the changes they fetch.

When you run LOAD ... TO RUNTIME on a Core node, its version number increases. That increase tells other nodes that a new Source of Truth is available for synchronization. The synchronization is pull-based: nodes fetch configuration from peers.

Takeaway: Core nodes hold and propagate the Source of Truth; Satellites fetch from Core nodes and do not propagate changes.

Which configuration modules spread

You changed a server's SSL parameters and a routing policy. ProxySQL Cluster can synchronize those configuration modules across nodes. It propagates configuration changes across nodes as part of the peer-to-peer mechanism. The feature ensures consistent behavior and simplifies administration.

The synchronized modules are:

  • Global Variables: Admin and MySQL variables.
  • MySQL Servers: hostgroups and SSL parameters.
  • MySQL Users: credentials and attributes.
  • Query Rules: routing and rewriting policies.
  • ProxySQL Servers: the list of Core nodes themselves.

The cluster pulls a changed module when its global configuration checksum mismatch is detected. If a Core node loads new Query Rules, those rules are among the modules that can reach the rest of the cluster. A Core node holds and propagates the Source of Truth. A Satellite node fetches configuration from Core nodes but does not propagate changes itself. Therefore, a Satellite that fetches changed Query Rules will not push those rules onward.

Takeaway: ProxySQL Cluster can synchronize Global Variables, MySQL Servers, MySQL Users, Query Rules, and ProxySQL Servers; Satellites fetch but do not propagate.

How checksums start a pull

A peer's global configuration checksum changes. The local node notices the mismatch when it checks peers periodically. That mismatch indicates that a module has changed, and it triggers synchronization. The cluster uses a pull-based mechanism.

First, each node periodically checks the global configuration checksum of its peers. A mismatch is the signal that a module changed. Before pulling data, the node waits for a consistent mismatch. The diffs_before_sync variables define that consistency wait. This avoids unnecessary reconfigurations during transient network states.

Next, the node performs SELECT statements against the remote peer's runtime_ tables to fetch the new configuration. The runtime_ tables are the remote peer tables that hold that new configuration. Once the data is fetched, it is loaded into local memory. An internal LOAD command activates it. The fetched data belongs to the synchronized modules. If persistence is configured, the fetched data is also automatically saved to local disk.

Takeaway: A checksum mismatch waits for diffs_before_sync, pulls runtime_ tables with SELECT, then activates fetched data locally.

Checking node sync status

Run SELECT * FROM runtime_checksums_values; and the local node's current configuration versions appear. ProxySQL exposes cluster monitoring through the stats schema. You can inspect health and synchronization status there.

The cluster feature uses a pull-based mechanism triggered by checksum mismatches. stats_proxysql_servers_checksums shows the configuration versions and checksums of all known peers. stats_proxysql_servers_metrics displays real-time performance metrics for other nodes, including uptime, queries, and latency. runtime_checksums_values shows the local node's current configuration versions.

A node periodically checks the global configuration checksum of its peers.

Run these queries to read the monitoring tables:

SELECT * FROM stats.stats_proxysql_servers_checksums;
SELECT * FROM stats.stats_proxysql_servers_metrics;
SELECT * FROM runtime_checksums_values;

The first query lists peer checksums and versions. The second query returns metrics. The third query returns local versions.

A checksum mismatch indicates that a module has changed. Synchronization waits for a consistent mismatch defined by diffs_before_sync variables before fetching.

Takeaway: Use stats_proxysql_servers_checksums for peers, runtime_checksums_values for local versions, and stats_proxysql_servers_metrics for node performance.

Check local and peer checksums

SELECT * FROM runtime_checksums_values;
SELECT * FROM stats.stats_proxysql_servers_checksums;
SELECT * FROM stats.stats_proxysql_servers_metrics;

The first query reads runtime_checksums_values, which shows the local node's current configuration versions. The second query reads stats_proxysql_servers_checksums, which shows the configuration versions and checksums of all known peers. The third query reads stats_proxysql_servers_metrics, which displays real-time performance metrics for other nodes, including uptime, queries, and latency. A checksum mismatch indicates that a module has changed.

Try it: config_layer_sim

You are checking a Satellite node. Run SELECT * FROM runtime_checksums_values; to see the local node's current configuration versions. Run SELECT * FROM stats.stats_proxysql_servers_checksums; to see the configuration versions and checksums of all known peers. Look for a checksum mismatch. A checksum mismatch indicates that a module has changed. Run SELECT * FROM stats.stats_proxysql_servers_metrics; to see uptime, queries, and latency for other nodes.

Sources

Do more with an account

ProxySQL Cluster Basics: Roles, Source of Truth, and Checksum Synchronization — ProxySQL: from first install to production