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 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.

FieldTypeDescription
variable_nameVARCHARName of the global variable
variable_valueVARCHARCurrent 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).

FieldTypeDescription
Variable_NameVARCHARName of the memory metric
Variable_ValueVARCHARCurrent 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 application
  • jemalloc_active: bytes in pages allocated by the application
  • jemalloc_mapped: bytes in extents mapped by the allocator
  • jemalloc_metadata: bytes dedicated to metadata
  • jemalloc_resident: bytes in physically resident data pages mapped by the allocator
  • jemalloc_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 attributes
  • SQLite3_memory_bytes: memory used by the embedded SQLite
  • query_digest_memory: memory used to store data related to stats_mysql_query_digest
  • mysql_query_rules_memory: memory used by query rules
  • mysql_firewall_users_table: memory used for the lookup table of firewall users
  • mysql_firewall_users_config: memory used for configuration of firewall users
  • mysql_firewall_rules_table: memory used for the lookup table of firewall rules
  • mysql_firewall_rules_config: memory used for configuration of firewall rules
  • stack_memory_mysql_threads: memory of MySQL worker threads * stack size
  • stack_memory_admin_threads: memory of admin connections * stack size
  • stack_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.

FieldTypeDescription
Variable_NameVARCHARName of the global metric
Variable_ValueVARCHARCurrent 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 startup
  • TLS_Last_Load_Timestamp: Unix timestamp of the most recent TLS load attempt
  • TLS_Last_Load_Result: result of the last TLS load operation: NONE (not yet loaded), SUCCESS, or FAILED
  • TLS_Server_Cert_File: path to the server TLS certificate file
  • TLS_CA_Cert_File: path to the CA certificate file
  • TLS_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.

FieldTypeDescription
cert_typeVARCHARCertificate type: server, ca, or key
file_pathVARCHARFile system path to the certificate or key
subject_cnVARCHARCommon Name (CN) from the certificate subject
issuer_cnVARCHARCommon Name (CN) from the certificate issuer
serial_numberVARCHARSerial number of the certificate
not_beforeVARCHARStart date of the certificate validity period
not_afterVARCHARExpiration date of the certificate validity period
days_until_expiryINTNumber of days until the certificate expires
sha256_fingerprintVARCHARSHA-256 fingerprint of the certificate
loaded_atINTUnix 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