TL;DR
This paper tackles the challenge of load balancing in large-scale distributed stream processing systems, which is often hindered by skewed data distributions. They introduce D-Choices and W-Choices, novel techniques that extend the "power of two choices" by dynamically assigning "hot" keys to more than two workers, significantly improving throughput and latency.
What Problem Does This Paper Address?
Distributed Stream Processing Engines (DSPEs) are powerful tools for real-time data analysis, but their performance hinges on efficient load balancing. A major obstacle is data skew, where a small number of keys (e.g., popular user IDs, trending hashtags) generate a disproportionately large amount of data. This skew can overwhelm specific workers, leading to performance bottlenecks, increased latency, and reduced throughput. Existing solutions like "power of two choices" (PKG) work well at smaller scales but struggle in large deployments (hundreds or thousands of workers) because the imbalance caused by hot keys becomes harder to average out. Simply distributing all data randomly (shuffle grouping) is too costly for stateful operations, as it requires replicating state across all workers.
Methods
The core idea is to differentiate between "hot" keys (the head of the distribution) and "cold" keys (the tail).
- Heavy Hitter Detection: They use the SpaceSaving algorithm to efficiently identify "heavy hitter" keys in real-time without needing to store all keys.
- D-Choices: For identified hot keys, this method dynamically determines the minimum number of workers (
d) required to achieve a target imbalance level. Thisdis typically less than the total number of workers (n) but more than two. - W-Choices: This is a simpler approach where hot keys are assigned to all available workers (
n). This is effective when the state associated with hot keys is not excessively large. - Greedy-d Process: Both D-Choices and W-Choices use a load-sensitive assignment strategy. When a message arrives, its key is hashed to
dpotential workers, and the message is sent to the least loaded among them. This is an online approach that doesn't require routing tables.
Datasets
The authors evaluated their methods using a combination of real-world and synthetic datasets:
- Real-world:
- Wikipedia (WP): Page visit logs.
- Twitter (TW): Tweet data.
- Cashtags (CT): Tweets containing stock ticker symbols, used to study concept drift.
- Synthetic:
- Zipf distributions (ZF): Generated datasets with controlled skew levels (exponent
z) and varying numbers of unique keys (|K|).
- Zipf distributions (ZF): Generated datasets with controlled skew levels (exponent
Key Insights and Ideas
- The "Power of Two Choices" isn't enough at scale: The paper convincingly demonstrates that as the number of workers grows, the effectiveness of simply assigning keys to two workers diminishes significantly due to extreme skew.
- Differentiating Hot vs. Cold Keys is Crucial: By treating the small set of "hot" keys differently from the vast majority of "cold" keys, significant performance gains can be achieved.
- Dynamic
dis Key for Efficiency: D-Choices' ability to analytically estimate the minimal number of choices (d) for hot keys is a clever way to balance performance and resource usage, avoiding the overhead of assigning to all workers. - Online Heavy Hitter Detection is Practical: Using algorithms like SpaceSaving allows these techniques to operate in real-time without prior knowledge of the data distribution.
Key Results
- Improved Load Balancing: D-Choices and W-Choices significantly reduce load imbalance compared to PKG, especially at larger scales (50-100 workers) and with higher skew.
- Throughput and Latency Gains:
- Up to 150% higher throughput and 60% lower latency compared to PKG on Apache Storm.
- Up to 230% higher throughput and 75% lower latency compared to basic Key Grouping.
- Comparable to Shuffle Grouping (at lower cost): D-Choices and W-Choices achieve throughput and latency comparable to Shuffle Grouping (which offers ideal load balance but is costly for stateful operations), while using significantly less memory.
- D-Choices
dis close to optimal: The analytically deriveddfor D-Choices is very close to the empirically found optimal value, validating the theoretical analysis.
Limitations and Future Work
- Memory Overhead: While D-Choices and W-Choices are more memory-efficient than shuffle grouping, they do incur higher memory overhead than basic PKG, especially for W-Choices at high skew.
- Concept Drift: While the CT dataset showed that concept drift poses challenges, the proposed methods remained relatively stable. Further investigation into adapting to rapid drift could be beneficial.
- Threshold Selection: The paper uses a conservative default threshold (
θ = 1/5n) for identifying head keys. While effective, exploring more adaptive or dynamic threshold selection strategies could be an area for future work. - Generalization to Complex DAGs: The evaluation primarily focused on a simple two-operator DAG. Extending and evaluating these techniques in more complex, multi-stage DSPE applications would be valuable.
Summary updated