AWS ElastiCache Utilization Checker

Number of APIs: 4

This collection recommends which Caches Clusters in AWS ElastiCache are inactive in a given range of time with few externally specified constraints. It uses CloudWatch to get the statistics of clusters and currently is based on 3 metrics:

  • CacheHits
  • CPUUtilization
  • CurrItems

Setup

You need to set the following environment variables:

  1. AWS Credentials

    a. accessKeyID

    b. secretAccessKey

  2. slackWebHookURL

    Description: Collection notifies its results on this webhook.

  3. region

    Description: AWS region to monitor - Ex: us-east-1

  4. days

    Description: Range to monitor clusters starting from today to back N days

  5. period

    Description: Time interval in which AWS collects data points and aggregates them. Ex: 36000 (seconds)

Miscellaneous

  1. AWS allows 1440 data points in a single request. Either make period long or days short so that data points aggregated are less than their limit.

  2. Parameters below have default values in case not mentioned in the environment. You can modify these in the environment if required. However, these are recommended.

Variable NameDefault Value
days14
period36000
regionus-east-1
  1. Get all clusters of a region GET https://elasticache.{{region}}.amazonaws.com/?Action=DescribeCacheClusters&MaxRecords=100&ShowCacheNodeInfo=false&Version=2015-02-02

  2. Get CacheHits Statistics GET http://monitoring.amazonaws.com/?Action=GetMetricStatistics&SignatureVersion=4&Version=2010-08-01&StartTime={{startTime}}&EndTime={{endTime}}&Period={{period}}&Statistics.member.1=Average&Dimensions.member.1.Name=CacheClusterId&Dimensions.member.1.Value={{cacheClusterId}}&MetricName=CacheHits&Namespace=AWS%2FElastiCache

  3. Get CPUUtilization Statistics GET http://monitoring.amazonaws.com/?Action=GetMetricStatistics&SignatureVersion=4&Version=2010-08-01&StartTime={{startTime}}&EndTime={{endTime}}&Period={{period}}&Statistics.member.1=Average&Dimensions.member.1.Name=CacheClusterId&Dimensions.member.1.Value={{cacheClusterId}}&MetricName=CPUUtilization&Namespace=AWS%2FElastiCache

  4. Get CurrentItems Statistics GET http://monitoring.amazonaws.com/?Action=GetMetricStatistics&SignatureVersion=4&Version=2010-08-01&StartTime={{startTime}}&EndTime={{endTime}}&Period={{period}}&Statistics.member.1=Sum&Dimensions.member.1.Name=CacheClusterId&Dimensions.member.1.Value={{cacheClusterId}}&MetricName=CurrItems&Namespace=AWS%2FElastiCache