RDS CPU at 100%

Performance Insights, slow query log, EXPLAIN, missing indexes, autovacuum, and connection storms.

Overview

Overview

RDS CPU at 100% slows every query proportionally and can eventually make the instance unresponsive. The root cause is almost always one of four things: an expensive query, a traffic spike, lock contention or autovacuum on bloated PostgreSQL tables. A fifth, the connection storm, shows up when many clients reconnect at the same moment.

The path from symptom to fix is short. Performance Insights shows the database load broken down by wait event. Its Top SQL tab names the offending query. EXPLAIN ANALYZE shows that query's execution plan. The fix follows from what the plan shows: an index, a fresh ANALYZE, autovacuum tuning or connection pooling.

Key concepts

  • Performance Insights
  • EXPLAIN ANALYZE
  • pg_stat_statements
  • Autovacuum
  • RDS Proxy

Interview questions

  • Your RDS CPU is at 100%. Walk through how you identify and fix the root cause.

Sign up free to read the full topic

More Troubleshooting topics

Start free on Cariara · Coding problems · System design studio