cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benedict (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (CASSANDRA-10855) Use Caffeine (W-TinyLFU) for on-heap caches
Date Thu, 14 Apr 2016 09:12:25 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-10855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15240837#comment-15240837
] 

Benedict edited comment on CASSANDRA-10855 at 4/14/16 9:12 AM:
---------------------------------------------------------------

We should definitely address Branimir's [comment|https://issues.apache.org/jira/browse/CASSANDRA-11452?focusedCommentId=15240789&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15240789]
before merging.  As he says, this could theoretically completely eliminate the benefit of
the cache in certain circumstances.

I think both supporting larger hashes, and not comparing _only_ against the main eviction
candidate for admission (e.g. comparing against a value with logarithmically random distance
from the eviction candidate), are reasonably easy and should solve the problem


was (Author: benedict):
We should definitely address Branimir's [comment|https://issues.apache.org/jira/browse/CASSANDRA-11452?focusedCommentId=15240789&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15240789]
before merging.  As he says, this could theoretically completely eliminate the benefit of
the cache in certain circumstances.

I think both supporting larger hashes, and not comparing _only_ against the main eviction
candidate for admission, are reasonably easy and should solve the problem.

> Use Caffeine (W-TinyLFU) for on-heap caches
> -------------------------------------------
>
>                 Key: CASSANDRA-10855
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-10855
>             Project: Cassandra
>          Issue Type: Improvement
>            Reporter: Ben Manes
>              Labels: performance
>
> Cassandra currently uses [ConcurrentLinkedHashMap|https://code.google.com/p/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|https://github.com/ben-manes/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|https://github.com/ben-manes/caffeine/wiki/Efficiency] 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|https://github.com/ben-manes/caffeine/wiki/Benchmarks]
to CLHM due to some optimizations not being ported over. This change results in faster reads
and not creating garbage as a side-effect.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message