These tables contain statistics about ProxySQL Cluster operations, covering node monitoring, configuration synchronization, and inter-node communication. They are populated by the cluster health-check threads and reflect the real-time view each ProxySQL instance holds of its peers.
- stats_proxysql_servers_checksums
- stats_proxysql_servers_metrics
- stats_proxysql_servers_status
- stats_proxysql_servers_clients_status
- stats_proxysql_message_metrics
stats_proxysql_servers_checksums
ProxySQL instances that are part of a Cluster regularly monitor each other to understand if a reconfiguration needs to be triggered. It is possible to query the current view of the Cluster through this table. Each row represents the last known checksum for a specific configuration module on a specific cluster node.
| Field | Type | Description |
|---|---|---|
hostname | VARCHAR | Address of the proxy (remote or local) |
port | INT | Port of the proxy (remote or local) |
name | VARCHAR | Name of the module being synchronized |
version | INT | Incremented each time the configuration is loaded locally |
epoch | INT | Unix timestamp when the configuration was created |
checksum | VARCHAR | Checksum of the configuration; used to detect changes |
changed_at | INT | Unix timestamp when the configuration was last loaded locally |
updated_at | INT | Unix timestamp of the last remote checksum fetch by local ProxySQL |
diff_check | INT | Consecutive checks where remote config differed from local; triggers sync at threshold |
CREATE TABLE stats_proxysql_servers_checksums (
hostname VARCHAR NOT NULL,
port INT NOT NULL DEFAULT 6032,
name VARCHAR NOT NULL,
version INT NOT NULL,
epoch INT NOT NULL,
checksum VARCHAR NOT NULL,
changed_at INT NOT NULL,
updated_at INT NOT NULL,
diff_check INT NOT NULL,
PRIMARY KEY (hostname, port, name) )
Field descriptions:
hostname: address of the proxy (remote or local)port: port of the proxy (remote or local)name: name of the module being synchronizedversion: every time a configuration is loaded (locally), its version number is increased by 1epoch: this is the time when the specific configuration was created (either locally, or remotely before being imported)checksum: the checksum of the configuration itself. This is the information that proxies use to detect configuration changeschanged_at: this is the time when the specific configuration was loaded locally. Note that it is different thanepoch, which represents when the configuration was createdupdated_at: this is the last time the local ProxySQL checked the checksum of the remote ProxySQL instance. If this value is not increased, it means that the local ProxySQL cannot fetch data from the remote ProxySQLdiff_check: the number of checks in a row in which it was detected that the remote configuration is different than the local one. When a threshold is reached, an automatic reconfiguration is triggered
Example output:
Admin> SELECT 'proxy'||SUBSTR(hostname,11,12) hostname,name,version v, epoch,SUBSTR(checksum,0,10)||'...' checksum, changed_at, updated_at, diff_check diff FROM stats_proxysql_servers_checksums WHERE version > 0 ORDER BY name, hostname;
+----------+-------------------+---+------------+--------------+------------+------------+------+
| hostname | name | v | epoch | checksum | changed_at | updated_at | diff |
+----------+-------------------+---+------------+--------------+------------+------------+------+
| proxy01 | mysql_query_rules | 1 | 1543750277 | 0x8CE2200... | 1543750278 | 1543761243 | 0 |
| proxy02 | mysql_query_rules | 1 | 1542709023 | 0x8CE2200... | 1543750277 | 1543761244 | 0 |
| proxy03 | mysql_query_rules | 1 | 1542709056 | 0x8CE2200... | 1543750277 | 1543761244 | 0 |
| proxy01 | mysql_servers | 2 | 1543754137 | 0xBB56542... | 1543754137 | 1543761243 | 0 |
| proxy02 | mysql_servers | 7 | 1543754141 | 0xBB56542... | 1543754140 | 1543761244 | 0 |
| proxy03 | mysql_servers | 6 | 1543754142 | 0xBB56542... | 1543754137 | 1543761244 | 0 |
| proxy01 | mysql_users | 1 | 1543750277 | 0xA9533E6... | 1543750278 | 1543761243 | 0 |
| proxy02 | mysql_users | 1 | 1542709023 | 0xA9533E6... | 1543750277 | 1543761244 | 0 |
| proxy03 | mysql_users | 1 | 1542709056 | 0xA9533E6... | 1543750277 | 1543761244 | 0 |
| proxy01 | proxysql_servers | 1 | 1543750277 | 0xA87C55F... | 1543750278 | 1543761243 | 0 |
| proxy02 | proxysql_servers | 1 | 1542709023 | 0xA87C55F... | 1543750277 | 1543761244 | 0 |
| proxy03 | proxysql_servers | 1 | 1542709056 | 0xA87C55F... | 1543750277 | 1543761244 | 0 |
+----------+-------------------+---+------------+--------------+------------+------------+------+
12 rows in set (0.00 sec)
Related tables: proxysql_servers (configuration source for cluster nodes), stats_proxysql_servers_metrics
stats_proxysql_servers_metrics
ProxySQL instances in a Cluster regularly exchange global statuses. Some of these statuses are visible in this table. Each row represents the most recently observed runtime metrics for a single cluster node.
| Field | Type | Description |
|---|---|---|
hostname | VARCHAR | Address of the cluster node |
port | INT | Port of the cluster node |
weight | INT | Weight of the cluster node as defined in proxysql_servers |
comment | VARCHAR | Comment associated with the cluster node |
response_time_ms | INT | Latest response time to cluster health checks, in milliseconds |
Uptime_s | INT | Current uptime of the cluster node, in seconds |
last_check_ms | INT | Latest time to process cluster checks, in milliseconds |
Queries | INT | Total queries processed by the cluster node |
Client_Connections_connected | INT | Number of frontend client connections currently open |
Client_Connections_created | INT | Total frontend client connections created over time |
CREATE TABLE stats_proxysql_servers_metrics (
hostname VARCHAR NOT NULL,
port INT NOT NULL DEFAULT 6032,
weight INT CHECK (weight >= 0) NOT NULL DEFAULT 0,
comment VARCHAR NOT NULL DEFAULT '',
response_time_ms INT NOT NULL,
Uptime_s INT NOT NULL,
last_check_ms INT NOT NULL,
Queries INT NOT NULL,
Client_Connections_connected INT NOT NULL,
Client_Connections_created INT NOT NULL,
PRIMARY KEY (hostname, port) )
Field descriptions:
hostname: address of the Cluster node, defined in theproxysql_serverstableport: port of the Cluster node, defined in theproxysql_serverstableweight: weight of the Cluster node, defined in theproxysql_serverstablecomment: comment associated with the Cluster node, defined in theproxysql_serverstableresponse_time_ms: the latest time to respond to Cluster checks, in millisecondsUptime_s: the current uptime of the Cluster node, in secondslast_check_ms: the latest time to process Cluster checks, in millisecondsQueries: how many queries the Cluster node has processedClient_Connections_connected: the number of frontend client connections currently open on the Cluster nodeClient_Connections_created: the number of frontend client connections created over time on the Cluster node
Example output:
Admin> SELECT 'proxy'||SUBSTR(hostname,11,12) hostname , response_time_ms rtt_ms, Uptime_s, last_check_ms, Queries, Client_Connections_connected c_conn, Client_Connections_created c_created FROM stats_proxysql_servers_metrics ORDER BY hostname;
+----------+--------+----------+---------------+-----------+--------+-----------+
| hostname | rtt_ms | Uptime_s | last_check_ms | Queries | c_conn | c_created |
+----------+--------+----------+---------------+-----------+--------+-----------+
| proxy01 | 0 | 12111 | 18494 | 52475036 | 9095 | 14445 |
| proxy02 | 0 | 1053365 | 18047 | 199072024 | 13552 | 456759 |
| proxy03 | 2 | 1053333 | 16950 | 248707015 | 9891 | 471200 |
+----------+--------+----------+---------------+-----------+--------+-----------+
3 rows in set (0.00 sec)
Related tables: proxysql_servers (configuration source), stats_proxysql_servers_checksums, stats_proxysql_servers_status
stats_proxysql_servers_status
Currently unused — this table was created to show general statistics related to all the services configured in the proxysql_servers table. The schema is defined but rows are not populated in the current ProxySQL versions.
| Field | Type | Description |
|---|---|---|
hostname | VARCHAR | Address of the cluster node |
port | INT | Port of the cluster node |
weight | INT | Weight of the cluster node |
master | VARCHAR | Whether this node is considered a master |
global_version | INT | Global configuration version seen on this node |
check_age_us | INT | Age of the last check, in microseconds |
ping_time_us | INT | Ping round-trip time to this node, in microseconds |
checks_OK | INT | Total successful health checks |
checks_ERR | INT | Total failed health checks |
CREATE TABLE stats_proxysql_servers_status (
hostname VARCHAR NOT NULL,
port INT NOT NULL DEFAULT 6032,
weight INT CHECK (weight >= 0) NOT NULL DEFAULT 0,
master VARCHAR NOT NULL,
global_version INT NOT NULL,
check_age_us INT NOT NULL,
ping_time_us INT NOT NULL,
checks_OK INT NOT NULL,
checks_ERR INT NOT NULL,
PRIMARY KEY (hostname, port) )
Field descriptions:
hostname: address of the cluster nodeport: port of the cluster nodeweight: weight of the cluster node as defined inproxysql_serversmaster: indicates whether this node is currently acting as the cluster masterglobal_version: the global configuration version last seen on this nodecheck_age_us: how long ago (in microseconds) the last health check was performedping_time_us: round-trip ping latency to this node in microsecondschecks_OK: cumulative count of successful health checkschecks_ERR: cumulative count of failed health checks
Note: This table is currently unused. It was designed to expose per-node health statistics but is not populated by the current implementation.
Example output:
Admin> SELECT * FROM stats.stats_proxysql_servers_status;
Empty set (0.00 sec)
Related tables: proxysql_servers, stats_proxysql_servers_metrics
stats_proxysql_servers_clients_status
Tracks the status of ProxySQL Cluster clients — other ProxySQL nodes that have connected to this instance. Each row represents a remote ProxySQL node identified by its UUID and network endpoint. This table is useful for verifying which peer nodes are actively participating in the cluster.
| Field | Type | Description |
|---|---|---|
uuid | VARCHAR | Unique identifier of the remote ProxySQL node |
hostname | VARCHAR | Hostname or IP address of the remote node |
port | INT | Admin port of the remote node |
admin_mysql_ifaces | VARCHAR | MySQL-compatible admin interfaces advertised by the remote node |
last_seen_at | INT | Unix timestamp of the last time this node was observed |
CREATE TABLE stats_proxysql_servers_clients_status (
uuid VARCHAR NOT NULL,
hostname VARCHAR NOT NULL,
port INT NOT NULL,
admin_mysql_ifaces VARCHAR NOT NULL,
last_seen_at INT NOT NULL,
PRIMARY KEY (uuid, hostname, port)
)
Field descriptions:
uuid: the unique identifier assigned to the remote ProxySQL instance; persists across restartshostname: the hostname or IP address of the remote ProxySQL nodeport: the admin port on which the remote node accepts cluster connectionsadmin_mysql_ifaces: the MySQL-compatible admin interface addresses advertised by the remote node for management connectionslast_seen_at: Unix timestamp recording the most recent time this node successfully communicated with the local instance
Example output:
Admin> SELECT * FROM stats.stats_proxysql_servers_clients_status;
+--------------------------------------+--------------+------+---------------------+-------------+
| uuid | hostname | port | admin_mysql_ifaces | last_seen_at |
+--------------------------------------+--------------+------+---------------------+-------------+
| a1b2c3d4-e5f6-7890-abcd-ef1234567890 | 192.168.1.11 | 6032 | 192.168.1.11:6032 | 1700000120 |
| b2c3d4e5-f6a7-8901-bcde-f12345678901 | 192.168.1.12 | 6032 | 192.168.1.12:6032 | 1700000118 |
+--------------------------------------+--------------+------+---------------------+-------------+
2 rows in set (0.00 sec)
Related tables: proxysql_servers, stats_proxysql_servers_metrics, stats_proxysql_servers_checksums
stats_proxysql_message_metrics
Tracks internal ProxySQL log and diagnostic messages and their frequency. Each row represents a unique message identified by its source location (filename, line number, and function name). This table is useful for identifying frequently triggered warnings or errors, and for understanding the internal event rate of a running ProxySQL instance.
| Field | Type | Description |
|---|---|---|
message_id | VARCHAR | Identifier for the message type |
filename | VARCHAR | Source file where the message originates |
line | INT | Line number in the source file |
func | VARCHAR | Function name where the message is emitted |
count_star | INTEGER | Total number of times this message has been emitted |
first_seen | INTEGER | Unix timestamp when this message was first observed |
last_seen | INTEGER | Unix timestamp when this message was most recently observed |
CREATE TABLE stats_proxysql_message_metrics (
message_id VARCHAR NOT NULL,
filename VARCHAR NOT NULL,
line INT CHECK (line >= 0) NOT NULL DEFAULT 0,
func VARCHAR NOT NULL,
count_star INTEGER NOT NULL,
first_seen INTEGER NOT NULL,
last_seen INTEGER NOT NULL,
PRIMARY KEY (filename, line, func)
)
Field descriptions:
message_id: a string identifier for the class of message, typically derived from a constant or enum in the source codefilename: the source file (relative path) in which the message is generatedline: the line number withinfilenamewhere the message is emittedfunc: the function or method name that emits the messagecount_star: cumulative count of all occurrences since ProxySQL started (or since the last reset viastats_proxysql_message_metrics_reset)first_seen: Unix timestamp of the first time this message was recorded in the current sessionlast_seen: Unix timestamp of the most recent occurrence of this message
Example output:
Admin> SELECT * FROM stats.stats_proxysql_message_metrics ORDER BY count_star DESC LIMIT 5;
+------------+-----------------------------+------+---------------------------+------------+------------+------------+
| message_id | filename | line | func | count_star | first_seen | last_seen |
+------------+-----------------------------+------+---------------------------+------------+------------+------------+
| MSG_0042 | MySQL_Session.cpp | 831 | handler___status_NONE | 182340 | 1700000001 | 1700003600 |
| MSG_0017 | ProxySQL_Cluster.cpp | 210 | check_cluster_membership | 54120 | 1700000001 | 1700003599 |
| MSG_0031 | MySQL_Monitor.cpp | 445 | monitor_connect_thread | 12005 | 1700000050 | 1700003580 |
| MSG_0008 | ProxySQL_Admin.cpp | 102 | run_query | 3401 | 1700000010 | 1700003590 |
| MSG_0055 | MySQL_Backend.cpp | 678 | reconnect_to_backend | 210 | 1700000200 | 1700003400 |
+------------+-----------------------------+------+---------------------------+------------+------------+------------+
5 rows in set (0.00 sec)
stats_proxysql_message_metrics_reset
This is a reset-on-read variant of stats_proxysql_message_metrics. Querying this table returns the same data as stats_proxysql_message_metrics and then atomically resets all counters (count_star) and timestamps (first_seen, last_seen) to zero. Use this variant when you want to observe the message rate over a specific interval without accumulating counts from previous periods.
Admin> SELECT * FROM stats.stats_proxysql_message_metrics_reset ORDER BY count_star DESC LIMIT 3;
+------------+-----------------------------+------+---------------------------+------------+------------+------------+
| message_id | filename | line | func | count_star | first_seen | last_seen |
+------------+-----------------------------+------+---------------------------+------------+------------+------------+
| MSG_0042 | MySQL_Session.cpp | 831 | handler___status_NONE | 5210 | 1700003500 | 1700003600 |
| MSG_0017 | ProxySQL_Cluster.cpp | 210 | check_cluster_membership | 1540 | 1700003500 | 1700003599 |
| MSG_0031 | MySQL_Monitor.cpp | 445 | monitor_connect_thread | 342 | 1700003500 | 1700003580 |
+------------+-----------------------------+------+---------------------------+------------+------------+------------+
3 rows in set (0.00 sec)
-- Counters are now reset; a subsequent query will show zeroes or new increments only.
Related tables: stats_proxysql_servers_metrics, stats_proxysql_servers_checksums