Closed Bug 1397378 Opened 9 years ago Closed 9 years ago

A cache server without a latency suck

Categories

(Socorro :: Symbols, task)

task
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: peterbe, Unassigned)

Details

Attachments

(1 external file)

Tecken has a couple of caching servers. * 1 global Redis cache on ElastiCache used as an LRU for large symbolication maps. * 1 global Redis cache on ElastiCache used for various global things to do with centralized caching (django sessions, csrf) and since it's Redis it's used as the Celery broker. * One memcached server *per* web head. Decentralized and available on local network for the gunicorn workers. The first and second have terrible latency. The Redis LRU cache usually takes 0.3-0.4 seconds to do any GETMANY calls. The reason I suspect a large portion of that time is latency is because it's almost always the same (total) time for the GETMANY calls independent of the payload size of what's being queried and returned. Some things to figure out in this bug: 1) Let's run some latency testing from within the webheads to the ElastiCache servers. 2) Is this the best state-of-art you can possibly get in AWS with networking? 3) Is our ElastiCache not as well tuned as it can be? 4) Can we install something of our own (even if it's memcached and not fancy Redis) that is central to all web heads in the environment but still blazingly fast?
I measured latency from one of the stage app instances to both the redis cache and the redis store: (hostnames edited to protect the innocent, times in ms per https://redis.io/topics/latency) redis-cli --latency -h <symbols-cache-stage> -p 6379 min: 0, max: 17, avg: 0.79 (20063 samples) redis-cli --latency -h <symbols-store-stage> -p 6379 min: 0, max: 212, avg: 0.31 (20725 samples) both the cache and the store are m3.mediums the cache instance is in us-east-1a, the store instance is in us-east-1c (accounting for the difference in latency between them) This latency is quite low, so I think it's more likely that we have problems with the actual execution of commands rather than in networking.
Thanks Miles! I was hoping for a simpler explanation of the problem :) Perhaps it's time to revisit the application code from a different angle and see if we can find what the true bottleneck is. I have some ideas. One application I'm interested in is to pursue is to use a Redis as an LRU for ALL symbols. I.e. caching without an expiration. Soon we have control of ALL input to S3 which means we can control cache invalidation. This all hinges on the query to ElastiCache being significantly faster than query to S3.
(In reply to Miles Crabill [:miles] from comment #1) > > both the cache and the store are m3.mediums > the cache instance is in us-east-1a, the store instance is in us-east-1c > (accounting for the difference in latency between them) > I know this is stage but is this something should review for prod (where performance actually matters, beyond benchmarks). I.e. can the Redises be in the "exact same region" as the web heads. Perhaps there's something I don't understand about that stuff so ignore me at will.
We concluded that the latency to Redis doesn't actually suck. We're using it as our central cache now for all sorts of things.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: