TL;DR
This paper introduces SAFELOAD, a novel admission control framework for cloud data warehouses that proactively identifies and reroutes memory-overloading (MO) queries to prevent failures and resource wastage. It achieves state-of-the-art precision by combining interpretable rules, a hybrid predictive model, and a self-tuning quota management system, while also releasing SAFEBENCH, a large-scale benchmark for MO query detection.
What Problem Does This Paper Address?
Cloud data warehouses are massive systems that process billions of queries daily, often operating under high load. A critical issue they face is "memory overload," where a query's memory demands exceed the available resources, leading to query failures and significant waste of CPU time. These failures can disrupt complex business workflows. Existing admission control systems primarily focus on other aspects like SLA compliance or resource isolation, lacking the precision to effectively identify MO queries. Furthermore, there's a scarcity of publicly available datasets specifically labeled for MO queries, hindering research and development in this area. This paper aims to bridge this gap by proposing a framework and benchmark to accurately detect and manage MO queries before they cause problems.
Methods
SAFELOAD employs a multi-stage approach:
- Feature Vector Generation: It creates a comprehensive feature vector for each query by combining information from query plan statistics (like operator types and cardinalities) and cluster-level resource metrics (CPU/memory utilization).
- Discriminative Rule Filtering: This stage uses interpretable, human-readable heuristic rules (derived from analyzing common MO query patterns) to quickly filter out a large portion of "safe" (non-MO) queries. This reduces computational load and enhances interpretability.
- Predictive Model with Correction: For queries that pass the initial filtering, SAFELOAD uses a hybrid machine learning architecture. It employs cluster-specific models for clusters with ample data and a global model for those with less. Crucially, it incorporates a misprediction correction module that uses vector search to identify and correct past false negatives (MO queries incorrectly classified as safe).
- Self-Tuning Quota Management: This module dynamically adjusts the "cost" of accepting a predicted MO query based on the model's confidence and the cluster's historical performance (specifically, the count of false negatives). This helps balance precision and recall, preventing excessive resource consumption from false positives.
Datasets
The primary dataset used is SAFEBENCH, a newly introduced, industrial-scale benchmark. It comprises over 150 million real-world analytical queries collected from Alibaba Cloud's AnalyticDB system over three days. SAFEBENCH includes query logs, cluster-level information, and ground truth labels indicating whether a query caused memory overload. It is divided into three subsets (A1, A2, A3) for training and testing.
Key Insights and Ideas
- MO Queries are Costly: The paper quantifies that execution failures due to memory overload can waste significant CPU time (up to 17 hours per incident in their analysis), highlighting the economic and operational impact.
- Feature Importance: Analysis reveals that a combination of query-level features (operator counts, cardinality) and cluster-level metrics (resource availability, past OOM events) are crucial for accurate MO query detection.
- Interpretability Matters: The discriminative rule filtering module is designed not just for efficiency but also to provide clear, understandable reasons for rejecting queries, fostering user trust.
- Hybrid Models are Key: The success of SAFELOAD relies on combining global models (for generalizability) with cluster-specific models (for fine-tuning to local characteristics), along with a misprediction correction mechanism that learns from past errors.
- Dynamic Quotas are Essential: Simply predicting MO queries isn't enough; managing the cost of those predictions (especially false positives) through dynamic quota adjustments is vital for practical deployment.
Key Results
- State-of-the-Art Performance: SAFELOAD achieves state-of-the-art prediction performance, improving precision by up to 66% over the best baseline.
- Reduced Resource Wastage: It reduces wasted CPU time by up to 8.09 times compared to scenarios without SAFELOAD.
- Low Overhead: The framework demonstrates low online prediction overhead (0.48ms per query for the predictive model part) and practical offline construction times (around 34 minutes for rule generation).
- Component Importance: Ablation studies confirm that each component of SAFELOAD (discriminative rule filtering, hybrid models, misprediction correction, quota management) plays a critical role in its overall effectiveness.
Limitations and Future Work
- Parameter Sensitivity: While SAFELOAD is robust across a range of parameters for its quota management, the paper notes that optimal values (y=1, β=0.5) were identified through sensitivity analysis. Further exploration of these parameters in diverse environments could be beneficial.
- Future Work: The authors suggest that the SAFEBENCH benchmark can be extended with more diverse workloads and cluster configurations. They also hint at future work in exploring more advanced ML models and further optimizing the misprediction correction mechanism. The system's adaptability to different database engines is also a point of ongoing research.
Summary updated