How can I see how full my API Gateway cache is?

1

I have a 0.5GB cache setup on API Gateway, but have no idea if this is enough. There doesn't seem to be any metrics showing if it's full or not and how full it is. How can I know if this is enough or I need to upgrade?

1 Answer
1

You can see how full your API Gateway cache is by using CloudWatch Metrics.

  • Open the CloudWatch console in the AWS Management Console.
  • In the navigation pane, choose "Metrics".
  • In the "Custom Namespaces" section, choose "AWS/ApiGateway"
  • In the "Dimensions" section, select your API Gateway deployment.
  • Scroll down the metrics list, to find the "CacheHitCount" and "CacheMissCount" metrics under the "Cache" category. The "CacheHitCount" metric represents the number of requests served from the cache and the "CacheMissCount" metric represents the number of requests that were not served from the cache. To know how full your cache is you can calculate the hit rate by dividing the "CacheHitCount" metric by the sum of the "CacheHitCount" and "CacheMissCount" metrics. The resulting percentage tells you what percentage of requests were served from the cache.
Amgad
answered a year ago
  • That's not how full my cache is though, that's just how many requests were served from it. Here's an example:

    • 100 unique people hit 100 different URL's on API Gateway, each of those hits is cached and the cache is now 100% full.
    • 100 different people hit 100 different URL's on API Gateway.

    The "CacheHitCount" will be 0, so by your calculations the cache is at 0%, but it's actually full.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions