GetDbStatus
获取 MySQL 运行时的内存相关配置参数,通过解析 /etc/my.cnf 和 SHOW VARIABLES 获得。
- 路由:
POST /database - action:
GetDbStatus
输入参数
| 参数名称 | 必选 | 类型 | 描述 |
|---|---|---|---|
| action | 是 | String | 固定值 GetDbStatus |
输出参数
返回 mem 对象,包含以下 MySQL 配置项:
| 参数名称 | 类型 | 描述 |
|---|---|---|
| query_cache_size | String | 查询缓存大小 |
| bt_query_cache_size | String | 面板设置的查询缓存 |
| query_cache_type | String | 查询缓存类型:ON / OFF / DEMAND |
| query_cache_supprot | String | 查询缓存支持状态 |
| table_open_cache | Integer | 打开表缓存数量 |
| thread_cache_size | Integer | 线程缓存大小 |
| key_buffer_size | Integer | MyISAM 索引缓冲(MB) |
| tmp_table_size | Integer | 临时表大小(MB) |
| max_heap_table_size | String | MEMORY 表最大大小 |
| innodb_buffer_pool_size | Integer | InnoDB 缓冲池大小(MB) |
| innodb_log_buffer_size | Integer | InnoDB 日志缓冲(MB) |
| max_connections | Integer | 最大连接数 |
| sort_buffer_size | Integer | 排序缓冲(KB) |
| read_buffer_size | Integer | 读缓冲(KB) |
| read_rnd_buffer_size | Integer | 随机读缓冲(KB) |
| join_buffer_size | Integer | JOIN 缓冲(KB) |
| thread_stack | Integer | 线程栈大小(KB) |
| binlog_cache_size | Integer | Binlog 缓存(KB) |
示例
{
"mem": {
"query_cache_size": "0",
"bt_query_cache_size": "0",
"table_open_cache": 256,
"thread_cache_size": 32,
"query_cache_type": "OFF",
"key_buffer_size": 64,
"tmp_table_size": 64,
"max_heap_table_size": "16777216",
"innodb_buffer_pool_size": 256,
"innodb_log_buffer_size": 32,
"max_connections": 500,
"sort_buffer_size": 1024,
"read_buffer_size": 1024,
"read_rnd_buffer_size": 256,
"join_buffer_size": 256,
"thread_stack": 256,
"binlog_cache_size": 32,
"query_cache_supprot": "disable"
}
}