Supporting LIRS replacement algorithm in CacheLib #99
hansonzhao007
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
@hansonzhao007 Thanks for taking the effort to implement this in CacheLib and doing some benchmarking. First, I'd like to move this to the discussion channel since the issue forum is to track immediate actionable things and we might want to discuss more on the implementation details before we merge this PR. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We has implemented the LIRS replacement in the cachelib source code and use
cachebench
to read the traces and generate the results.The traces in the test are from CloudPhysics and were collected in caching analytics service in production VMware environments (As the trace files only contain block number, we set
enableLookaside
totrue
, and the value size is fixed at 1KB). Some trace files can be downloaded at hereAttached are LIRS's miss ratio curves in comparison with replacement algorithms currently in the cachelib, including LRU, LRU2Q, and TinyLFU (All algorithms simply adopt their default settings).
The results are very encouraging: where cachelib's existing algorithms don't perform well as expected (miss ratio curve don't decrease with increase of cache size), LIRS mostly fixes the performance issue. Some of the results are attached. Please take a look.

cachelib_results.pdf
The LIRS's source code for cachelib can be found at https://github.com/hansonzhao007/CacheLib, (in branch 'LIRS". Current implementation is a prototype, so it may not pass the unit-test in multithreading tests.)
To reproduce the results, you may follow these steps:
We intend to contribute to the cachelib community by hopefully merging lirs into cachelib. To this end, we may continue to improve the lirs implementation by hearing from you and the rest of the community.
Beta Was this translation helpful? Give feedback.
All reactions