Skip to content

Aurora Serverless v2 never scales down to minimum ACU floor — persistent write pressure from WordPress keeping cluster warm 24/7

0

Background

We run an Aurora Serverless v2 cluster (MySQL 8.4, single writer instance, no reader) in eu-west-1 consolidating 13 schemas. The cluster serves a mix of ECS Fargate applications and two WordPress EC2 instances. Our minimum ACU is set to 0.5 and maximum to 4.

The Problem

Over a 14-day observation period, our cluster has never once reached the 0.5 ACU floor, despite having very low user traffic. The minimum observed ACU was 0.985, and the average was 1.433 — meaning we are paying approximately 2.86x the minimum possible ACU cost around the clock.

CloudWatch metrics (14-day window):

MetricValue
ServerlessDatabaseCapacity min0.985 ACU
ServerlessDatabaseCapacity avg1.433 ACU
ServerlessDatabaseCapacity max2.077 ACU
Hours at 0.5 floor0 / 336 (0%)
DatabaseConnections min (3am)6–9
VolumeWriteIOPs avg/sec4,600–7,900

Root Cause Investigation

We identified two contributing factors:

1. Persistent idle connections from ECS connection pools

Our ECS Fargate services (Laravel, Node.js) maintain connection pools that never fully close. With wait_timeout at engine-default (28,800 seconds = 8 hours), Aurora sees 6–9 open connections at all times — even at 3am with zero user traffic. Aurora appears to treat persistent connections as a signal to stay warm above the floor.

Fix applied: Set wait_timeout = 300 and interactive_timeout = 300 on the cluster parameter group (ApplyMethod: immediate). Connections now close after 5 minutes of inactivity.

2. WordPress wp_options autoload write pressure

Our two WordPress sites have severe wp_options autoload bloat — 507,491 autoloaded rows totalling ~452 MB across three schemas (WordPress), compared to a healthy site's ~300 rows / 1.5 MB. This causes:

  • 4,600–7,900 write operations per second, 24/7
  • WP-Cron firing on every page request, triggering continuous write-back loops
  • Aurora's InnoDB engine flushing the redo log on every commit (innodb_flush_log_at_trx_commit = 1, default)

This write pressure appears to be the dominant factor keeping ACU elevated — Aurora cannot scale down when it is continuously processing thousands of writes per second.

Fix in progress: WordPress engineer is cleaning up autoload bloat. We also attempted to set innodb_flush_log_at_trx_commit = 2 to reduce per-commit flush cost, but this is blocked by innodb_trx_commit_allow_data_loss = 0 which requires a cluster reboot to change first.

Questions

  1. Does Aurora Serverless v2 use active write IOPs as a signal to prevent scaling down to the ACU floor? We understand connections keep the cluster warm, but we want to confirm whether write throughput independently prevents floor scaling — or whether fixing the connection issue alone will be sufficient.

  2. After setting wait_timeout = 300, how long does it take for Aurora Serverless v2 to begin scaling toward the floor? Is there a cooldown period, or does it respond within minutes once connections drop to zero?

  3. Is there a recommended approach for innodb_flush_log_at_trx_commit on Aurora Serverless v2? The AWS documentation notes that Aurora's distributed storage provides durability independently of the MySQL flush mechanism. Is it safe to set innodb_trx_commit_allow_data_loss = 1 and innodb_flush_log_at_trx_commit = 2 on Aurora Serverless v2, given that the storage layer already handles durability?

  4. Is there a way to observe what is preventing Aurora Serverless v2 from scaling to the floor in real time? We have Performance Insights enabled (7-day retention) but it does not expose the ACU scaling decision logic. Is there a CloudWatch metric or event that indicates why the cluster is not scaling down?

Environment

DetailValue
EngineAurora MySQL 8.4 (aurora-mysql 8.4.mysql_aurora.8.4.7)
ModeServerless v2
Min ACU0.5
Max ACU4
Instances1 writer, 0 readers
Regioneu-west-1
Schemas13 (consolidated)
Workload15 ECS Fargate (Laravel, Node.js, Python, Next.js) + 3 WordPress EC2s
Performance InsightsEnabled, 7-day retention

Notes Before Posting

  • Remove specific account/region details if preferred
  • The innodb_trx_commit_allow_data_loss question is the most technically interesting — likely to get a good response
  • Tag with Cost Optimization to attract the right audience
  • Consider cross-posting to the Aurora community forum
2 Answers
0

Yes, Aurora Serverless v2 uses active workload as a signal to prevent scaling down. Background processing, administrative tasks, and continuous write activity can all prevent the cluster from reaching minimum capacity. The persistent write pressure you're observing from WordPress—4,600 to 7,900 write operations per second—is almost certainly keeping your cluster above the floor, independent of connection count.

Regarding your specific questions:

Write IOPs and scaling behavior: Aurora Serverless v2 continuously tracks resource utilization including CPU, memory, and I/O activity. High write throughput requires compute resources to process those operations, which prevents scaling down. Fixing the connection timeout alone will likely not be sufficient if the write pressure continues at current levels. You need to address both the connection pooling issue and the WordPress autoload bloat to see meaningful scaling improvements.

Scaling response time after configuration changes: Aurora Serverless v2 is designed to scale with minimal overhead and can respond relatively quickly to workload changes. However, there isn't a published specific timeframe. The cluster will scale down incrementally (in 0.5 ACU steps) as resource utilization decreases. Once your connections drop and write activity subsides, you should see scaling begin within minutes to hours, but the exact timing depends on how quickly the workload actually decreases.

InnoDB flush configuration: Aurora's architecture does provide durability through its distributed storage layer with six copies across three Availability Zones. However, modifying innodb_flush_log_at_trx_commit and related parameters requires careful consideration of your specific durability requirements and workload characteristics. These are capacity-related parameters that Aurora handles differently during scaling. Before making changes, ensure your new maximum capacity can support any custom parameter values you've set—incompatible configurations can prevent scaling and may be automatically rolled back.

Observing scaling decisions: To track actual ACU usage and identify scaling issues, monitor the ServerlessDatabaseCapacity, ACUUtilization, CPUUtilization, and FreeableMemory CloudWatch metrics. Configure CloudWatch alarms to receive proactive alerts. If ACUUtilization and CPUUtilization approach 100%, your cluster has insufficient maximum capacity. However, CloudWatch doesn't expose the internal scaling decision logic directly. Performance Insights can help identify what workload is consuming resources, but won't tell you explicitly why scaling didn't occur.

Additional recommendations: Consider using Amazon RDS Proxy for connection pooling with retry logic and exponential backoff to reduce connection pressure. Regularly optimize your database queries and run maintenance commands. For your WordPress workload specifically, cleaning up the autoload bloat should significantly reduce write pressure. You might also consider whether stopping and starting the cluster during known low-usage periods could provide cost savings for your development or test environments, though this causes downtime and may not be appropriate for production.

The combination of persistent connections and continuous write activity is preventing your cluster from scaling down. Address both issues systematically and monitor the CloudWatch metrics to verify improvement.
Sources
Troubleshoot scaling issues for Aurora Serverless v2 | AWS re:Post
How Aurora serverless works - Amazon Aurora
Requirements and limitations for Aurora serverless - Amazon Aurora

answered 2 months ago

0

Hello.

Aurora Serverless v2 scales by evaluating aggregate resource usage—collectively termed "load"—that encompasses not only CPU but also memory, network, internal database processing, and Aurora management tasks.
AWS explicitly states that capacity may not always scale down to the minimum level, even when there is no load.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.how-it-works.html

If the features described in the following document are enabled, resource usage may increase, and the system may fail to scale down.
https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/aurora-serverless-v2.setting-capacity.html#aurora-serverless-v2.troubleshooting

Certain features can increase resource usage and prevent the database from scaling down to minimum capacity. These features include the following:

  • Aurora global databases
  • Exporting CloudWatch Logs
  • Enabling pg_audit on Aurora PostgreSQL–compatible DB clusters
  • Enhanced Monitoring
  • Performance Insights
EXPERT

answered 2 months ago

EXPERT

reviewed 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.