Performance metrics

Updated at:
Copy as MD

PolarDB exposes performance metrics for each instance node and the PolarProxy layer. Use these metrics to configure monitoring alerts, query time-series data through the API, or diagnose performance bottlenecks.

Three metric sets are available, each described in a table below:

  • PolarDB for MySQL — engine and storage metrics for MySQL-compatible clusters

  • PolarDB for PostgreSQL — engine and storage metrics for PostgreSQL-compatible clusters

  • PolarProxy — proxy-layer metrics, available only when a cluster endpoint (database proxy) is enabled

Each metric is identified by its Metric name, which is the field name used in API calls and monitoring queries. All metrics use the data type double.

Performance metrics for PolarDB for MySQL

The following metrics cover resource utilization, InnoDB engine internals, DML throughput, I/O, and replication health for PolarDB for MySQL instances.

Performance metric Metric Data type Unit Description
PolarDBDiskUsage mean_data_size double MB Storage space used by data.
mean_log_size double MB Storage space used by logs.
mean_sys_dir_size double MB Storage space used by system files.
mean_tmp_dir_size double MB Storage space used by temporary files.
mean_redolog_size double MB Storage space used by redo logs.
mean_binlog_size double MB Storage space used by binary logs.
mean_other_log_size double MB Storage space used by other log files.
mean_undolog_size double MB Storage space used by undo logs.
PolarDBQPSTPS mean_qps double Count Number of requests per second.
mean_tps double Count Number of transactions per second.
mean_mps double Count Number of operations per second.
PolarDBCPU cpu_ratio double Percent CPU utilization (%).
PolarDBMemory mem_ratio double Percent Memory usage (%).
PolarDBMemoryForPCU pcu_mem_usage double Percent Memory usage relative to the allocated PolarDB Capacity Units (PCUs).
PolarDBCPUForPCU pcu_cpu_usage double Percent CPU utilization relative to the allocated PCUs.
PolarDBPCU pcu double Cores Number of PCU cores currently in use.
PolarDBConnections mean_active_session double Count Number of active connections.
thread_pool_running_threads double Item Number of threads currently running in the thread pool.
mean_total_session double Item Total number of current connections.
tp_thread_count double Count Total number of threads in the thread pool.
PolarDBNetworkTraffic mean_input_traffic double KB/s Inbound network traffic per second.
mean_output_traffic double KB/s Outbound network traffic per second.
PolarDBInnoDBBufferRatio mean_innodb_buffer_dirty_ratio double Percent Dirty page ratio of the InnoDB buffer pool (%). A high value indicates memory pressure or insufficient checkpoint frequency.
mean_innodb_buffer_read_hit double Percent Read hit rate of the InnoDB buffer pool (%). A low value indicates frequent disk reads.
mean_innodb_buffer_use_ratio double Percent Utilization of the InnoDB buffer pool (%).
PolarDBInnoDBDataReadWrite mean_innodb_data_read double Byte Data read from the InnoDB storage engine per second.
mean_innodb_data_written double Byte Data written to the InnoDB storage engine per second.
PolarDBInnoDBBufferRequests mean_innodb_buffer_pool_read_requests double Count Read requests served by the buffer pool per second.
mean_innodb_buffer_pool_write_requests double Count Write requests to the buffer pool per second.
PolarDBInnoDBLogWrites mean_innodb_log_write_requests double Count Physical InnoDB log writes per second.
mean_innodb_os_log_fsyncs double Times InnoDB log fsync calls per second.
PolarDBCreatedTempDiskTable mean_created_tmp_disk_tables double Unit Temporary disk tables created per second. A high value may indicate missing indexes or insufficient tmp_table_size.
PolarDBCOMDML mean_com_delete double Item DELETE statements executed per second.
mean_com_delete_multi double Item Multi-table DELETE statements executed per second.
mean_com_insert double Unit INSERT statements executed per second.
mean_com_insert_select double Unit INSERT...SELECT statements executed per second.
mean_com_replace double Statements/second REPLACE statements executed per second.
mean_com_replace_select double Unit REPLACE...SELECT statements executed per second.
mean_com_select double Statements/second SELECT statements executed per second.
mean_com_update double Statements/second UPDATE statements executed per second.
mean_com_update_multi double Unit Multi-table UPDATE statements executed per second.
PolarDBRowDML mean_innodb_rows_deleted double Row Rows deleted per second by InnoDB.
mean_innodb_rows_inserted double Row Rows inserted per second by InnoDB.
mean_innodb_rows_read double Row Rows read per second by InnoDB.
mean_innodb_rows_updated double Row Rows updated per second by InnoDB.
PolarDBIOSTAT mean_iops_r double IOPS Read IOPS.
mean_iops_w double IOPS Write IOPS.
mean_iops double IOPS Total IOPS.
mean_io_throughput_r double MB Read I/O throughput.
mean_io_throughput_w double MB Write I/O throughput.
mean_io_throughput double MB Total I/O throughput.
PolarDBReplicaLag mean_replication_delay double Seconds Replication delay between the primary node and secondary nodes.

Performance metrics for PolarDB for PostgreSQL

The following metrics cover resource utilization, WAL and replication health, transaction state, buffer cache, temporary file usage, and DML throughput for PolarDB for PostgreSQL instances.

Performance metric Metric Data type Unit Description
PolarDBCPU cpu_ratio double Percent Total CPU utilization.
cpu_sys_ratio double Percent CPU utilization in kernel mode.
cpu_user_ratio double Percent CPU utilization in user mode.
PolarDBMemory mem_ratio double Percent Memory usage.
PolarDBMemoryForPCU pcu_mem_usage double Percent Memory usage relative to the allocated PCUs.
PolarDBCPUForPCU pcu_cpu_usage double Percent CPU utilization relative to the allocated PCUs.
PolarDBPCU pcu_by_cpu_cores double Cores Number of PCU cores currently in use.
PolarDBIOSTAT mean_io_throughput_w double MB Write throughput.
mean_io_throughput_r double MB Read throughput.
mean_io_throughput double MB Total throughput.
mean_iops_w double Count Write IOPS.
mean_iops_r double Count Read IOPS.
mean_iops double Time Total IOPS.
PolarDBDiskUsage mean_tmp_size double MB Temporary space usage.
mean_log_size double MB Local log usage.
mean_wal_size double MB Space used by Write-Ahead Logging (WAL) logs.
mean_ins_total_size double MB Total space used by the cluster.
mean_data_size double MB Total space used by user data.
PolarDBReplication mean_max_slot_wal_delay_in_mb double MB Maximum replication slot delay. Monitor this metric to detect stalled consumers that prevent WAL segment recycling.
mean_logical_rep_latency_in_mb double MB Logical replication delay.
mean_send_latency_in_mb double MB WAL send latency on the primary node.
mean_replay_latency_in_mb double MB WAL replay latency on the secondary node.
PolarDBSQL mean_five_seconds_two_pc_transactions double Unit Number of two-phase commit transactions running for 5 seconds.
mean_three_seconds_two_pc_transactions double Unit Number of two-phase commit transactions running for 3 seconds.
mean_one_second_two_pc_transactions double Item Number of two-phase commit transactions running for 1 second.
mean_five_seconds_long_transactions double Unit Number of transactions running for 5 seconds.
mean_three_seconds_transactions double Unit Number of transactions running for 3 seconds.
mean_one_second_transactions double Unit Number of transactions running for 1 second.
mean_five_seconds_idle_transactions double Unit Number of transactions idle for 5 seconds.
mean_three_seconds_idle_transactions double Item Number of transactions idle for 3 seconds.
mean_one_second_idle_transactions double Unit Number of transactions idle for 1 second.
mean_five_seconds_executing_sqls double Item Number of SQL statements running for 5 seconds.
mean_three_seconds_executing_sqls double Item Number of SQL statements running for 3 seconds.
mean_one_second_executing_sqls double Item Number of SQL statements running for 1 second.
PolarDBSlowSQLTime max_executing_sql_last_time double ms Running time of the slowest active SQL statement.
PolarDBReplicationSlots total_slots double Unit Total number of replication slots.
inactive_slots double Unit Number of inactive replication slots. Inactive slots that hold back WAL can cause disk space issues.
PolarDBVacuum mean_db_age double xids Maximum age of the database in transaction IDs (xids). Monitor this metric to assess transaction ID wraparound risk.
PolarDBTransaction mean_long_two_pc_transactions double Count Number of long-running two-phase commit transactions.
mean_two_pc_transactions double Unit Total number of two-phase commit transactions.
mean_long_transactions double Unit Number of long-running transactions.
mean_long_idle_transactions double Unit Number of long-running idle transactions.
mean_idle_transactions double Count Number of idle transactions.
mean_waiting_transactions double Unit Number of transactions waiting for a lock.
mean_active_transactions double Unit Number of active transactions.
PolarDBBuffer mean_blks_hit_delta double Count Block cache hits per second.
mean_blks_read_delta double Blocks/second Blocks read from disk per second. A high value relative to mean_blks_hit_delta indicates a low cache hit rate.
mean_buffers_alloc double Count Total number of cache buffers allocated.
mean_buffers_backend_fsync double Count Total number of fsync calls performed by backends.
mean_buffers_backend double Count Total number of cache buffers written directly by backends.
mean_buffers_clean double Count Total number of cache buffers written by the checkpointer process.
mean_hit_ratio double Percent Block cache hit rate (%).
PolarDBTemp mean_temp_bytes double Bytes Data written to temporary files per second. A high value indicates that queries are spilling to disk.
mean_temp_files double Item Temporary files created per second.
PolarDBQPSTPS mean_deadlocks_delta double Number of times Deadlocks detected per second.
mean_rollbacks_delta double Count Rollbacks per second.
mean_commits_delta double Count Commits per second.
mean_tps double Times Transactions processed per second.
PolarDBRowDML mean_tup_deleted_delta double Row Rows deleted per second.
mean_tup_updated_delta double Row Rows updated per second.
mean_tup_inserted_delta double Row Rows inserted per second.
mean_tup_fetched_delta double Row Rows fetched per second (rows returned by index scans).
mean_tup_returned_delta double Row Rows returned per second (rows scanned by sequential scans).
PolarDBConnections mean_idle_connection double Unit Number of idle connections.
mean_waiting_connection double Unit Number of connections waiting for a lock.
mean_active_session double Unit Number of active sessions.
mean_total_session double Unit Total number of sessions.

Performance metrics for PolarProxy

PolarProxy is the proxy layer that handles connection pooling and read/write splitting for cluster endpoints. The following metrics are available only when a cluster endpoint is enabled for your PolarDB cluster.

Performance metric Metric Data type Unit Description
PolarProxy_CpuUsage docker_container_cpu double Percent CPU utilization of the PolarProxy container.
PolarProxy_Cps service_connections_ps double Connections/second New connections to PolarProxy per second.
PolarProxy_CurrentConns service_current_connections double Unit Current connections to PolarProxy.
PolarProxy_UpFlows service_upstream_netflow double KB/s Inbound traffic to PolarProxy per second.
PolarProxy_DownFlows service_downstream_netflow double KB/s Outbound traffic from PolarProxy per second.
PolarProxy_Qps service_queries double Requests/second Requests received by PolarProxy per second.
PolarProxy_DBConns server_connections double Unit Connections from PolarProxy to each DB node.
PolarProxy_DBQps server_queries double Requests/second Request rate from PolarProxy to each DB node.
PolarProxy_DBActionOps server_active_operations double Item Active requests from PolarProxy to each DB node.
PolarProxy_LsnNotMatch service_queries_lsn_not_match double Requests/second Rate at which requests are routed to the primary node because the consistency level is not met for a cluster endpoint. A sustained high value may indicate that read replicas are lagging.
PolarProxy_QueriesInTrx service_queries_in_trx double Requests/second Rate at which requests are routed to the primary database because they are part of a transaction for a cluster endpoint.
PolarProxy_Rt service_proxy_rt double Microseconds Round-trip time (RT) at the PolarProxy layer.
PolarProxy_Db_Rt service_db_rt double Microseconds Average time for a DB node to process a request.
PolarProxy_Full_Rt service_full_rt double Microseconds Average total time to process a request end-to-end.