These tables cover general-purpose statistics that aren’t specific to MySQL, PostgreSQL, or ProxySQL Cluster. They provide a compatibility shim for client libraries, a view into ProxySQL’s internal memory usage, and global TLS and proxy-level metrics.
global_variables
Table stats.global_variables exists only to facilitate connections from libraries that issue SELECT @@max_allowed_packet or similar. Its content can be ignored.
| Field | Type | Description |
|---|---|---|
variable_name | VARCHAR | Name of the global variable |
variable_value | VARCHAR | Current value of the variable |
CREATE TABLE global_variables (
Variable_Name VARCHAR NOT NULL PRIMARY KEY,
Variable_Value VARCHAR NOT NULL
)
Example output:
Admin> SELECT * FROM stats.global_variables;
+--------------------------+----------------+
| variable_name | variable_value |
+--------------------------+----------------+
| mysql-max_allowed_packet | 4194304 |
+--------------------------+----------------+
1 row in set (0.00 sec)
Related tables: global_variables in the Global Variables reference
stats_memory_metrics
This table displays memory usage of various structures inside ProxySQL. Currently, only a few structures are tracked: SQLite, Auth module, Query Digests. But in the future more internal structures will be tracked. The most important values to monitor are the ones related to jemalloc (the memory allocator built inside ProxySQL).
| Field | Type | Description |
|---|---|---|
Variable_Name | VARCHAR | Name of the memory metric |
Variable_Value | VARCHAR | Current value of the metric |
CREATE TABLE stats_memory_metrics (
Variable_Name VARCHAR NOT NULL PRIMARY KEY,
Variable_Value VARCHAR NOT NULL
)
A detailed description of the jemalloc values is available at the jemalloc website. Jemalloc metrics:
jemalloc_allocated: bytes allocated by the applicationjemalloc_active: bytes in pages allocated by the applicationjemalloc_mapped: bytes in extents mapped by the allocatorjemalloc_metadata: bytes dedicated to metadatajemalloc_resident: bytes in physically resident data pages mapped by the allocatorjemalloc_retained: bytes in virtual memory mappings that were retained for future reuse
Other memory metrics:
Auth_memory: memory used by the authentication module to store user credentials and attributesSQLite3_memory_bytes: memory used by the embedded SQLitequery_digest_memory: memory used to store data related to stats_mysql_query_digestmysql_query_rules_memory: memory used by query rulesmysql_firewall_users_table: memory used for the lookup table of firewall usersmysql_firewall_users_config: memory used for configuration of firewall usersmysql_firewall_rules_table: memory used for the lookup table of firewall rulesmysql_firewall_rules_config: memory used for configuration of firewall rulesstack_memory_mysql_threads: memory of MySQL worker threads * stack sizestack_memory_admin_threads: memory of admin connections * stack sizestack_memory_cluster_threads: memory of ProxySQL Cluster threads * stack size
Note: stack size is 8MB by default
Example output:
Admin> SELECT * FROM stats.stats_memory_metrics;
+------------------------------+----------------+
| Variable_Name | Variable_Value |
+------------------------------+----------------+
| SQLite3_memory_bytes | 3002992 |
| jemalloc_resident | 10342400 |
| jemalloc_active | 8142848 |
| jemalloc_allocated | 7124360 |
| jemalloc_mapped | 39845888 |
| jemalloc_metadata | 2459072 |
| jemalloc_retained | 0 |
| Auth_memory | 690 |
| query_digest_memory | 0 |
| mysql_query_rules_memory | 1380 |
| mysql_firewall_users_table | 0 |
| mysql_firewall_users_config | 0 |
| mysql_firewall_rules_table | 0 |
| mysql_firewall_rules_config | 329 |
| stack_memory_mysql_threads | 8388608 |
| stack_memory_admin_threads | 8388608 |
| stack_memory_cluster_threads | 0 |
+------------------------------+----------------+
17 rows in set (0.01 sec)
Related tables: stats_mysql_query_digest
stats_proxysql_global
Introduced in ProxySQL v3.0.7. This table exports global proxy-level metrics that are not specific to any
particular database protocol. It is the authoritative source for TLS configuration state and load status.
| Field | Type | Description |
|---|---|---|
Variable_Name | VARCHAR | Name of the global metric |
Variable_Value | VARCHAR | Current value of the metric |
CREATE TABLE stats_proxysql_global (
Variable_Name VARCHAR NOT NULL PRIMARY KEY,
Variable_Value VARCHAR NOT NULL
)
Example output:
Admin> SELECT * FROM stats.stats_proxysql_global;
+--------------------------+------------------------------------------+
| Variable_Name | Variable_Value |
+--------------------------+------------------------------------------+
| TLS_Load_Count | 1 |
| TLS_Last_Load_Timestamp | 1712345678 |
| TLS_Last_Load_Result | SUCCESS |
| TLS_Server_Cert_File | /etc/proxysql/server-cert.pem |
| TLS_CA_Cert_File | /etc/proxysql/ca-cert.pem |
| TLS_Key_File | /etc/proxysql/server-key.pem |
+--------------------------+------------------------------------------+
6 rows in set (0.00 sec)
Variable description:
TLS_Load_Count: number of times TLS certificates have been loaded or reloaded since startupTLS_Last_Load_Timestamp: Unix timestamp of the most recent TLS load attemptTLS_Last_Load_Result: result of the last TLS load operation:NONE(not yet loaded),SUCCESS, orFAILEDTLS_Server_Cert_File: path to the server TLS certificate fileTLS_CA_Cert_File: path to the CA certificate fileTLS_Key_File: path to the private key file
Related tables: stats_tls_certificates, stats_mysql_global
stats_tls_certificates
Introduced in ProxySQL v3.0.7. This table provides real-time visibility into loaded TLS certificates, including
subject, issuer, validity period, and fingerprint information. It is useful for monitoring certificate expiration
and detecting misconfigurations.
| Field | Type | Description |
|---|---|---|
cert_type | VARCHAR | Certificate type: server, ca, or key |
file_path | VARCHAR | File system path to the certificate or key |
subject_cn | VARCHAR | Common Name (CN) from the certificate subject |
issuer_cn | VARCHAR | Common Name (CN) from the certificate issuer |
serial_number | VARCHAR | Serial number of the certificate |
not_before | VARCHAR | Start date of the certificate validity period |
not_after | VARCHAR | Expiration date of the certificate validity period |
days_until_expiry | INT | Number of days until the certificate expires |
sha256_fingerprint | VARCHAR | SHA-256 fingerprint of the certificate |
loaded_at | INT | Unix timestamp when the certificate was loaded |
CREATE TABLE stats_tls_certificates (
cert_type VARCHAR NOT NULL PRIMARY KEY,
file_path VARCHAR NOT NULL,
subject_cn VARCHAR,
issuer_cn VARCHAR,
serial_number VARCHAR,
not_before VARCHAR,
not_after VARCHAR,
days_until_expiry INT,
sha256_fingerprint VARCHAR,
loaded_at INT NOT NULL DEFAULT 0
)
Example output:
Admin> SELECT cert_type, subject_cn, issuer_cn, not_after, days_until_expiry FROM stats.stats_tls_certificates;
+-----------+------------+------------+-------------------------+-------------------+
| cert_type | subject_cn | issuer_cn | not_after | days_until_expiry |
+-----------+------------+------------+-------------------------+-------------------+
| server | proxysql | proxysqlCA | Mar 10 12:00:00 2027 GMT | 339 |
| ca | proxysqlCA | proxysqlCA | Mar 10 12:00:00 2027 GMT | 339 |
+-----------+------------+------------+-------------------------+-------------------+
2 rows in set (0.00 sec)
Related tables: stats_proxysql_global