Event stream caching is implemented through a Mutex<LruCache> (https://docs.rs/lru/0.6.6/lru/struct.LruCache.html). Ideally this would be an RwLock so that the cache is only locked when adding a new object, however LruCache::get takes &mut self in order to update the LRU list.
I think this might be leading to some lock contention under heavier load. We should replace the cache with something better fit for this purpose.
Event stream caching is implemented through a
Mutex<LruCache>
(https://docs.rs/lru/0.6.6/lru/struct.LruCache.html). Ideally this would be anRwLock
so that the cache is only locked when adding a new object, howeverLruCache::get
takes&mut self
in order to update the LRU list.I think this might be leading to some lock contention under heavier load. We should replace the cache with something better fit for this purpose.