DEV Community

Atsushi Suzuki for AWS Community Builders

Posted on • Edited on

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

Top comments (2)

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.

Collapse
 
wesleycheek profile image
Wesley Cheek • Edited

Thank you for pointing this out. It's ridiculous that they charge so much more for Proxy for Serverless v2.

I'm in the same boat, so let's do some simple comparisons

Serverless

Serverless v2:
(24 hrs/day) * (30 days/month) * ($0.11/ ACU hr) = $108/(ACU month)

RDS Proxy for Serverless v2:
(24 hrs/day) * (30 days/month) * ($0.025/ACU hr) * 8 ACU = $144 /month

So if our serverless instance sits at 0.5 ACU all the time:

0.5 ACU * ($108/(ACU month) = $54/month for the instance
$54 + $144 = $198 / month total for smallest serverless instance WITH proxy
(Also keep in mind that the serverless database will never sleep due to the consistent connection to RDS Proxy)

Provisioned t3.medium instance

(24 hrs/day) * (30 days/month) * ($0.125/hr) = $90/month

RDS Proxy for provisioned instances
(24 hrs/day) * (30 days/month) * ($0.018/hr) = $12.96/month

So our total with provisioned instance + proxy is
$90 + $12.96 = $102.96 / month

If RDS proxy is a necessity for your system, it is almost double to use it with serverless! Ridiculous.