S3-FIFO
Scalable and Efficient Cache Eviction
Efficient: up to 72% lower miss ratio than LRU
Robust: evaluated on 6594 workloads from 12 companies
Scalable: NO locking
Simple: FIFO queues only
Flash-friendly: sequential writes only
How does S3-FIFO work?
Simple and Scalable caching with three Static FIFO queues
How good is S3-FIFO?
S3-FIFO reduces your LRU cache size by 46% and improves the throughput by 6x
* target miss ratio 10%, 16 threads
How to use
# pip install cachemonCache
from cachemonCache import S3FIFO
# A cache that holds up to 1,000 objects
cache = S3FIFO(cache_size=1000)
# Add an object; it expires after 60 seconds
cache.put("key", "value", ttl_sec=60)
# Look it up
print(cache.get("key")) # value
print("key" in cache) # True
# Remove it
cache.delete("key")
print(cache.get("key")) # None
# It also behaves like a dict
cache["answer"] = 42
print(cache["answer"]) # 42 Production cache libraries that implement S3-FIFO.
Why does S3-FIFO work?
A huge number of objects accessed once (called one-hit wonders) calling for quick demotion:
S3-FIFO quickly removes objects that will not be accessed in the future
Figure shows that most of the objects evicted by LRU spend long time in the cache without reuse.
Adoption
Shipped S3-FIFO somewhere? Tell us — we would love to list you, and to hear how it went.
Acknowledgement
Sponsors:
Carnegie Mellon University Parallel Data Laboratory Emory University SimBioSys Lab
Meta, Google Cloud, AWS, Microsoft Azure, CloudLab, Sloan Foundation, VMware, and NSF
Dataset source:
Twitter, Meta, Tencent, Microsoft, Wikimedia, CloudPhysics
Contact Us