Technical Guide

Idle RDS Instances

How to identify idle RDS database instances? RDS instances with zero database connections over 24 hours are consuming compute costs without serving any workloads and can be safely stopped or terminated.

2 min read
High impact optimization

Why This Matters

Idle RDS instances are among the most expensive forms of AWS waste. Unlike EC2 instances, RDS includes managed service costs, backups, and monitoring - meaning even small instances cost significantly more. Zero database connections indicates the instance serves no purpose.

Common causes:

  • Development databases that are no longer actively used
  • Testing instances that weren't cleaned up after projects
  • Backup databases that were promoted but original wasn't decommissioned
  • Legacy applications that were migrated but databases left running

How to Identify Idle RDS Instances

AWS Saver flags RDS instances as idle when they meet these criteria:

  1. Zero database connections averaged over 24 hours
  2. Instance status is 'available' (running and accessible)
  3. Aged over 7 days (avoids flagging new deployments)
  4. Monthly cost above $50 (meaningful savings threshold for RDS)

How to Fix Idle RDS Instances

Step 1: Find available RDS instances

aws rds describe-db-instances \
  --query 'DBInstances[?DBInstanceStatus==`available`].[DBInstanceIdentifier,DBInstanceClass,Engine,InstanceCreateTime]'

Step 2: Check database connections over 14 days

aws cloudwatch get-metric-statistics \
  --namespace AWS/RDS \
  --metric-name DatabaseConnections \
  --dimensions Name=DBInstanceIdentifier,Value=your-db-instance \
  --statistics Average \
  --start-time $(date -u -d '1 day ago' +%Y-%m-%dT%H:%M:%SZ) \
  --end-time $(date -u +%Y-%m-%dT%H:%M:%SZ) \
  --period 3600

Step 3: Create final snapshot (recommended)

aws rds create-db-snapshot \
  --db-instance-identifier your-db-instance \
  --db-snapshot-identifier manual-snapshot-before-stop-$(date +%Y%m%d)

Step 4: Stop database instance (reversible)

aws rds stop-db-instance --db-instance-identifier your-db-instance

Step 5: Delete if truly unused (after 30 days stopped)

aws rds delete-db-instance \
  --db-instance-identifier your-db-instance \
  --final-db-snapshot-identifier final-snapshot-$(date +%Y%m%d) \
  --skip-final-snapshot false

Prevention Tips

Use scheduled start/stop: Configure development databases to automatically stop during off-hours using Lambda functions.

Tag resources properly: Use consistent tagging for environment (dev/test/prod) to track database lifecycle and ownership.

Set up monitoring: Create CloudWatch alarms for connection counts to catch idle databases early.

Implement lifecycle policies: Establish clear retention and cleanup policies for non-production databases.

Automation Available

Skip the manual work. AWS Saver automatically monitors RDS instances using the same zero-connection and 24-hour analysis criteria.

Connection monitoring - Tracks DatabaseConnections metric over 24-hour periods

Conservative thresholds - Only flags instances aged over 7 days and above $50/month cost

CPU analysis - Also detects oversized RDS instances with under 20% CPU utilization

Cost impact calculation - Shows exact monthly waste per idle instance

Ready to Optimize Your AWS Costs?

Skip the manual work. Get automated RDS optimization across your entire AWS infrastructure.

60-second setup • No credit card required • Immediate results

Automation Available

Skip the manual work. AWS Saver automatically detects and prioritizes this issue across your entire AWS infrastructure.

60-second setup • No credit card required

Manual vs Automated

Manual Process

  • • Run commands across all regions
  • • Set up monitoring and alerts
  • • Repeat regularly for new issues
  • • Scale across multiple accounts

AWS Saver Automation

  • • Continuous multi-region scanning
  • • Automatic cost impact analysis
  • • Real-time alerts and notifications
  • • Cross-account visibility