Details
-
Improvement
-
Status: Resolved
-
Normal
-
Resolution: Fixed
-
None
Description
Cassandra currently uses ConcurrentLinkedHashMap for performance critical caches (key, counter) and Guava's cache for non-critical (auth, metrics, security). All of these usages have been replaced by Caffeine, written by the author of the previously mentioned libraries.
The primary incentive is to switch from LRU policy to W-TinyLFU, which provides near optimal hit rates. It performs particularly well in database and search traces, is scan resistant, and as adds a very small time/space overhead to LRU.
Secondarily, Guava's caches never obtained similar performance to CLHM due to some optimizations not being ported over. This change results in faster reads and not creating garbage as a side-effect.
Attachments
Attachments
Issue Links
- breaks
-
CASSANDRA-13113 test failure in auth_test.TestAuth.system_auth_ks_is_alterable_test
- Resolved
-
CASSANDRA-13367 CASSANDRA-10855 breaks authentication: throws server error instead of bad credentials on cache load failure
- Resolved
- causes
-
CASSANDRA-15177 Reloading of auth caches happens on the calling thread
- Resolved
- is duplicated by
-
CASSANDRA-9911 Remove ConcurrentLinkedHashCache
- Resolved
- is related to
-
CASSANDRA-11452 Cache implementation using LIRS eviction for in-process page cache
- Resolved