- Newest
- Most votes
- Most comments
Hi there.
From Serverless documentation, if any "database connections are requested when an Aurora Serverless DB cluster is paused, the DB cluster automatically resumes and services the connection requests", so I'd recommend checking not only that the DatabaseConnections CW metric is zero (which indicates no persistent connections), but also that the ConnectionAttempts CW metric is zero for longer than the SecondsUntilAutoPause value (15 minutes in your setup). Any connection request/attempt within the SecondsUntilAutoPause time frame resets the AutoPause counter.
If ConnectionAttempts is greater than zero at any point in time and you're not sure where it comes from, I'd then recommend enabling audit for the CONNECT event on Aurora Advanced Audit settings for your cluster, and looking into the logged events in the CW Logs log group when it happens again after enabling audit.
I hope this helps. If you'd like or need a more detailed investigation into your cluster, I'd recommend opening a technical case with AWS Support, as they'll be able to work with you through it, step by step.
Hello!
Good question. You're right on the configuration. You cannot have the minimum capacity set to less than 1.
Check out the option to "Pause compute capacity after consecutive minutes of inactivity". Default is 5 minutes, but you can configure this to your needs: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.how-it-works.html#aurora-serverless.how-it-works.pause-resume.
For example, if you using CloudFormation - make sure the AutoPause is set to true.
"ScalingConfiguration" : {
"AutoPause" : true,
"MinCapacity" : 4,
"MaxCapacity" : 32,
"SecondsUntilAutoPause" : 1000
}
Another thing to pay attention to: if autoscaling doesn't find a scaling point before timing out, Aurora will keep the cluster at the current capacity. To change this behavior, you can select the Force the capacity change option as well. Check that at the ForceApplyCapacityChange property. More information here: https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless.how-it-works.html#aurora-serverless.how-it-works.timeout-action
Thanks for the response. In my original post, I noted that I have enabled "scale to 0 ACUs when cluster is idle", which is under the "pause after inactivity" section of my configuration. I shouldn't need to (nor want to) enable "force capacity change", since there are no db connections to my database. Here is the relevant section of my config, as retrieved from
aws rds describe-db-clusters
"Capacity": 1, "EngineMode": "serverless", "ScalingConfigurationInfo": { "MinCapacity": 1, "MaxCapacity": 64, "AutoPause": true, "SecondsUntilAutoPause": 900, "TimeoutAction": "RollbackCapacityChange", "SecondsBeforeTimeout": 120 },
The database doesn't seem to ever want to scale down past 1 though.
My recent billing statement for December 2021 shows that RDS is not scaling down at all over the course of the month:
Amazon Relational Database Service for Aurora MySQL $44.42
$0.06 per Aurora Capacity Unit hour running Amazon Aurora MySQL Serverless740.341 ACU-Hr $44.42
USD 0.021 per GB-month of backup storage exceeding free allocation for Aurora MySQL0.169 GB-Mo $0.00
Relevant content
- Accepted Answerasked 8 months ago
- asked 4 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 3 years ago
You solved the mystery! The ConnectionAttempts metric was the key. It was keeping the ACUs from scaling down, and the source was an NLB's health check on the target group containing the database. Once I removed the target group from the NLB (it was just for debugging anyways), the ACUs scaled down to 0. Thank you!