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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Normal
    • Resolution: Fixed
    • 4.0-alpha1, 4.0
    • 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

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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: