These tables cover general-purpose statistics that aren’t specific to MySQL, PostgreSQL, or ProxySQL Cluster. They provide a compatibility shim for client libraries and a view into ProxySQL’s internal memory usage across its core subsystems.
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