goburrow / cache

Mango Cache 🥭 - Partial implementation of Guava Cache in Go (golang).
BSD 3-Clause "New" or "Revised" License
574 stars 48 forks source link

Adaptivity #11

Open ben-manes opened 5 years ago

ben-manes commented 5 years ago

As you observed with the Youtube trace, the static configuration of W-TinyLFU is not optimal across all workloads. We spent some time exploring options and have a really good solution now.

Caffeine 2.7 includes adaptive window sizing, allowing it to dynamically optimize towards recency or frequency. The below trace chains Corda's bitcoin (recency), Lirs' loop (frequency), and Corda's again. It achieves 39.5% hit rate where optimal is 40.3%, and all other policies are 20% or lower. This is using hill climbing, a decay rate to converge, and a restart threshold of 5% to detect workload changes.

mixed

nqv commented 5 years ago

Thank you, I'll take a look