- Newest
- Most votes
- Most comments
Aurora Serverless v2 now supports scaling to 0 ACUs (automatic pause and resume), but there are several reasons why your database might not be scaling down as expected:
-
Version Requirements: The ability to scale to 0 ACUs is only supported in specific versions of Aurora PostgreSQL (13.15+, 14.12+, 15.7+, and 16.3+) and Aurora MySQL (3.08+). Make sure your database is running a supported version.
-
Configuration: You need to explicitly set the minimum capacity to 0 ACUs for your cluster. For existing clusters, you must update to a supported version and then modify this setting.
-
Database Parameters: Certain PostgreSQL DB parameters can prevent scaling down. For example, non-default values for parameters like
max_connections,max_locks_per_transaction, ortrack_activity_query_sizemight prevent reaching the minimum ACU. -
Background Processes: Internal operations such as PostgreSQL autovacuum or jobs scheduled through the
pg_cronextension might be running. These processes can prevent the database from scaling down completely. -
Connection Activity: Aurora begins pausing the instance only when the specified delay period passes with no connections to the instance. Any active connections will prevent scaling to 0.
-
Specific Configurations: Certain configurations prevent auto-pause, including when using logical replication, binlog replication, Amazon RDS Proxy, or when the cluster is part of an Aurora global database.
To troubleshoot:
- Check if you're using a supported version
- Verify your minimum ACU setting is set to 0
- Review any custom parameter settings
- Check for background processes using pg_stat_activity (though you mentioned this is empty)
- Consider increasing the auto-pause timeout interval
If all these are configured correctly and the issue persists, it might be an infrastructure issue as AmazonQ suggested, which would require AWS Support assistance.
Sources
Introducing scaling to 0 capacity with Amazon Aurora Serverless v2 | AWS Database Blog
Amazon Aurora Serverless v2 supports scaling to zero capacity - AWS
Understanding how certain database parameters impact scaling in Amazon Aurora Serverless v2 | AWS Database Blog
Scaling to Zero ACUs with automatic pause and resume for Aurora Serverless v2 - Amazon Aurora
Custom parameter settings had logical replication switched on.
The bot's checklist:
- Check if you're using a supported version: 16.6 ✅
- Verify your minimum ACU setting is set to 0: ✅
- Review any custom parameter settings: ❌ (see below)
- Check for background processes using pg_stat_activity (though you mentioned this is empty): ✅
- Consider increasing the auto-pause timeout interval: 5 minutes was enough ✅
Our databases and parameter settings have been upgraded for many years, starting at Postgres 9. At some point during that upgrade process rds.logical_replication had been engaged with the following parameters:
- max_logical_replication_workers 110
- max_replication_slots 110
- max_wal_senders 115
- max_worker_processes 115
- rds.logical_replication 1
We do not use Postgres Logical Replication. You can see what custom parameters you have by going to RDS -> Parameter Groups -> Choose Group -> Click on "Source" column header until you Modified (might need to click twice to sort descending). Using the default database parameters and rebooting the instance [WARNING DOWNTIME!] switched off the replication and now the ACU goes to 0.
Relevant content
asked a year ago
- AWS OFFICIALUpdated 7 months ago
