Search code examples
amazon-web-servicesredisamazon-elasticache

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?


Solution

  • 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