I want to troubleshoot an Amazon ElastiCache self-designed cluster that can't scale down.
Resolution
If you can't scale down your self-designed cluster, then check the following:
Cache data size
Every ElastiCache node has a dedicated amount of memory reserved for the Redis engine and the new node type might not have sufficient memory to store the cache data. For example, the cache.m5.xlarge node type has 12.93 GiB of storage. By default, ElastiCache reserves 25% of the total memory for administrative tasks such as fullsync and creating snapshots. To change this amount, update the reserved-memory-percent parameter. For a list of node types and storage amounts, see Amazon ElastiCache pricing.
To check the memory usage in the used_memory and maxmemory node parameters, use the info memory command:
Note: The info memory command shows the memory in GB. Amazon ElastiCache pricing shows the memory in GiB.
test.xm4oz6.ng.0001.use1.cache.amazonaws.com:6379> info memory
# Memory
used_memory:5579416
used_memory_human:5.32M
used_memory_rss:11218944
used_memory_rss_human:10.70M
used_memory_peak:5856480
used_memory_peak_human:5.59M
maxmemory:10418941287
maxmemory_human:9.70G
To resolve a lack of available memory on the node, reduce the cache data or choose a node type that has more capacity.
Available node types
Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshoot AWS CLI errors. Also, make sure that you're using the most recent AWS CLI version.
To determine what node types you can select from your current node type when you scale up and down, run the ListAllowedNodeTypeModifications API.
To view the available node types that your Redis self-designed cluster can scale to, run the ListAllowedNodeTypeModifications command:
$aws elasticache list-allowed-node-type-modifications --replication-group-id checkout-cache-test
{
"ScaleUpModifications": [
"cache.r4.16xlarge",
"cache.r5.12xlarge",
"cache.r5.24xlarge",
"cache.r5.4xlarge"
],
"ScaleDownModifications": [
"cache.m3.2xlarge",
"cache.m3.large",
"cache.m3.medium",
"cache.m3.xlarge",
"cache.m4.2xlarge",
"cache.m4.4xlarge",
"cache.m4.large",
"cache.m4.xlarge",
"cache.r3.2xlarge",
"cache.r3.large",
"cache.r3.xlarge",
"cache.r4.2xlarge",
"cache.r4.large",
"cache.r4.xlarge",
"cache.t2.medium",
"cache.t2.micro",
"cache.t2.small",
"cache.t3.medium",
"cache.t3.micro",
"cache.t3.small"
]
}
Note: The time it takes to scale to a smaller node type depends on your node type and the amount of data in your current cache cluster.
Related information
Managing reserved memory
Scaling down Redis cache clusters (AWS CLI)