RDS status shows `storage-full` and writes fail.
IntermediateTroubleshootingRDS, Aurora and DynamoDB
Answer
Likely causes → FreeStorageSpace reached zero. Common reasons: growing tables, unvacuumed bloat, a large temp sort, binlogs or WAL kept by a stalled replication slot, or verbose logs.
Diagnose →
aws cloudwatch get-metric-statistics --namespace AWS/RDS --metric-name FreeStorageSpace \
--dimensions Name=DBInstanceIdentifier,Value=mydb --statistics Minimum --period 300 \
--start-time $(date -u -d '-1 day' +%FT%TZ) --end-time $(date -u +%FT%TZ)
psql -c "select slot_name, active, pg_size_pretty(pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)) from pg_replication_slots;"
Fix →
- Add storage now:
aws rds modify-db-instance --db-instance-identifier mydb --allocated-storage 500 --apply-immediately - Drop stale replication slots, and vacuum or clean up data
- Turn on storage autoscaling:
--max-allocated-storage 1000
Prevent → Alarm on FreeStorageSpace below 20%, turn on autoscaling, and alarm on OldestReplicationSlotLag / TransactionLogsDiskUsage.
More on RDS, Aurora and DynamoDB
The app cannot connect to RDS: `psql: error: connection to server at "mydb.abc.us-east-1.rds.amazonaws.com" (10.0.3.12), port 5432 failed: Connection timed out`.Beginner`FATAL: password authentication failed for user "postgres"` and nobody knows the master password.Beginner`FATAL: no pg_hba.conf entry for host "10.0.1.25", user "app", database "orders", no encryption`.IntermediateApp logs show `FATAL: remaining connection slots are reserved for non-replication superuser connections` (or MySQL `ERROR 1040 (HY000): Too many connections`).IntermediateA read replica's `ReplicaLag` keeps growing and reports show stale data.IntermediateAfter a Multi-AZ failover, some app servers keep failing with connection errors for 10+ minutes while others recover in a minute.Advanced