Why it matters
Serverless is a common default for new Aurora clusters, but for steady workloads its per-ACU price is higher than a provisioned instance of the same capacity.How nOps finds it
nOps reads the last 30 complete days of hourly Serverless v2 ACU billing. An instance is flagged when it was billed in at least 95% of the 720 hours and its 10th-percentile hour used at least half the ACUs of its 95th-percentile hour. The target is the cheapest db.r6g, db.r7g or db.t4g class with at least 2 GiB of memory per ACU of its busiest hour (db.t4g only when that hour is 4 ACUs or less). The saving is the on-demand cost of the last 7 days, scaled to a month, times one minus the instance’s list price for the week divided by the list price of the ACUs it used. Instances mostly covered by commitments or credits, and savings under $5 a month, are left out.Before you start
Permission to add, fail over and remove cluster instances (rds:CreateDBInstance, rds:FailoverDBCluster, rds:DeleteDBInstance).
How to implement
- Check the instance’s peak ACU in CloudWatch (ServerlessDatabaseCapacity) at minute level, not just hourly.
- Add a provisioned instance of the recommended class to the cluster (
aws rds create-db-instance --db-cluster-identifier CLUSTER --db-instance-identifier NEW_ID --db-instance-class NEW_CLASS --engine ENGINE). - When it is available, fail over to it (
aws rds failover-db-cluster --db-cluster-identifier CLUSTER --target-db-instance-identifier NEW_ID) if the serverless instance is the writer. - Delete the serverless instance once the provisioned one is serving traffic.
- Update Terraform or CloudFormation to match.
Risks and considerations
- A provisioned instance does not scale up for sudden spikes. nOps sizes it from hourly averages, so check short peaks first.
- The failover causes a brief interruption for connected clients.
- To roll back, add a Serverless v2 instance again and fail over to it.
FAQs
Why 2 GiB per ACU?
Why 2 GiB per ACU?
One Aurora capacity unit is about 2 GiB of memory, so the provisioned instance needs that much memory for each ACU of the busiest hour.