Sinan: Data Driven Resource Management for Cloud Microservices

Yanqi Zhang, Weizhe Hua, Zhuangzhuang Zhou, G. Edward Suh, Christina DelimitrouarXiv 2021

TL;DR

This paper introduces Sinan, a novel data-driven resource management system for cloud microservices. By leveraging machine learning and tracing data, Sinan dynamically allocates resources to individual microservice tiers to ensure Quality of Service (QoS) without sacrificing efficiency, addressing the complexity of inter-tier dependencies.

What Problem Does This Paper Address?

Modern cloud applications are increasingly built using microservices, breaking down monolithic applications into many small, independent services. While this architecture offers benefits like modularity and flexibility, it introduces significant challenges for resource management. The intricate web of dependencies between these microservices makes it difficult to predict how resource allocation to one service will impact the overall system's performance and Quality of Service (QoS). Traditional resource management approaches, often based on simple rules or empirical decisions, struggle to cope with this complexity, leading to either performance degradation or inefficient resource utilization. The sheer scale of possible resource configurations in a microservice architecture makes exhaustive exploration infeasible.

Methods

Sinan employs a data-driven, machine learning-based approach to tackle these challenges. Its core is a hybrid ML model that predicts both short-term end-to-end latency and the long-term probability of QoS violations.

  • Short-Term Latency Prediction: A Convolutional Neural Network (CNN) is used to predict the end-to-end tail latency (95th-99th percentiles) for the next decision interval. This model takes as input resource usage history, latency history, and the potential resource configuration for the next timestep.
  • Long-Term Violation Prediction: A Gradient Boosted Trees (BT) model, specifically XGBoost, is used to predict the probability of a QoS violation further into the future. This helps Sinan avoid overly aggressive resource reductions that could lead to delayed QoS violations. The BT model uses a compact latent representation extracted from the CNN as its input, reducing computation and improving robustness.

Sinan operates as an online scheduler, making decisions periodically. It collects real-time system metrics (CPU, memory, network, I/O) and user load information. Based on the ML model's predictions, it selects a resource allocation that is both QoS-compliant and resource-efficient, then instructs distributed operators to enforce these decisions. A key aspect of Sinan's data collection strategy is to explore allocations within a defined QoS target range, ensuring the model learns behaviors relevant to both meeting and violating QoS.

Datasets

The paper evaluates Sinan using an end-to-end social network application built with microservices, based on the DeathStarBench benchmark [29]. This application simulates user interactions like composing posts and reading timelines. For training and testing, the authors collected 192,031 samples from this benchmark, splitting them into a 9:1 ratio.

Key Insights and Ideas

  • Data-Driven is Crucial: Empirical, rule-based autoscaling struggles with the complexity of microservice dependencies. Sinan demonstrates that leveraging tracing data and ML is essential for effective management.
  • Hybrid ML for Holistic Prediction: A single ML model is insufficient. Combining a CNN for immediate latency and a BT for long-term violation prediction provides a more robust approach to anticipate system behavior.
  • Delayed Queueing Effect is a Major Hurdle: The paper highlights how queues build up over time, meaning QoS violations aren't always immediate. Sinan's long-term predictor is vital for proactively managing resources to prevent these delayed issues.
  • Explainability Matters for Trust: The authors emphasize the importance of understanding why the ML models make certain predictions. Using LIME, they identified that Redis's logging configuration was a hidden bottleneck, showcasing how explainable AI can uncover performance issues.
  • Targeted Data Collection: Instead of random exploration, Sinan's data collection focuses on the QoS boundary, making the training more efficient and relevant for critical decisions.

Key Results

  • Accuracy: Sinan's CNN model achieved the lowest RMSE for latency prediction (9.5ms) compared to MLP and LSTM. The BT model achieved validation accuracy above 93% with low false positive and negative rates.
  • Resource Efficiency: Sinan reduced active cores by an average of 16.3% (up to 29.1%) and average core frequency by 37.2% (up to 57.47%) compared to a conservative autoscaling policy (AS_Cons), while still meeting QoS.
  • QoS Compliance: Under a diurnal load pattern, Sinan significantly reduced tail latency and latency variability, outperforming traditional autoscalers, especially during low load periods. AS_Opt, in particular, violated QoS by more than an order of magnitude in some diurnal load scenarios.
  • Performance: Sinan's inference latency is within 1% of the decision interval (1s), ensuring it doesn't delay online decisions.

Limitations and Future Work

  • Limited Exploration Space: Due to computational constraints, Sinan's data collection agent can only explore a fraction of the entire resource allocation space.
  • Explainable AI for Debugging: The paper emphasizes the need for explainable ML models to debug the system and identify performance bottlenecks, as demonstrated with the Redis logging example. Future work could further integrate these explainability insights into the resource management process.
  • Generalizability: While evaluated on a social network benchmark, further evaluation on a wider range of microservice applications would be beneficial.
  • Safety Mechanism: Sinan includes a safety mechanism that reduces trust in the ML model if QoS violations exceed a threshold, though the authors note it was not needed in practice. This suggests potential for more sophisticated adaptive trust mechanisms.

Summary updated

BibTeX
@misc{zhang2021sinan,
  author = {Yanqi Zhang and Weizhe Hua and Zhuangzhuang Zhou and G. Edward Suh and Christina Delimitrou},
  title = {{Sinan: Data Driven Resource Management for Cloud Microservices}},
  year = {2021},
  eprint = {2112.06254},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.06254},
}
Figure