To make it easier for you to view and stay up to date with how instances work, TencentDB for MySQL provides a wide variety of performance monitoring metrics and convenient monitoring features (custom view, time comparison, merged monitoring metrics, etc). You can log in to the TencentDB for MySQL console, and view them in Instance Monitoring on the instance management page.
Note
You can get instance monitoring metrics by calling the GetMonitorData API or using the TencentDB for MySQL monitoring metrics in Tencent Cloud Observability Platform (TCOP).
You can also create a dashboard for monitoring metrics to dynamically analyze the monitoring data.
If the number of tables in a single instance exceeds one million, database monitoring may be affected. Please make sure that the number of tables in a single instance is below one million.
Types of Instances for Monitoring
TencentDB for MySQL source, read-only, and disaster recovery instances as well as database proxy nodes can be monitored, and each instance is provided with a separate monitoring view for easy query.
Types of monitoring
Four types of monitoring are available for TencentDB for MySQL: resource monitoring, engine monitoring (general), engine monitoring (extended), and deployment monitoring. You can view the metrics of different monitoring types to gain a quick and accurate understanding of how instances perform and operate.
Note
TencentDB for MySQL single-node instances of cloud disk edition currently support resource monitoring and engine monitoring (general) but not engine monitoring (extended) and deployment monitoring.
Resource monitoring provides monitoring data of CPU, memory, disk, and network.
Engine monitoring (general) provides monitoring data of the number of connections, locks, hotspot tables, and slow queries, helping you troubleshoot issues and optimize the performance.
Engine monitoring (extended) provides a wider variety of engine-related monitoring metrics so as to assist you in identifying existing or potential database problems as much as possible.
Deployment monitoring provides monitoring metrics with regard to source-replica delay. It divides into source monitoring and replica monitoring:
If the instance is a source instance, the object of instance deployment monitoring is the linkage between the source instance and its hidden replica. Deployment monitoring displays the IO and SQL thread status of the hidden replica. The source-replica delay (in MB or in seconds) refers to the delay between the source instance and its hidden replica.
If the instance is a read-only instance, the object of instance deployment monitoring is the linkage between the source instance and the read-only instance. Deployment monitoring displays the IO and SQL thread status of the read-only instance. The source-replica delay (in MB or in seconds) refers to the delay between the read-only instance and the source instance.
If the instance is a disaster recovery instance:
a. The object of instance deployment monitoring (source) is the linkage between the disaster recovery instance and the source instance. Deployment monitoring displays the IO and SQL thread status of the disaster recovery instance. The source-replica delay (in MB or in seconds) refers to the delay between the disaster recovery instance and the source instance.
b. The object of instance deployment monitoring (replica) is the linkage between the disaster recovery instance and its hidden replica. Deployment monitoring displays the IO and SQL thread status of the hidden replica. The source-replica delay (in MB or in seconds) refers to the delay between the disaster recovery instance and its hidden replica.
Monitoring Granularity
TencentDB for MySQL has adopted an adaptive policy for monitoring granularity since August 11, 2018, which means that you cannot select a monitoring granularity as desired for the time being. The adaptive policy is as follows:
Time Span
Monitoring Granularity
Adaptation Description
Retention Period
(0h, 4h]
5s
The time span is below 4 hours, and the monitoring granularity is 5 seconds.
1 day
(4h, 2d]
1min
The time span is above 4 hours but below 2 days, and the monitoring granularity is 1 minute.
15 days
(2d, 10d]
5min
The time span is above 2 days but below 10 days, and the monitoring granularity is 5 minutes.
31 days
(10d, 30d]
1h
The time span is above 10 days but below 30 days, and the monitoring granularity is 1 hour.
62 days
Note
Currently, you can view monitoring data of TencentDB for MySQL in the past 30 days.
Monitored metrics
TCOP provides the following monitoring metrics for TencentDB for MySQL instances in the instance dimension:
TencentDB for MySQL also supports event alarming and event alarming features. After you set an event rule, target, and recipients, if an abnormal event is detected, alarm notifications will be sent to the recipients through various channels, helping you manage the instance running in a more comprehensive manner.
For details about event alarming, see EventBridge.
Number of SQL statements (INSERT, SELECT, UPDATE, DELETE, and REPLACE) executed by the database per second. This metric mainly represents the actual processing capability of the TencentDB instance.
Transactions per Second
tps
Queries/second
The number of transactions executed per second in the database
Slow Queries
slow_queries
Threads
The number of queries that take more than long_query_time second(s) to be executed
Full-Table scans
select_scan
Queries/second
The number of full-table scans executed per second
Queries
select_count
Queries/second
Queries per second
UPDATE Queries
com_update
Queries/second
The number of updates executed per second
DELETE Queries
com_delete
Queries/second
The number of deletions executed per second
INSERT Queries
com_insert
Queries/second
The number of insertions executed per second
REPLACE Queries
om_replace
Queries/second
The number of replacements executed per second
DML Throughput
queries
Queries/second
All executed SQL statements such as SET and SHOW
Open Connections
threads_connected
Connections
The number of currently open connections
Connection utilization
connection_use_rate
%
The number of open connections/the maximum number of connections
Query Utilization
query_rate
%
Actual QPS/Recommended QPS
Total Disk Usage
capacity
MB
This includes MySQL's data directories and logs such as binlog, relaylog, undolog, errorlog, and slowlog.
Disk Space Used by Data
real_capacity
MB
This includes only MySQL's data directories.
Disk Space Used by Logs
log_capacity
MB
This includes only MySQL's logs binlog, relaylog, undolog, errorlog, and slowlog.
Disk Space Used by Log Files
disk_log_used
MB
This includes only MySQL's binlog, relaylog, and undolog.
Disk Space Used by Temp Files
disk_tmp_used
MB
This includes only MySQL's temp files.
Disk utilization
volume_rate
%
Total disk usage/Purchased instance space
Private Outbound Traffic
bytes_sent
Byte/sec
The number of bytes sent per second
Private Inbound Traffic
bytes_received
Byte/sec
The number of bytes received per second
Query Cache Hit Rate
qcache_hit_rate
%
Query Cache Hit Rate
The query cache hit rate
qcache_use_rate
%
The query cache hit rate
Table Locks Awaited
table_locks_waited
Queries/second
The number of times that a request for a table lock could not be granted immediately and a wait was needed
Temp Tables
created_tmp_tables
Queries/second
The number of internal temporary tables created by the server while executing statements
InnoDB Cache Hit Rate
innodb_cache_hit_rate
%
The InnoDB engine cache hit rate
InnoDB Cache Utilization
innodb_cache_use_rate
%
The InnoDB engine cache utilization
InnoDB Disk Reads
innodb_os_file_reads
Queries/second
The total number of file reads performed by read threads within InnoDB
InnoDB Disk Writes
innodb_os_file_writes
Queries/second
The total number of file writes performed by write threads within InnoDB
InnoDB fsync() Calls
innodb_os_fsyncs
Queries/second
The number of calls of the fsync function by InnoDB per second
Tables Opened by InnoDB
innodb_num_open_files
Connections
The number of tables InnoDB currently holds open
MyISAM Cache Hit Rate
key_cache_hit_rate
%
The MyISAM engine cache hit rate
MyISAM Cache Utilization
key_cache_use_rate
%
The MyISAM engine cache utilization
CPU utilization
cpu_use_rate
%
If overuse of idle resources is permitted, the CPU utilization may exceed 100%
Memory Utilization
memory use rate
%
If overuse of idle resources is permitted, the memory utilization may exceed 100%
Memory usage
memory_use
MB
If overuse of idle resources is permitted, the used memory may exceed the purchased specification
Temp Files
created_tmp_files
Queries/second
The number of temp files created per second
Open Tables
opened_tables
Connections
Instance
COMMIT Statements
com_commit
Queries/second
The number of COMMIT statements per second
ROLLBACK Statements
com_rollback
Queries/second
The number of ROLLBACK statements per second
Created threads
threads_created
Connections
The number of threads created to handle connections
Running Threads
threads_running
Connections
The number of threads that are not sleeping
Max connections
max_connections
Connections
Max connections
The maximum number of connections
created_tmp_disk_tables
Queries/second
The number of internal on-disk temporary tables created by the server while executing statements
Requests to Read Next Row
handler_read_rnd_next
Queries/second
The number of requests to read the next row in the data file
Rollbacks Performed in Storage Engine
handler_rollback
Queries/second
The number of requests for a storage engine to perform a rollback operation
Internal COMMIT Statements
handler_commit
Queries/second
The number of internal COMMIT statements per second
InnoDB empty pages
innodb_buffer_pool_pages_free
Connections
The number of free pages in the InnoDB buffer pool
Total InnoDB pages
innodb_buffer_pool_pages_total
Connections
The total size of the InnoDB buffer pool in pages
InnoDB logical reads
innodb_buffer_pool_read_requests
Queries/second
The number of logical read requests
InnoDB physical reads
innodb_buffer_pool_reads
Queries/second
The number of logical reads that InnoDB could not satisfy from the buffer pool, and had to read directly from disk.
InnoDB reads
innodb_data_read
Byte/sec
The amount of data read per second
Total InnoDB reads
innodb_data_reads
Queries/second
The total number of data reads per second
Total InnoDB writes
innodb_data_writes
Queries/second
The total number of data writes per second
InnoDB writes
innodb_data_written
Byte/sec
The amount of data written per second
InnoDB rows deleted
innodb_rows_deleted
Queries/second
The number of rows deleted from InnoDB tables
InnoDB rows inserted
innodb_rows_inserted
Queries/second
The number of rows inserted into InnoDB tables
InnoDB rows updated
innodb_rows_updated
Queries/second
The number of rows updated in InnoDB tables
InnoDB rows updated
innodb_rows_read
Queries/second
The number of rows read from InnoDB tables
Average InnoDB row lock acquiring time
innodb_row_lock_time_avg
Millisecond (ms)
The average time to acquire a row lock for InnoDB tables
InnoDB row lock waits
innodb_row_lock_waits
Queries/second
The number of times operations on InnoDB tables had to wait for a row lock
Unused Blocks in Key Cache
key_blocks_unused
Connections
The number of key blocks unused by the MyISAM key cache
Used Blocks in Key Cache
key_blocks_used
Connections
The number of key blocks used by the MyISAM key cache
Blocks Read from Key Cache
key_read_requests
Queries/second
The number of requests to read a key block from the MyISAM key cache
Blocks Read from Disk
key_reads
Queries/second
The number of requests to read a disk data block from the MyISAM key cache
Blocks Written into Key Cache
key_write_requests
Queries/second
The number of requests to write a key block to the MyISAM key cache
Blocks Written into Disk
key_writes
Queries/second
The number of requests to write a disk data block to the MyISAM key cache
Primary-Secondary delay distance
master_slave_sync_distance
MB
The source-replica delay (in seconds)
Primary-Secondary delay time
seconds_behind_master
Second.
Primary-Secondary delay time
IO thread status
slave_io_running
Status values: 0: Yes; 1: No; 2: Connecting
The IO thread running status
SQL thread status
slave_sql_running
Status value: 0: Yes; 1: No
The SQL thread running status
FAQs
How can I configure the source/replica delay monitoring?
You can do so by following the steps below based on the actual scenarios.
Scenario 1: Configure source-replica delay monitoring for the source instance
1. Log in to the TCOP console select Alarm Policy under Alarm Management module on the left sidebar, and click Create Policy on the Policy Management tab.
2. On the Create Alarm Policy page, select Policy Type: Cloud Database > MySQL > Replica Monitoring.
Note
When configuring source-replica delay monitoring for the source instance, you must select replica monitoring as the policy type, so that the delay information from the replica to the source is monitored.
3. Complete the trigger condition settings for the monitoring items "Source-Replica Delay (in MB)" and "Source-Replica Delay (in Seconds)" as well as other configuration items as needed, and click Complete.
4. After the setting is completed, the alarm can be triggered when the monitoring items "Source-Replica Delay (in MB)” and "Source-Replica Delay (in Seconds)" meet the trigger conditions.
Scenario 2: Configure source-replica delay monitoring for the read-only and disaster recovery instances
1. Log in to the TCOP console select Alarm Policy under Alarm Management module on the left sidebar, and click Create Policy on the Policy Management tab.
2. On the Create Alarm Policy page, select Policy Type: Cloud Database > MySQL > Host Monitoring.
Note
When configuring source-replica delay monitoring for the read-only instance, you must select host monitoring as the policy type, so that the delay information from the read-only instance to the source instance is monitored.
When configuring source-replica delay monitoring for the disaster recovery instance, you can select host monitoring as the policy type, so that the delay information from the disaster recovery instance to the source instance is monitored. If you select replica monitoring as the policy type, then the delay information from the replica of the disaster recovery instance to the disaster recovery instance is monitored.
3. Complete the trigger condition settings for the monitoring items "Source-Replica Delay (in MB)" and "Source-Replica Delay (in Seconds)" as well as other configuration items as needed, and click Complete.
4. After the setting is completed, the alarm can be triggered when the monitoring items "Source-Replica Delay (in MB)” and "Source-Replica Delay (in Seconds)" meet the trigger conditions.