Debugging Cache Entries
Debugging Cache Entries¶
Overview¶
This document details steps for accessing the dev stack’s Elasticache, using an EC2 instance (created by @tschetan) and Redis queries
Steps for connecting¶
Log into the
firefly-music-devAWS account and navigate to the EC2 consoleFind the
cache_debuginstance -> ClickConnect-> Select theSession ManagertabOnce viewing the command prompt, run
sudo -icd redis-stable/srcto navigate to the correct folder./redis-cli -h clustered-general-dev-0001-001.rt1ypq.0001.use1.cache.amazonaws.com -cThe cluster should be taken from Elasticache console in same region and excluding port at end (ex:
:6769)You may need to try all endpoints for a cluster to find the actual value you’re searching for, as entries are hashed across instances
Accessing the data¶
You should now have direct access to a cache, and can run one of the following commands based on your use case
keys *¶
This lists all keys in the cluster. Instead of the *, you can do *AHFDD* to get specific customer id or *DMPBrowse.Categories* to get specific cache values
get key¶
This will retrieve the actual value for a key obtained above
del key¶
This will remove a value from the cache (be careful with the wildcard you use!)
If you don’t see the entries you expect¶
Check the other endpoints in the Elasticache cluster, as a cache entry may exist in any of them
Try using a different wildcard (*, customerId, API) for the search
Check the TTL for the entry you are checking, as it may be deleting quickly, or your code may not be being hit due to a pre-existing cache value
Make sure you are using the Elasticache endpoint for the correct region
