INFORMATION_SCHEMA.LOGSERVICE_MEMORY_STAT is used to display memory usage statistics for all LogServices (in MySQLClient mode) in the cluster. These statistics include the global memory usage of LogServices, the memory occupied by individual Replication Groups (hereafter referred to as RGs), and the usage of the cache flushed to disk when memory limits are exceeded. The view also exposes the currently effective memory quotas, throttling thresholds, and throttling reasons to facilitate the diagnosis of memory pressure and push-down blocking issues in the consumption pipeline under the MySQLClient mode.STAT_TYPE column:GLOBAL: global statistics per LogService. One row is output for each LogService.RG: statistics per RG. One row is output for each active RG under each LogService.Field Name | Type | Description |
STAT_TYPE | VARCHAR(16) | The statistical granularity. The value is GLOBAL (LogService global statistics) or RG (single RG statistics). |
SID | BIGINT UNSIGNED | LogService instance ID. |
RG_ID | BIGINT UNSIGNED | The Replication Group ID. It is valid when STAT_TYPE='RG' and is NULL when STAT_TYPE='GLOBAL'. |
TOTAL_MEM_BYTES | BIGINT UNSIGNED | The total amount of memory currently in use, in bytes. It is the total occupancy of the entire LogService when STAT_TYPE='GLOBAL' and is the sum of the occupancy of this RG across the three layers when STAT_TYPE='RG'. |
BINLOG_HANDLER_MEM_BYTES | BIGINT UNSIGNED | The memory occupancy of the BinlogHandler layer, in bytes. |
CONFLICT_DETECTOR_MEM_BYTES | BIGINT UNSIGNED | The memory occupancy of the ConflictDetector layer, in bytes. |
MYSQL_QUEUE_MEM_BYTES | BIGINT UNSIGNED | The memory occupancy of the MysqlQueue layer, in bytes. |
SOFT_LIMIT_BYTES | BIGINT UNSIGNED | The soft limit for the global memory of LogService, in bytes. When the occupancy reaches this value, throttling is triggered for RGs that do not have the globally minimum commit_ts. It is valid only when STAT_TYPE='GLOBAL' and is NULL otherwise. This value is controlled by the system variable binlog_mysqlclient_cache_max_size. |
HARD_LIMIT_BYTES | BIGINT UNSIGNED | The hard limit for the global memory of LogService, in bytes. When the occupancy exceeds this value, an alarm log is generated, but the RG with the globally minimum commit_ts is still allowed to continue allocating memory to prevent the push-down link from being blocked. It is valid only when STAT_TYPE='GLOBAL' and is NULL otherwise. This value is determined jointly by the system variable binlog_mysqlclient_cache_hard_limit_ratio and SOFT_LIMIT_BYTES. |
PER_RG_LIMIT_BYTES | BIGINT UNSIGNED | The memory quota for a single RG, in bytes. It is valid only when STAT_TYPE='GLOBAL' and is NULL otherwise. This value is controlled by the system variable log_service_per_rg_mem_limit. |
COMMIT_TS | BIGINT UNSIGNED | The current commit timestamp of the RG. It is valid only when STAT_TYPE='RG' and is NULL otherwise. |
IS_MIN_TS_RG | SMALLINT | Whether the RG has the globally minimum commit_ts within the current LogService. 1 indicates yes, and 0 indicates no. The RG with the minimum commit_ts can continue to allocate memory when the memory limit is exceeded, preventing the global push-down from being blocked. It is valid only when STAT_TYPE='RG' and is NULL otherwise. |
BLOCK_REASON | VARCHAR(256) | The description of the reason why the RG is currently being throttled. An empty string or NULL indicates that it is not being throttled. It is valid only when STAT_TYPE='RG'. |
FLUSH_DISK_WRITE_COUNT | BIGINT UNSIGNED | The cumulative number of times that data in memory is flushed to disk. |
FLUSH_DISK_WRITE_BYTES | BIGINT UNSIGNED | The cumulative number of bytes of data in memory that are flushed to disk. |
FLUSH_DISK_READ_COUNT | BIGINT UNSIGNED | The cumulative number of times that data is read back from the disk cache to memory. |
FLUSH_DISK_READ_BYTES | BIGINT UNSIGNED | The cumulative number of bytes of data that are read back from the disk cache to memory. |
FLUSH_DISK_ON_DISK_BYTES | BIGINT UNSIGNED | The estimated amount of data that currently remains in the disk cache, in bytes. It equals FLUSH_DISK_WRITE_BYTES - FLUSH_DISK_READ_BYTES, with a lower limit of 0. |
DISK_SOFT_LIMIT_BYTES | BIGINT UNSIGNED | The global soft limit for the disk cache, in bytes. It is valid only when STAT_TYPE='GLOBAL' and is NULL otherwise. |
PER_RG_DISK_LIMIT_BYTES | BIGINT UNSIGNED | The disk cache quota for a single RG, in bytes. It is valid only when STAT_TYPE='GLOBAL' and is NULL otherwise. |
tdsql > SELECT * FROM information_schema.logservice_memory_stat WHERE stat_type='GLOBAL'\\G*************************** 1. row ***************************STAT_TYPE: GLOBALSID: 1001RG_ID: NULLTOTAL_MEM_BYTES: 268435456BINLOG_HANDLER_MEM_BYTES: 33554432CONFLICT_DETECTOR_MEM_BYTES: 167772160MYSQL_QUEUE_MEM_BYTES: 67108864SOFT_LIMIT_BYTES: 1073741824HARD_LIMIT_BYTES: 2147483648PER_RG_LIMIT_BYTES: 104857600COMMIT_TS: NULLIS_MIN_TS_RG: NULLBLOCK_REASON: NULLFLUSH_DISK_WRITE_COUNT: 0FLUSH_DISK_WRITE_BYTES: 0FLUSH_DISK_READ_COUNT: 0FLUSH_DISK_READ_BYTES: 0FLUSH_DISK_ON_DISK_BYTES: 0DISK_SOFT_LIMIT_BYTES: 4294967296PER_RG_DISK_LIMIT_BYTES: 5368709121 row in set (0.00 sec)
tdsql > SELECT sid, rg_id, total_mem_bytes, commit_ts, is_min_ts_rg, block_reason-> FROM information_schema.logservice_memory_stat-> WHERE stat_type='RG' AND block_reason IS NOT null AND block_reason <> ''\\G*************************** 1. row ***************************SID: 1001RG_ID: 8001TOTAL_MEM_BYTES: 104857600COMMIT_TS: 452937184905367553IS_MIN_TS_RG: 0BLOCK_REASON: per-RG quota exceeded*************************** 2. row ***************************SID: 1001RG_ID: 8005TOTAL_MEM_BYTES: 838860800COMMIT_TS: 452937184905431041IS_MIN_TS_RG: 0BLOCK_REASON: Global memory exceeded soft limit2 rows in set (0.00 sec)
tdsql > SELECT sid, rg_id, total_mem_bytes, commit_ts, is_min_ts_rg-> FROM information_schema.logservice_memory_stat-> WHERE stat_type='RG'-> ORDER BY total_mem_bytes DESC LIMIT 5;+------+-------+-----------------+--------------------+--------------+| SID | RG_ID | TOTAL_MEM_BYTES | COMMIT_TS | IS_MIN_TS_RG |+------+-------+-----------------+--------------------+--------------+| 1001 | 8005 | 838860800 | 452937184905431041 | 0 || 1001 | 8003 | 419430400 | 452937184905298945 | 1 || 1001 | 8001 | 104857600 | 452937184905367553 | 0 || 1001 | 8002 | 62914560 | 452937184905312257 | 0 || 1001 | 8004 | 20971520 | 452937184905384961 | 0 |+------+-------+-----------------+--------------------+--------------+5 rows in set (0.00 sec)
피드백