Warm tip: This article is reproduced from stackoverflow.com, please click
amazon-web-services amazon-rds amazon-rds-aurora

Scale out RDS Aurora read replicas at certain times of day

发布于 2020-03-27 15:41:59

Currently my read replicas only scale out to keep the average cpu use at 70%, this leads to a brief period where there is very few and they're taking all the load making my application slow.

How do I preemptively scale them out in preparation for this sudden load, from what I see you can't actually trigger the scaling operations manually using cloudwatch alarms?

Questioner
Nbody Nbody
Viewed
68
John Rotenstein 2020-02-01 12:02

Since you wish to preemptively modify the number of read replicas, it is not possible to trigger the scaling from an Amazon CloudWatch Alarm (since the need to scale has not yet happened).

Instead, you could call modify_db_cluster(), specifying a higher MinCapacity. This will cause the cluster to launch at least that many Read Replicas, so it will be ready for your usage spike.

Later in the day, you could make another call to lower the MinCapacity that it can scale down to.

You could put these calls in AWS Lambda functions, using Amazon CloudWatch Events to trigger the functions at the desired times.