Q: Your RDS instance is using 100% CPU. What do you do?
1. Identify the culprit — use RDS Performance Insights to find the top SQL queries consuming CPU.
Want to master this scenario in a live sandbox? KodeKloud's PostgreSQL Database Administration & High Availability Course covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "In a previous role, our monitoring paged me for a similar incident across our AWS VPC infrastructure. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix."
Initial Diagnostics & Root Cause Analysis
- Identify the culprit — use RDS Performance Insights to find the top SQL queries consuming CPU.
- Look for slow queries — enable slow query log. Check for missing indexes.
- Check for lock contention — queries waiting for locks show high CPU wait.
- Scale vertically — stop the RDS instance, change instance class to a larger one (more CPU), restart.
Remediation & Permanent Safeguards
Execute the resolution runbook and verify workload health:
- Read replicas — offload read queries to a read replica. Add a read replica and point your app's read traffic there.
- Query optimization — add indexes for slow queries found in Performance Insights.
- Connection pool — if too many connections are opening/closing rapidly, it causes CPU overhead. Use RDS Proxy.
- Identify the culprit — use RDS Performance Insights to find the top SQL queries consuming CPU.
- Look for slow queries — enable slow query log. Check for missing indexes.
- Check for lock contention — queries waiting for locks show high CPU wait.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Applying exclusive-lock DDL table migrations on live production databases during peak traffic windows when configuring instance using 100% DDL migrations that acquire an exclusive table lock block all concurrent queries, queuing connections until the database connection pool exhausts.
- Allowing high-frequency queries to trigger full table scans without appropriate composite indexing when configuring instance using 100% Sequential table scans saturate database CPU and disk I/O, evicting frequently queried data from the buffer cache and causing cascading timeouts.
- Disabling referential integrity constraints during bulk ETL imports without post-import consistency validation when configuring instance using 100% Skipping relational consistency checks risks introducing orphaned records and referential integrity violations into production tables.
- Relying on database snapshot backups that have never been verified through automated restoration drills when configuring instance using 100% Backups that have never been tested with automated restore verification frequently fail during real disaster recovery scenarios.