Monitoring database cluster groups for Aurora
Monitor a database cluster group for Aurora, its routing layer, and its data movement through their metrics, logs, and events, and compare its member clusters side by side. Monitoring works with routing enabled or disabled.
Overview
At the group level, you monitor three things:
-
The group. CloudWatch metrics that combine the member clusters' values, the group's audit logs, and the group's Amazon RDS events.
-
The routing layer. If you use routing, the routing layer's CloudWatch metrics and logs, its session list, and the metrics of the Amazon VPC endpoints that serve the routing endpoint.
-
Data movement. The progress of each data movement job, in
move_info(see move_info), in the data movement logs, and in the group's Amazon RDS events.
Each member cluster stays a standard Aurora DB cluster, with its own metrics, logs, Performance Insights data, and events. Monitor it as you would any Aurora DB cluster; see Monitoring metrics in an Amazon Aurora cluster.
To tell whether added latency or an error comes from the routing layer or from one member cluster, use the following table to choose where to look first.
| Question | Tool | Where to read it |
|---|---|---|
| Is a group metric high, and which member cluster drives it? | CloudWatch metrics | The group metrics, the routing layer metrics, and each member cluster's metrics. See CloudWatch metrics for database cluster groups for Aurora. |
| What happened to a statement or a connection? | Amazon CloudWatch Logs | The routing layer's logs and the log groups of each member cluster. See Logs for database cluster groups for Aurora. |
| Which statements carry the load? | Performance Insights and Database Insights | Each DB instance of each member cluster. See Monitoring member clusters side by side. |
| What is a session doing now? | SQL diagnostics | The routing layer's session list and each member cluster's own views. See Routing layer metrics and signals. |
| What changed, and who changed it? | Amazon RDS events and audit logs | See Amazon RDS events for database cluster groups for Aurora and Auditing access and member cluster configuration. |
Monitoring member clusters side by side
To compare member clusters, take the same reading on each one and put each member cluster in its own column.
To monitor member clusters side by side
-
List the member clusters with
describe-db-cluster-groups. With routing enabled, you can also querydbclustergroup_sys.member_cluster_mappingsat the routing endpoint (see member_cluster_mappings). Use each member cluster's alias in SQL at the routing endpoint, and its DB cluster identifier with the AWS CLI, CloudWatch, and Amazon CloudWatch Logs. For the parameters, seeDescribeDBClusterGroupsin the Amazon RDS API Reference.aws rds describe-db-cluster-groups --regionREGION--db-cluster-group-identifierGROUP_IDENTIFIER\ --query 'DBClusterGroups[0].DBClusterGroupMembers' -
In CloudWatch, read the same metric, period, and statistic for each member cluster's
DBClusterIdentifier, one column per member cluster. -
In Amazon CloudWatch Logs, query each member cluster's log groups over the same time window, for example its error log or slow query log.
-
Open Performance Insights, or the Database Insights per-instance dashboard, on each member cluster's writer, and on its readers when they serve reads. Use the same time window on each.
-
On each member cluster, connect directly and run SQL diagnostics in a read-only session with a statement time limit.
SET SESSION transaction_read_only = ON, max_execution_time = 60000, lock_wait_timeout = 5, innodb_lock_wait_timeout = 5;To count sessions, use
Threads_connected, or count by connection source: a session that the routing layer opened carries the_rds_connection_sourceconnect attribute inperformance_schema.session_connect_attrs. For more information, see Tracing a session or statement across the group.
When you compare the results:
-
Don't average percentiles across member clusters. The average or the maximum of the member clusters' p99 values isn't the group's p99, and a group average can hide one member cluster with high load.
-
Split load by origin. Separate routed sessions from direct ones. A batch job connected directly to one member cluster raises that member cluster's load without any routed traffic.
-
Compare capacity settings, not current capacity. For Aurora Serverless v2 member clusters, a difference in minimum or maximum capacity is a finding.
To find the cause of uneven load, including lock waits and long transactions on one member cluster, see Troubleshooting uneven load across member clusters.
Monitoring data movement
Data movement jobs report their progress through dbclustergroup_data_movement.move_info at the routing endpoint, the data movement logs, and the group's Amazon RDS events, not through CloudWatch metrics. Because a job uses input and output on its source and target member clusters, watch their metrics while it runs. To read a job's progress, cut over, and cancel a job, see Moving a collocation.