DEV Community

Atsushi Suzuki
Atsushi Suzuki

Posted on

1 1

Caught in a Cost Optimization Trap: Aurora Serverless v2 with RDS Proxy

I was using a db.t3.medium Aurora instance for my development environment, but with CPU utilization hovering around 10%, it was significantly underutilized.

After comparing instance costs, I discovered that if the Aurora Capacity Unit (ACU) usage stayed near the minimum capacity (0.5), Aurora Serverless v2 would be more cost-effective. So, I decided to switch to Serverless v2.

Instance Pricing (Aurora Standard, Tokyo):

  • db.t3.medium: $0.125/hour
  • Serverless v2: $0.15/ACU

Unexpected Cost Increase

After switching instances, I monitored the ServerlessDatabaseCapacity metric to track ACU usage. Initially, it spiked close to 2 ACUs but soon stabilized around 0.5 ACU, just as expected.

ServerlessDatabaseCapacity Graph

"Great, the costs should be lower!" I thought, but when I checked Cost Explorer, the daily cost had mysteriously increased by about $7.

Cost Explorer Graph

Identifying the Cause

Grouping costs by "Usage Type" in Cost Explorer revealed that APN1-RDS:Proxy-ASv2-Usage accounted for nearly $10/day.

RDS Proxy Cost Breakdown

Before switching to Serverless v2, this item appeared as APN1-RDS:ProxyUsage. After the change, it showed up as APN1-RDS:Proxy-ASv2-Usage.

Checking the official documentation, I found that RDS Proxy for Aurora Serverless v2 incurs a minimum charge for 8 ACUs.

RDS Proxy Pricing Screenshot

Source: Amazon Relational Database Service Proxy pricing

At the time, we were transitioning from a "Lambda + RDS Proxy + Aurora" setup to an "ECS + Aurora" architecture and had kept the RDS Proxy running. This was the root cause of the cost spike.

Cost Comparison

  • APN1-InstanceUsage:db.t3.medium: ~$3.00/day
  • APN1-Aurora:ServerlessV2Usage: ~$2.21/day
  • APN1-RDS:Proxy-ASv2-Usage: ~$10.00/day

Comparing instance costs alone, Serverless v2 was about $1 cheaper. However, after removing the RDS Proxy and running Aurora Serverless v2 independently, we optimized the costs significantly.

Bonus Tip: Further Cost Optimization with Aurora Versions

We were using Aurora MySQL version 3.07.0, where the minimum ACU is 0.5. Starting from version 3.08.0, the minimum ACU can be set to 0, allowing for even greater cost savings during idle periods.

Learn More: How Aurora Serverless v2 works

API Trace View

Struggling with slow API calls? 🕒

Dan Mindru walks through how he used Sentry's new Trace View feature to shave off 22.3 seconds from an API call.

Get a practical walkthrough of how to identify bottlenecks, split tasks into multiple parallel tasks, identify slow AI model calls, and more.

Read more →

Top comments (1)

Collapse
 
farmer_sneed_b58f87019ef1 profile image
Farmer Sneed

Good read. ECS with Aurora V2 with the new 0 ACU idle seems very promising. Thank you for this report.

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more