Skip to content

Upgrade the cache policy from TinyLFU to W-TinyLFU #249

@tatsuya6502

Description

@tatsuya6502

Currently, Moka cache uses TinyLFU as the admission/eviction policies (with a small buffer in front of the LFU filter). While it works well for many workloads like database, search, and analytics, it will not work well for recency-biased workloads, like job queues and event streams.

To provide better hit rate for such workloads, do the followings:

  • Upgrade the cache admission/eviction policy from TinyLFU to Window-TinyLFU (W-TinyLFU).
  • Implement hill climbing to auto-tune the size of the LRU window for current workload.

For more details, see the "Eviction Policy" chapter of an article about Java Caffeine cache:
http://highscalability.com/blog/2019/2/25/design-of-a-modern-cachepart-deux.html

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions