Hi! 👋 We are doing a big documentation refresh. Help us improve — what's missing or could be better? Let us know! Simply send an email or start a conversation in Google Groups!

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

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.

FieldTypeDescription
hostnameVARCHARAddress of the proxy (remote or local)
portINTPort of the proxy (remote or local)
nameVARCHARName of the module being synchronized
versionINTIncremented each time the configuration is loaded locally
epochINTUnix timestamp when the configuration was created
checksumVARCHARChecksum of the configuration; used to detect changes
changed_atINTUnix timestamp when the configuration was last loaded locally
updated_atINTUnix timestamp of the last remote checksum fetch by local ProxySQL
diff_checkINTConsecutive 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 synchronized
  • version: every time a configuration is loaded (locally), its version number is increased by 1
  • epoch: 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 changes
  • changed_at: this is the time when the specific configuration was loaded locally. Note that it is different than epoch, which represents when the configuration was created
  • updated_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 ProxySQL
  • diff_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.

FieldTypeDescription
hostnameVARCHARAddress of the cluster node
portINTPort of the cluster node
weightINTWeight of the cluster node as defined in proxysql_servers
commentVARCHARComment associated with the cluster node
response_time_msINTLatest response time to cluster health checks, in milliseconds
Uptime_sINTCurrent uptime of the cluster node, in seconds
last_check_msINTLatest time to process cluster checks, in milliseconds
QueriesINTTotal queries processed by the cluster node
Client_Connections_connectedINTNumber of frontend client connections currently open
Client_Connections_createdINTTotal 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 the proxysql_servers table
  • port: port of the Cluster node, defined in the proxysql_servers table
  • weight: weight of the Cluster node, defined in the proxysql_servers table
  • comment: comment associated with the Cluster node, defined in the proxysql_servers table
  • response_time_ms: the latest time to respond to Cluster checks, in milliseconds
  • Uptime_s: the current uptime of the Cluster node, in seconds
  • last_check_ms: the latest time to process Cluster checks, in milliseconds
  • Queries: how many queries the Cluster node has processed
  • Client_Connections_connected: the number of frontend client connections currently open on the Cluster node
  • Client_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.

FieldTypeDescription
hostnameVARCHARAddress of the cluster node
portINTPort of the cluster node
weightINTWeight of the cluster node
masterVARCHARWhether this node is considered a master
global_versionINTGlobal configuration version seen on this node
check_age_usINTAge of the last check, in microseconds
ping_time_usINTPing round-trip time to this node, in microseconds
checks_OKINTTotal successful health checks
checks_ERRINTTotal 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 node
  • port: port of the cluster node
  • weight: weight of the cluster node as defined in proxysql_servers
  • master: indicates whether this node is currently acting as the cluster master
  • global_version: the global configuration version last seen on this node
  • check_age_us: how long ago (in microseconds) the last health check was performed
  • ping_time_us: round-trip ping latency to this node in microseconds
  • checks_OK: cumulative count of successful health checks
  • checks_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.

FieldTypeDescription
uuidVARCHARUnique identifier of the remote ProxySQL node
hostnameVARCHARHostname or IP address of the remote node
portINTAdmin port of the remote node
admin_mysql_ifacesVARCHARMySQL-compatible admin interfaces advertised by the remote node
last_seen_atINTUnix 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 restarts
  • hostname: the hostname or IP address of the remote ProxySQL node
  • port: the admin port on which the remote node accepts cluster connections
  • admin_mysql_ifaces: the MySQL-compatible admin interface addresses advertised by the remote node for management connections
  • last_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.

FieldTypeDescription
message_idVARCHARIdentifier for the message type
filenameVARCHARSource file where the message originates
lineINTLine number in the source file
funcVARCHARFunction name where the message is emitted
count_starINTEGERTotal number of times this message has been emitted
first_seenINTEGERUnix timestamp when this message was first observed
last_seenINTEGERUnix 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 code
  • filename: the source file (relative path) in which the message is generated
  • line: the line number within filename where the message is emitted
  • func: the function or method name that emits the message
  • count_star: cumulative count of all occurrences since ProxySQL started (or since the last reset via stats_proxysql_message_metrics_reset)
  • first_seen: Unix timestamp of the first time this message was recorded in the current session
  • last_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