Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-10855

Use Caffeine (W-TinyLFU) for on-heap caches

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Fix Version/s: 4.0
    • Component/s: None
    • Labels:

      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

        1. CASSANDRA-10855.patch
          1.98 MB
          Ben Manes
        2. CASSANDRA-10855.patch
          1.02 MB
          Ben Manes

          Issue Links

            Activity

              People

              • Assignee:
                ben.manes Ben Manes
                Reporter:
                ben.manes Ben Manes
                Reviewer:
                Robert Stupp
              • Votes:
                0 Vote for this issue
                Watchers:
                21 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: