RDS free storage is dropping steadily and will run out in 5 days. What do you do?
BeginnerScenarioData and databases
Answer
Situation read → A full disk takes the database into storage-full state and it stops accepting writes. Buy time first, then find out what's growing.
What I'd do →
- Enable storage autoscaling with a sensible maximum (or increase allocated storage; it's online for most engines).
aws rds modify-db-instance --db-instance-identifier prod-db --max-allocated-storage 2000 --apply-immediately
- Find the growth: table and index sizes, and in PostgreSQL also dead tuples (bloat), WAL kept by an inactive replication slot, and temp files.
SELECT slot_name, active, pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) AS retained
FROM pg_replication_slots;
- Fix the cause: drop the abandoned slot, tune autovacuum, archive old data, or set log retention.
- Alert on
FreeStorageSpacebelow 20% and on its rate of decrease.
Why → Note that RDS storage can only grow, not shrink, so fix the cause instead of adding space forever.
Interview tip → An inactive replication slot (often from a removed DMS task) is a classic hidden cause; mention it.
More on Data and databases
A release needs to rename a column that the running app reads and writes. How do you do it with zero downtime?IntermediateHow do you prove your database backups actually work?IntermediateDesign backups for an RDS PostgreSQL database with RPO of 5 minutes and RTO of 1 hour, including a region failure.AdvancedYour migrations run in an init container and two pods ran them at the same time during a deploy, leaving the schema half-applied. How do you fix the approach?IntermediateUpgrade RDS PostgreSQL from 13 to 17 with minimal downtime. How?AdvancedYou need to add an index and a column to a 500-million-row table that's written to constantly. How do you avoid locking it?Advanced