Cloud Databases

RDS Cost Optimization: Right-Sizing, Reserved Instances, and Storage Control

Cut Amazon RDS costs with right-sizing, Reserved Instances, Aurora Serverless v2, and snapshot lifecycle management. Practical techniques with real savings estimates.

JusDB Team
April 2, 2025
5 min read
156 views

Amazon RDS can become one of the largest line items in your AWS bill. This guide covers practical techniques to cut RDS costs without sacrificing performance.

Right-Size Your Instance

The most impactful cost lever is instance size. Most teams over-provision by 2-4x.

sql
-- PostgreSQL: check average CPU and memory pressure
SELECT now() - pg_postmaster_start_time() AS uptime,
       count(*) AS active_connections
FROM pg_stat_activity
WHERE state = 'active';

Use CloudWatch metrics to review CPU, FreeableMemory, and DatabaseConnections over 2 weeks. If CPU stays under 30% and FreeableMemory stays above 25%, downsize one instance class.

Reserved Instances vs On-Demand

  • On-Demand: Pay per hour, no commitment — use for dev/test
  • 1-year Reserved: ~40% savings for steady workloads
  • 3-year Reserved: ~60% savings for long-lived production instances
  • Savings Plans: Flexible commitment across instance families
Tip: Use the AWS Cost Explorer Reserved Instance recommendation tool. It analyzes your last 30 days of usage and recommends the optimal RI purchase.

Aurora Serverless v2 for Variable Workloads

text
Aurora Serverless v2 scales in 0.5 ACU increments
Minimum: 0.5 ACU (~1 GB RAM)
Maximum: 128 ACU

Cost: ~$0.12/ACU-hour (us-east-1)
vs db.r6g.large: ~$0.24/hour

Best for: workloads with >3x peak-to-trough ratio

Storage Cost Control

sql
-- Find top 10 largest tables (PostgreSQL)
SELECT schemaname, tablename,
       pg_size_pretty(pg_total_relation_size(schemaname||'.'||tablename)) AS total_size
FROM pg_tables
WHERE schemaname NOT IN ('pg_catalog','information_schema')
ORDER BY pg_total_relation_size(schemaname||'.'||tablename) DESC
LIMIT 10;

RDS storage auto-scaling grows but never shrinks. Implement data archival and partition pruning for time-series tables to control storage growth.

Multi-AZ: When You Need It

Multi-AZ roughly doubles your instance cost. Only enable it where downtime is unacceptable:

  • Enable: Production OLTP databases
  • Disable: Dev, staging, read replicas, analytics instances

Snapshot Lifecycle Management

bash
# Delete automated snapshots older than 7 days via AWS CLI
aws rds describe-db-snapshots --snapshot-type manual \
  --query 'DBSnapshots[?SnapshotCreateTime<`2025-03-01`].DBSnapshotIdentifier' \
  --output text | xargs -I {} aws rds delete-db-snapshot --db-snapshot-identifier {}

Key Takeaways

  • Right-sizing instances is the highest-ROI cost action — review CloudWatch over 2 weeks
  • 1-year Reserved Instances save ~40% for steady production workloads
  • Aurora Serverless v2 is cost-effective for workloads with high peak-to-trough variance
  • Disable Multi-AZ on non-production instances to halve those costs

JusDB Can Help

JusDB performs RDS cost audits that typically identify 30-50% savings opportunities. Talk to our cloud database team.

Share this article

JusDB Team

Official JusDB content team