Visit the post for more.
Overview
McDipper is a flash-based key-value cache developed by Facebook to enhance the efficiency of caching large data sets compared to traditional Memcached. It aims to provide high performance while being a drop-in replacement for Memcached, leveraging the advantages of flash storage.
What You'll Learn
1
How to configure a key-value cache for flash storage
2
Why using delete hold-offs can improve cache consistency
3
When to use bloom filters and compression in caching strategies
Prerequisites & Requirements
- Understanding of caching concepts and Memcached
Key Questions Answered
What are the main design goals of McDipper?
The main design goals of McDipper are to efficiently utilize flash storage to deliver performance close to that of the underlying device and to serve as a drop-in replacement for Memcached. This allows for high capacity and performance while maintaining compatibility with existing Memcached clients.
How does McDipper handle cache invalidation?
McDipper uses a delete hold-off mechanism to manage cache invalidation. This involves setting a delete with an expiration time, preventing new values from being set until the delete expires, thus reducing the likelihood of stale data being served.
What performance improvements has McDipper achieved in production?
Since its deployment, McDipper has reduced the total number of servers in some pools by as much as 90% while still delivering over 90% of get responses with sub-millisecond latencies, showcasing its efficiency in handling large-footprint, low-request-rate workloads.
How does McDipper optimize for serving photos at scale?
McDipper is configured to run with a small number of buckets holding indirect records in memory, while storing photos on flash. This setup minimizes write amplification and allows for efficient photo fetching and storing, achieving over 150 Gb/s throughput.
Key Statistics & Figures
Reduction in deployed servers
90%
Achieved in some pools after deploying McDipper.
Get response latency
sub-millisecond
Over 90% of get responses meet this latency requirement.
Throughput from McDipper forward caches
150 Gb/s
This throughput is achieved while serving photos in Facebook's content delivery network.
Technologies & Tools
Some links below are affiliate links. We may earn a commission if you make a purchase.
Cache
Memcached
McDipper is designed to be compatible with the Memcached protocol.
Storage
Haystack
Used to store all Facebook photos, with McDipper serving as a caching layer.
Key Actionable Insights
1Implementing a delete hold-off can significantly enhance cache consistency in high-load environments.This strategy is particularly useful in scenarios where multiple clients interact with the cache, as it minimizes the risk of serving stale data.
2Utilizing bloom filters can reduce unnecessary reads and improve cache efficiency.This is beneficial in workloads where certain keys are accessed infrequently, allowing for better resource management.
3Configuring McDipper to leverage flash storage can lead to substantial cost savings in server deployment.By reducing the number of servers needed while maintaining performance, organizations can optimize their infrastructure costs.
Common Pitfalls
1
Failing to properly manage cache invalidation can lead to serving stale data.
This often occurs in high-concurrency environments where multiple clients may attempt to set values simultaneously, resulting in race conditions.