The CPUUtilization graph for your Amazon RDS instance has been pinned above 90% for an hour, queries that took 20 ms now take two seconds, and the application is timing out. On RDS you cannot run top on the host, so the usual first move is not available. RDS gives you three other views instead: CloudWatch metrics from the hypervisor, Enhanced Monitoring from an agent on the instance, and CloudWatch Database Insights, which took over from Performance Insights in 2026. This guide, for RDS for MySQL and RDS for PostgreSQL, walks through them in triage order: confirm the CPU is real, check whether a burstable T-class instance has run out of credits, find the SQL that owns the load, check background work such as autovacuum, and then decide between tuning, a read replica, and a larger or Graviton instance class.
- Pull
CPUUtilizationwithaws cloudwatch get-metric-statisticsusing theMaximumstatistic at a 60-second period, then turn on Enhanced Monitoring to see per-process CPU andsteal. - On db.t3 and db.t4g, check
CPUCreditBalanceandCPUSurplusCreditsCharged. RDS runs T classes in Unlimited mode, so running out of credits costs money, not throttling. - Find the SQL in CloudWatch Database Insights: compare DB load with the Max vCPU line and group it by wait event and by SQL. The Performance Insights console reached end of life on 31 July 2026, but the
aws piAPI still works. - Confirm in the engine:
pg_stat_statementson PostgreSQL (loaded by default on RDS for PostgreSQL 11 and later),performance_schema.events_statements_summary_by_digeston MySQL. - Tune the top statements first. Move reads to a replica or change the instance class only when the load is legitimate.
Scope and review date: November 2026. This post covers Amazon RDS for MySQL (8.0 and 8.4) and RDS for PostgreSQL (13 and later) DB instances. It does not cover Aurora, whose monitoring differs in places. Metric names, monitoring modes, and CLI syntax were checked against the Amazon RDS User Guide, the Amazon CloudWatch User Guide, and the MySQL and PostgreSQL manuals on 25 November 2026. The commands were not run in a lab, so test them on a non-production instance first.
What is the fastest way to triage high CPU on RDS?
Work from the outside in. Each layer answers one question and tells you whether the next one is worth opening. CloudWatch tells you whether the instance is busy. Enhanced Monitoring tells you whether the database engine is the process using the CPU. Database Insights tells you which statements and wait events make up the load. Then the engine's own statistics tell you why those statements are expensive.
RDS CPU triage, outside in
Each step narrows the question before you open the next tool
Why this order: scaling the instance before step 3 raises the bill and leaves the same query pattern to fill the new vCPUs.
What does CPUUtilization on RDS actually measure?
CPUUtilization in the AWS/RDS namespace is the percentage of CPU in use for the whole DB instance. AWS states that CloudWatch gathers CPU metrics from the hypervisor, while Enhanced Monitoring reads them from an agent on the instance. The two can differ, and the gap is larger on small instance classes. RDS sends metrics to CloudWatch in 1-minute periods, and 1-minute data points are kept for 15 days, according to the RDS CloudWatch overview.
Pull the raw series before you trust a dashboard. Dashboards often show the 5-minute average, which hides short saturation.
aws cloudwatch get-metric-statistics \
--namespace AWS/RDS \
--metric-name CPUUtilization \
--dimensions Name=DBInstanceIdentifier,Value=orders-db \
--start-time 2026-11-11T00:00:00Z \
--end-time 2026-11-12T00:00:00Z \
--period 60 \
--statistics Average Maximum \
--output tableInterpretation: if Average sits at 60% but Maximum hits 100% every few minutes, the instance is saturating in bursts, usually from a batch job, a cron schedule, or a retry storm. If both stay near 100%, the load is sustained, and you should go straight to Database Insights. Compare the timeline with DatabaseConnections and ReadIOPS for the same window: CPU that rises with connections points at connection churn or a traffic spike, while CPU that rises with flat connections points at a plan change or a new query.
aws cloudwatch get-metric-statistics \
--namespace AWS/RDS \
--metric-name DatabaseConnections \
--dimensions Name=DBInstanceIdentifier,Value=orders-db \
--start-time 2026-11-11T00:00:00Z \
--end-time 2026-11-12T00:00:00Z \
--period 300 \
--statistics Maximum \
--output tableInterpretation: DatabaseConnections counts client network connections only. AWS notes that it excludes sessions the engine creates for itself and RDS's own connections, so a low value does not rule out background work.
Is the database engine using the CPU, or something else on the instance?
Enhanced Monitoring answers this. It collects OS metrics at an interval of 1, 5, 10, 15, 30, or 60 seconds, needs an IAM role, and can be turned on without a reboot. The setup page gives the CLI form:
aws rds modify-db-instance \
--db-instance-identifier orders-db \
--monitoring-interval 15 \
--monitoring-role-arn arn:aws:iam::123456789012:role/rds-monitoring-roleInterpretation: the change applies immediately, whatever the apply-immediately setting is. Data goes to the RDSOSMetrics log group in CloudWatch Logs, which keeps it for 30 days by default and bills it as log data, so use 1-second granularity only while you investigate.
In the console, the OS process list view splits CPU into three groups. RDS child processes are the engine, such as mysqld or the postgres backends, with threads nested under the parent. RDS processes are the RDS management agent and AWS monitoring processes. OS processes are the kernel and system processes. If the engine's processes do not account for most of the CPU, the problem is outside your SQL, and that is a case for AWS Support.
Two of the cpuUtilization fields matter most. steal is "the percentage of CPU in use by other virtual machines", and wait is CPU left unused while waiting for I/O. High wait with modest user means the instance is I/O-bound, not CPU-bound, and a bigger instance class will not fix it. You can read the same JSON from the command line. The log stream name is the instance's resource ID.
RID=$(aws rds describe-db-instances --db-instance-identifier orders-db \
--query 'DBInstances[0].DbiResourceId' --output text)
aws logs get-log-events \
--log-group-name RDSOSMetrics \
--log-stream-name "$RID" \
--limit 1 \
--query 'events[0].message' --output text \
| jq '{cpu: .cpuUtilization, load: .loadAverageMinute, vcpus: .numVCPUs,
top: [.processList | sort_by(-.cpuUsedPc) | .[:5][] | {name, cpuUsedPc}]}'Interpretation: compare loadAverageMinute.one with numVCPUs. A load average well above the vCPU count means runnable processes are queuing for CPU. The top array shows which processes own it.
Three CPU views on RDS
Switch views to see where each number comes from and what it can split CPU into
CloudWatch metric
| Question | CloudWatch CPUUtilization |
|---|---|
| Measured from | The hypervisor |
| Finest interval | 1 minute |
| Breaks CPU down by | Nothing: one number per instance |
| Stored in | AWS/RDS metrics |
| Default retention | 1-minute points for 15 days |
Enhanced Monitoring
| Question | Enhanced Monitoring |
|---|---|
| Measured from | An agent on the instance |
| Finest interval | 1 second |
| Breaks CPU down by | user, system, steal, wait, and per process |
| Stored in | RDSOSMetrics log group |
| Default retention | 30 days |
Database Insights
| Question | Database Insights |
|---|---|
| Measured from | Sampled active database sessions |
| Finest interval | 1-second session samples |
| Breaks CPU down by | Wait event, SQL, user, host |
| Stored in | Database Insights, read through the aws pi API |
| Default retention | 7 days free in Standard mode |
Use them together: CloudWatch says when, Enhanced Monitoring says which process, and Database Insights says which SQL. Sources: the Enhanced Monitoring overview and the Database Insights modes table.
Is a T-class instance running out of CPU credits?
On db.t3 and db.t4g, high CPU has a second meaning. The instance class page says RDS configures burstable classes for Unlimited mode, so they "can burst beyond the baseline over a 24-hour window for an additional charge". When CPUCreditBalance reaches zero, the instance does not slow down. It spends surplus credits, tracked in CPUSurplusCreditBalance, and any surplus that earned credits do not pay back shows up in CPUSurplusCreditsCharged and on your bill.
One credit is one vCPU at 100% for one minute. Credit metrics are published every five minutes only, and for periods longer than five minutes AWS says to use Sum rather than Average on CPUCreditUsage.
Reading credit balance and surplus charges
Illustrative output: a db.t4g instance that drained its balance during a nightly job
Read the Minimum column: a credit balance that sits at zero for hours means the workload needs more than the baseline. Metric definitions are in the RDS CloudWatch metrics reference.
The RDS metrics reference repeats one recommendation under every credit metric: use T DB instance classes only for development, test, and other non-production servers. If a production database lives on a T class and its balance keeps hitting zero, move it to an M or R class rather than paying surplus charges every month.
Which SQL is using the CPU in Database Insights?
AWS set the Performance Insights end-of-life for 31 July 2026 and moved its users to CloudWatch Database Insights. The CloudWatch documentation lists two modes. Standard mode analyzes the top contributors to DB load by dimension and keeps 7 days of detailed data at no extra cost. Advanced mode adds per-process OS analysis (which needs Enhanced Monitoring), per-query statistics, slow-query analysis, and on-demand analysis. The underlying Performance Insights API and the aws pi CLI remain, so scripts that query it keep working.
The key chart is DB load, measured in average active sessions, with the Max vCPU line drawn at the instance's vCPU count. The RDS guide puts it this way: if DB load is often above that line and the main wait state is CPU, the CPU is overloaded. If load is above the line but the main wait is I/O or locks, CPU is a symptom, not the cause.
From the CLI, group DB load by wait event and then by tokenized SQL. Save the query to a file first:
[
{ "Metric": "db.load.avg", "GroupBy": { "Group": "db.wait_event", "Limit": 5 } },
{ "Metric": "db.load.avg", "GroupBy": { "Group": "db.sql_tokenized", "Limit": 10 } }
]aws pi get-resource-metrics \
--service-type RDS \
--identifier "$RID" \
--start-time 2026-11-11T09:00:00Z \
--end-time 2026-11-11T10:00:00Z \
--period-in-seconds 60 \
--metric-queries file://cpu-load.jsonInterpretation: the response has one key for total db.load.avg and one per group. A key with "db.wait_event.type": "CPU" that carries most of the total confirms CPU-bound load. The SQL keys return db.sql_tokenized.statement, which is truncated for long statements. To get the full text, pass the ID to aws pi get-dimension-key-details --group db.sql --group-identifier <id> --requested-dimensions statement, as in the AWS CLI examples.
For alarms, the same data reaches CloudWatch as DBLoad, DBLoadCPU, DBLoadNonCPU, and DBLoadRelativeToNumVCPUs. They are published only when the instance has load.
How do I find CPU-heavy queries on RDS for PostgreSQL?
RDS for PostgreSQL 11 and later loads pg_stat_statements by default, according to the RDS PostgreSQL SQL statistics page. You still run CREATE EXTENSION pg_stat_statements; once in the database you query. Then rank statements by total execution time:
SELECT queryid,
calls,
round(total_exec_time::numeric) AS total_ms,
round(mean_exec_time::numeric, 2) AS mean_ms,
rows,
shared_blks_hit,
shared_blks_read,
left(query, 80) AS query
FROM pg_stat_statements
ORDER BY total_exec_time DESC
LIMIT 10;Interpretation: total_exec_time includes time spent waiting, so read it together with the buffer columns. A statement with huge shared_blks_hit and few shared_blks_read is scanning pages that are already in memory, which is pure CPU: a missing index, a sequential scan in a loop, or a bad join order. A statement with millions of calls and a 0.3 ms mean is a chatty application, and the fix is caching or batching, not an index.
For what is running now, sessions that are active with no wait event are on CPU:
SELECT pid, usename, client_addr,
now() - query_start AS runtime,
wait_event_type, wait_event,
left(query, 80) AS query
FROM pg_stat_activity
WHERE state = 'active'
AND backend_type = 'client backend'
AND usename <> 'rdsadmin'
AND pid <> pg_backend_pid()
ORDER BY runtime DESC;Interpretation: the PostgreSQL manual defines a NULL wait_event as "not waiting", so those rows are on CPU. rdsadmin is the account RDS uses for its own management sessions, so it is filtered out. To stop a runaway query, run SELECT pg_cancel_backend(pid);, which the RDS master user can do for sessions it has rights over.
Take the top queryid and run EXPLAIN (ANALYZE, BUFFERS) on a representative statement against a replica or a clone, not on the struggling primary.
How do I find CPU-heavy queries on RDS for MySQL?
On RDS for MySQL, the statement digests live in the Performance Schema. When you create an instance with Database Insights turned on, RDS also turns on the Performance Schema and manages its parameters, and the performance_schema parameter shows a source of System default. Turning the Performance Schema on or off needs a reboot, and automatic management isn't supported on db.t4g.medium. Check it first:
SELECT @@performance_schema;Then rank digests by total latency, with the row counters that usually explain CPU:
SELECT LEFT(DIGEST_TEXT, 80) AS query,
COUNT_STAR AS calls,
FORMAT_PICO_TIME(SUM_TIMER_WAIT) AS total_time,
FORMAT_PICO_TIME(AVG_TIMER_WAIT) AS avg_time,
SUM_ROWS_EXAMINED,
SUM_ROWS_SENT,
SUM_NO_INDEX_USED,
SUM_SORT_ROWS
FROM performance_schema.events_statements_summary_by_digest
ORDER BY SUM_TIMER_WAIT DESC
LIMIT 10;Interpretation: the ratio of SUM_ROWS_EXAMINED to SUM_ROWS_SENT is the quickest CPU signal on InnoDB. A statement that examines 50,000 rows to return 10 is scanning in memory, and a non-zero SUM_NO_INDEX_USED says it did so without an index. Large SUM_SORT_ROWS points at sorts that an index could provide in order. Database Insights reads this same table. AWS warns that the digest table has no eviction policy and stops tracking new statements when full, which Database Insights handles by truncating it only when it manages the Performance Schema.
For what is running now:
SELECT ID, USER, HOST, DB, COMMAND, TIME, STATE,
LEFT(INFO, 80) AS query
FROM performance_schema.processlist
WHERE COMMAND <> 'Sleep'
AND USER NOT IN ('rdsadmin', 'event_scheduler')
ORDER BY TIME DESC;Interpretation: long-running rows with a STATE such as Sending data or executing are the candidates. RDS provides stored procedures for this: CALL mysql.rds_kill_query(id); stops the statement and keeps the connection, and CALL mysql.rds_kill(id); ends the connection. For broader query tuning on RDS MySQL, see MySQL performance optimization for AWS RDS.
Is autovacuum or other background work using the CPU?
Not all CPU comes from application SQL. On RDS for PostgreSQL, autovacuum is on by default, and RDS adds adaptive autovacuum (rds.adaptive_autovacuum, on by default). The RDS autovacuum guide says that when MaximumUsedTransactionIDs reaches autovacuum_freeze_max_age or 500,000,000, whichever is greater, RDS makes autovacuum more aggressive in memory and sends an RDS event. A CPU rise that starts with that event is wraparound prevention, and it should not be stopped.
SELECT p.pid,
now() - a.xact_start AS running_for,
p.relid::regclass AS table_name,
p.phase,
p.heap_blks_scanned, p.heap_blks_total
FROM pg_stat_progress_vacuum p
JOIN pg_stat_activity a USING (pid);Interpretation: one or two workers on large tables are normal. Workers that restart on the same table all day mean dead tuples arrive faster than vacuum clears them. Look at the update pattern on that table and its per-table autovacuum settings, and do not turn autovacuum off.
Check the RDS event log for the same window too. Backups, a Multi-AZ conversion, a storage change, or an engine minor-version patch can each explain a short rise:
aws rds describe-events \
--source-type db-instance \
--source-identifier orders-db \
--duration 1440On MySQL, the equivalent background suspects are the event scheduler, large purge backlogs after long transactions, and replication apply threads on a replica. Each shows up in performance_schema.threads with a non-foreground TYPE.
Should I add a read replica or change the instance class?
Only after the top statements are tuned, and only for the kind of load each option can absorb. A read replica is a read-only copy updated asynchronously. It takes read CPU off the primary only if the application sends reads to the replica endpoint and can tolerate replica lag. RDS does not add replicas automatically, and each replica is billed as a full instance. Write-heavy CPU stays on the primary.
A larger instance class adds vCPUs for any workload, but the modify settings table says downtime occurs during an instance class change. A Multi-AZ deployment reduces that downtime. As of November 2026, the RDS instance class list includes Graviton classes from db.m6g and db.r6g up to the Graviton4 db.m8g and db.r8g and the Graviton5 db.m9g and db.r9g. Which ones you can use depends on engine version and Region, so ask the API first.
Changing the instance class for CPU headroom
Six steps; steps 4 and 5 are the outage window
-
Confirm the target class is offered
Run it in your Region and look for your exact engine version in the list.
aws rds describe-orderable-db-instance-options \ --engine postgres \ --db-instance-class db.r8g.2xlarge \ --query 'OrderableDBInstanceOptions[].EngineVersion' -
Review memory-based parameters
Defaults written with
DBInstanceClassMemory, such asmax_connections, change with the class. Hard-coded values in a custom parameter group do not. -
Take a manual snapshot
A fixed restore point taken just before the change.
aws rds create-db-snapshot \ --db-instance-identifier orders-db \ --db-snapshot-identifier orders-db-pre-resize -
Modify the instance class
Outage startsRun it in a quiet window. Without
--apply-immediately, it waits for the maintenance window.aws rds modify-db-instance \ --db-instance-identifier orders-db \ --db-instance-class db.r8g.2xlarge \ --apply-immediately -
Wait for the instance to be available
Outage endsEnhanced Monitoring returns no data while compute is being scaled.
aws rds wait db-instance-available \ --db-instance-identifier orders-db -
Re-check CPU and top SQL
Compare DB load against the new Max vCPU line. The same top statements on more vCPUs means the tuning work is still due.
Rollback point: modify back to the old class, which costs a second outage. Test Graviton classes on a restored snapshot first, because the processor architecture changes even though the engine does not.
Which alarms catch high CPU before users do?
A CPU alarm alone pages you late and often. Pair it with a load alarm that knows the vCPU count, and on T classes with a credit alarm. The thresholds below are starting points to tune against your own baseline, not AWS recommendations.
aws cloudwatch put-metric-alarm \
--alarm-name orders-db-cpu-high \
--namespace AWS/RDS --metric-name CPUUtilization \
--dimensions Name=DBInstanceIdentifier,Value=orders-db \
--statistic Average --period 60 \
--evaluation-periods 15 --datapoints-to-alarm 10 \
--threshold 85 --comparison-operator GreaterThanThreshold \
--alarm-actions arn:aws:sns:ap-south-1:123456789012:db-oncall
aws cloudwatch put-metric-alarm \
--alarm-name orders-db-load-over-vcpu \
--namespace AWS/RDS --metric-name DBLoadRelativeToNumVCPUs \
--dimensions Name=DBInstanceIdentifier,Value=orders-db \
--statistic Average --period 60 \
--evaluation-periods 10 --datapoints-to-alarm 8 \
--threshold 1 --comparison-operator GreaterThanThreshold \
--treat-missing-data notBreaching \
--alarm-actions arn:aws:sns:ap-south-1:123456789012:db-oncallInterpretation: the first alarm fires when CPU stays above 85% for 10 of 15 minutes, which ignores short bursts. The second fires when active sessions exceed the vCPU count for 8 of 10 minutes, which is the queuing condition the Max vCPU line shows. notBreaching covers the gaps when there is no load and the metric is not published. On a T class, add a third alarm on CPUCreditBalance with a 300-second period, since credit metrics only arrive every five minutes.
Frequently asked questions
Why is my AWS RDS CPU usage high with few connections?
A few sessions can saturate every vCPU if each runs a query that scans many rows in memory. Check DB load grouped by SQL in Database Insights, then compare rows examined with rows returned in pg_stat_statements or events_statements_summary_by_digest. Also check for autovacuum, the event scheduler, or a replica's apply threads, because DatabaseConnections does not count sessions the engine or RDS creates.
Is Performance Insights still available on Amazon RDS?
The Performance Insights console experience reached end of life on 31 July 2026, and AWS moved its users to CloudWatch Database Insights. Standard mode keeps 7 days of detailed data at no extra cost and still breaks DB load down by SQL and wait event. The Performance Insights API and the aws pi CLI commands continue to work, with their cost billed under Database Insights.
Why do CloudWatch and Enhanced Monitoring show different CPU on RDS?
CloudWatch reads CPU from the hypervisor, and Enhanced Monitoring reads it from an agent inside the instance. The hypervisor does a small amount of work of its own, so the numbers differ, and AWS says the gap can be larger on small instance classes. Use CloudWatch for alarms and trends, and Enhanced Monitoring for per-process detail and the steal and wait breakdown.
Does a db.t3 or db.t4g RDS instance slow down when CPU credits run out?
No. RDS runs burstable classes in Unlimited mode, so the instance keeps running above baseline by spending surplus credits. Surplus credits that earned credits do not pay back are charged, and they appear in CPUSurplusCreditsCharged. A balance that keeps reaching zero means the workload needs a fixed-performance M or R class, which AWS recommends for production anyway.
Key takeaways
- Read
CPUUtilizationasMaximumat a 60-second period, and confirm with the Enhanced Monitoring process list that the engine owns the CPU. - High
waitor I/O wait events mean the instance is I/O-bound, and more vCPUs will not help. - On T classes, a credit balance at zero means surplus charges in Unlimited mode. Move production off T classes.
- Database Insights replaced the Performance Insights console on 31 July 2026. DB load above Max vCPU with a CPU wait is the overload signal, and
aws pi get-resource-metricsstill returns it by SQL. - Tune the top digests in
pg_stat_statementsor the Performance Schema first. Then offload reads to a replica or change the class, with a snapshot and a rollback plan.
Get help with RDS CPU problems from JusDB
JusDB's Amazon RDS for MySQL team and Amazon RDS for PostgreSQL team can review an instance that is running hot: the top statements by DB load, index and query fixes, autovacuum settings, and whether a replica or a different instance class is the right next step.
We can also help plan and run an instance class change, including a move to Graviton, and set up the CloudWatch alarms and Database Insights mode that fit your fleet.
Related reading
- MySQL High CPU Usage: Find the Cause and Fix It
- PostgreSQL High CPU Usage: How to Find the Query and Fix It
- MySQL performance optimization for AWS RDS
- Mastering AWS RDS max connections for MySQL and PostgreSQL
- RDS Multi-AZ vs read replicas: HA and scaling patterns
- AWS documentation: Monitoring DB load with CloudWatch Database Insights on Amazon RDS