Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Elasticache - Redis Autoscaling

There is an redis instance been created in ElasticCache and this will be used to store and retrieve data as usual.

Is there any max memory for this redis instance and how can that be checked?

All I need is say example if the data size in redis reaches above 100 mb then it should be auto scaled without me having to manually scale it or create a new instance and things like that.

And when the data size is reduced(example: From 300mb to 50 mb due to less traffic) then the instances should be reduced so that there is no extra cost incured. How can this be configured in AWS ElastiCache?

like image 657
Deekshith Hegde Avatar asked Jan 24 '23 20:01

Deekshith Hegde


2 Answers

unfortunately there is no auto-scaling policy attach with Elasticcache out of the box, amazon ElastiCache provides console, CLI, and API support for scaling your Redis (cluster mode disabled) replication group up.

One option that you can try is to set cloud watch alarm base on node memory and then trigger lambda function that will scale up and down base on metrics.

  • Create a CW alarm
  • Select Elastic cache metrics
  • Select Node level metrics
  • Select Free memory metrics
  • Trigger notification to SNS topic
  • Subscribe lambda function
  • scaleup/scaledown base on metrics

enter image description here

enter image description here

enter image description here

like image 155
Adiii Avatar answered Feb 12 '23 23:02

Adiii


Now Elasticache supports autoscaling https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/AutoScaling.html

like image 39
lak Avatar answered Feb 12 '23 23:02

lak