Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Go AdaptSize cache: size-aware admission exp(-size/c) + LRU eviction with background tuner maximizing OHR, for KVS front-ends.

Notifications You must be signed in to change notification settings

bootjp/adaptsize-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AdaptSize cache for Go KVS

  • Admission: P(admit) = exp(-size/c)
  • Eviction: LRU
  • Background tuning: maximize OHR by grid-searching c; for each c, solve μ s.t. Σ P_in(i)*s_i = K via binary search.

Usage

cache := adaptsize.New(adaptsize.Options{
    CapacityBytes: 1<<30, // 1 GiB
    WindowN:       250_000,
})
defer cache.Close()

// For every request, record it and decide admission on misses.
req := adaptsize.Request{Key: "k1", SizeBytes: 1234, Hit: false} // hit comes from your cache
admit := cache.Request(req)
if !req.Hit && admit {
    // insert into your cache implementation
}

c := cache.ParameterC()
_ = c

Acknowledgments and References

This library is a reimplementation based on the formulas and design principles of AdaptSize, a paper by Akamai researchers published at NSDI 2017. We acknowledge the prior work of the authors and their institutions. This is an independent third-party implementation and is not affiliated with the paper’s authors, their institutions, or the conference.

References

  • AdaptSize, Proceedings of the 14th USENIX Symposium on Networked Systems Design and Implementation (NSDI), 2017. Akamai Technologies.
    Core elements in this implementation: size-aware admission exp(-size/c), a closed-form in-cache probability derived from the theorem, solving μ from the capacity constraint, and a global search that maximizes OHR (Object Hit Ratio).

Notes

  • The API and parameter tuning implemented here follow the paper’s model; we adopt exp(-size/c) to match the paper’s notation.
  • This code is not the paper’s official implementation. Algorithmic accuracy and applicability depend on the workload.

About

Go AdaptSize cache: size-aware admission exp(-size/c) + LRU eviction with background tuner maximizing OHR, for KVS front-ends.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages