My Elasticache cluster has the following settings/parameters
Node type: cache.r5.xlarge
Shards: 15
Number of nodes: 30
reserved-memory-percent: 25
cache.r5.xlarge
has memory of 26.32 GiB. So the total memory should be 26.32 * 30 * 0.75 = 592.2 GiB
And running info memory
in RedisInsight-v2 got maxmemory_human:19.74G
. And 19.74 * 30 = 592.2 GiB
Does info memory
return the status of one node? I will need to monitor the usage of the whole cluster (Comparing used_memory_human
with maxmemory_human
). How can I get the status of all nodes? BTW, how to run RedisInsight-v2 as a command line too so I can automate the comparison?
All of the information you get out of the info
Redis command is about the specific node you're connected to, other than the Replication section, which obviously has information on master/replicas depending on the node's role. There's no Redis command built-in that will retrieve these metrics for an entire cluster, but you can loop through your nodes to collect it.
As to how to do this on the command line, I'd recommend the basic redis-cli
tool, which does work with an ElastiCache node as long as security groups allow you to access it (either directly on 6379 or via ssh, etc.):
redis-cli -h your.elasticache.cluster.endpoint.example.com --user myuser --askpass --tls
The --user
, --askpass
, and --tls
options assume you're using Redis version > 6.0.
You can also get similar data (though not exactly what you're looking for) in AWS CloudWatch:
Metrics
, then select Explorer
. This will open an empty Explorer templateDatabaseMemoryUsagePercentage
, or you can add all other available metrics by selecting All ElastiCache CacheCluster Metrics
Period
value at the bottom.Here's the graph for a test cluster I have:
Once you have the metrics graphed, you can add them to a dashboard so you don't have to go through the steps above.