Monitoring Amazon RDS for MySQL and PostgreSQL: what CloudWatch tells you and what it doesn't
CloudWatch shows how the instance is doing. It doesn't tell you why. How to combine instance metrics with database-level checks, and how parameter groups work.
With Amazon RDS and Aurora, AWS runs the operating system, backups and patching. You still own everything inside the database: settings, queries, indexes, locks and schema. Monitoring needs to cover both layers.
What CloudWatch gives you
RDS publishes instance metrics to CloudWatch, typically every minute:
| Metric | Watch for |
|---|---|
CPUUtilization | Sustained high CPU usually means expensive queries, not too small an instance |
FreeableMemory | Steady decline toward zero, or the instance starting to swap (SwapUsage) |
ReadIOPS / WriteIOPS | Hitting the volume's provisioned or baseline IOPS |
FreeStorageSpace | Running out of disk stops writes; turn on storage autoscaling or alert early |
DatabaseConnections | Approaching max_connections, or sudden jumps |
ReplicaLag | Read replicas falling behind |
These tell you that something is wrong. They don't tell you which query, which lock, or which setting.
What you still need from inside the database
- Top queries by total time (
performance_schemaon MySQL,pg_stat_statementson PostgreSQL). - Lock waits and blocking sessions.
- Settings compared with your instance's memory and workload.
- Schema health: auto-increment and sequence headroom, missing or duplicate indexes, vacuum on PostgreSQL.
- Security: accounts, TLS, privileges.
You can't install software on an RDS host, so database-level monitoring runs from another machine in the same VPC and connects over the network.
Parameter groups: how settings change on RDS
On RDS you don't edit my.cnf or postgresql.conf. Settings live in a DB parameter group attached to the instance.
- The default parameter group (
default.mysql8.0,default.postgres16and so on) can't be modified. To change anything, create a custom parameter group, copy what you need, and attach it to the instance. Attaching a new group requires a reboot. - Each parameter is dynamic (applied immediately) or static (applied at the next reboot, shown as "pending-reboot").
- Many memory settings default to formulas based on the instance class, such as
{DBInstanceClassMemory*3/4}for the InnoDB buffer pool. They scale automatically when you resize.
Right-sizing
CloudWatch history is also how you decide whether an instance is the right size. Look at the 95th percentile of hourly maximum CPU and the minimum freeable memory over two weeks. If CPU rarely passes 30% and plenty of memory stays free, one size down halves the instance cost. Also look at Graviton instance classes and gp3 storage, which are usually cheaper than their older equivalents.
How SQLNirvana handles RDS
Run the agent on a small VM in the VPC with --remote. It collects database-level data over the network. Then link the instance in SQLNirvana with a read-only IAM role (cross-account, with an external ID; no AWS keys are shared). SQLNirvana reads CloudWatch for CPU, memory, IOPS and storage, and the Savings tab uses 14 days of it to suggest a size. With the optional write permission, approved settings are applied through your custom parameter group.