Sage: Leveraging ML to Diagnose Unpredictable Performance in Cloud Microservices

Yu Gan, Mingyu Liang, Sundar Dev, David Lo, Christina DelimitrouarXiv 2021

TL;DR

Modern cloud applications are built with microservices, which are great for flexibility but make performance debugging a nightmare. Sage is a new ML system that uses unsupervised learning to automatically pinpoint the root cause of performance issues in these complex systems, without needing manual labeling or disrupting live services. It achieves high accuracy and helps restore predictable performance.

What Problem Does This Paper Address?

The shift from monolithic applications to microservices has brought many benefits, like easier development and better scalability. However, this architectural change introduces a new challenge: performance debugging. In a microservice architecture, a single request might traverse dozens or even hundreds of independent services. When a performance issue (like slow response times) arises, it's incredibly difficult to figure out which of these many services is the culprit. Traditional debugging methods are cumbersome, error-prone, and don't scale well. Existing automated systems often rely on supervised learning, which requires extensive, manual "labeling" of performance traces – a process that's impractical and disruptive in production environments. This paper tackles the problem of automatically and efficiently diagnosing performance regressions in complex microservice architectures.

Methods

Sage employs a two-pronged approach:

  1. Causal Bayesian Networks (CBNs): Sage first models the dependencies between microservices using CBNs. These networks represent the causal relationships, where edges indicate how the latency of one service can affect another. They incorporate observed metrics (like CPU usage, network bandwidth) and latency data, as well as latent variables to capture unobserved factors influencing performance. This provides a structured understanding of how latency propagates through the system.
  2. Graphical Variational Auto-Encoders (GVAEs): To identify the root cause, Sage uses GVAEs. This is a novel application of generative models. Instead of relying on labeled data, Sage generates "counterfactuals" – hypothetical scenarios where a specific microservice's performance is assumed to be "normal." By comparing the actual problematic performance to these counterfactuals, Sage can infer which service's deviation from normal behavior is most likely causing the end-to-end QoS violation. The "graphical" aspect means the GVAE is structured according to the CBN, allowing for more efficient and interpretable counterfactual generation.

Sage also incorporates mechanisms for online learning (periodically retraining the model with new data) and transfer learning (efficiently updating the model when application designs change) to keep up with dynamic cloud environments.

Datasets

The paper evaluates Sage on three applications:

  • Chain and Fanout Topologies: These are synthetic microservice architectures designed to mimic common patterns in real-world systems.
  • Social Network (DeathStarBench): A more complex, broadcast-style social network application that implements uni-directional follow relationships.

The training data is derived from real-world tracing and monitoring tools (Jaeger, Prometheus) and workloads generated by wrk2. To validate the ground truth, they inject faults using stress-ng and tc-netem.

Key Insights and Ideas

  • Unsupervised Learning for Production: The most significant insight is Sage's ability to perform root cause analysis without requiring labeled data. This bypasses a major bottleneck in applying ML to real-world production systems, where labeling is costly and disruptive.
  • Causality Matters: Explicitly modeling causal relationships with CBNs is crucial. It allows Sage to generate more meaningful counterfactuals and avoid spurious correlations, leading to more accurate diagnoses.
  • GVAE for Counterfactuals: Adapting GVAEs to generate counterfactuals for performance debugging is a clever application of generative models, enabling "what-if" scenarios without live experimentation.
  • Handling Dynamic Environments: The inclusion of techniques for incremental retraining and selective partial retraining is vital for making the system practical in environments where microservices are frequently updated or reconfigured.

Key Results

  • High Detection Accuracy: Sage achieves high root cause detection accuracy, significantly outperforming traditional autoscaling techniques and even an "oracular" scheme that uses pre-defined thresholds.
  • Low False Positives/Negatives: The system demonstrates marginal false positive and false negative rates, meaning it rarely misidentifies a culprit or misses an issue.
  • Faster Recovery: In experiments where performance issues were injected, Sage's actuation system quickly identified the root cause and restored performance, leading to much faster recovery times compared to threshold-based methods.
  • Scalability: Sage scales well to large deployments, with accuracy on Google Compute Engine (GCE) being within 1% of local cluster performance, despite a significant increase in the number of containers. Training and inference times also scale reasonably well.

Limitations and Future Work

  • Assumptions: The paper notes that the CBN model relies on the assumption of a "local Markov property" for latency propagation. While generally applicable, complex interdependencies might strain this assumption.
  • Counterfactual Generation: While effective, generating realistic counterfactuals for very complex systems or rare failure modes could still be challenging.
  • Future Work: The authors suggest that Sage's core principles could be extended to other areas of cloud system management, such as anomaly detection, resource prediction, and automated performance optimization. Further research into more sophisticated generative models for counterfactuals and improved online learning techniques could also be beneficial.

Summary updated

Abstract

Cloud applications are increasingly shifting from large monolithic services, to complex graphs of loosely-coupled microservices. Despite their advantages, microservices also introduce cascading QoS violations in cloud applications, which are difficult to diagnose and correct. We present Sage, a ML-driven root cause analysis system for interactive cloud microservices. Sage leverages unsupervised learning models to circumvent the overhead of trace labeling, determines the root cause of unpredictable performance online, and applies corrective actions to restore performance. On experiments on both dedicated local clusters and large GCE clusters we show that Sage achieves high root cause detection accuracy and predictable performance.
BibTeX
@misc{gan2021sage,
  author = {Yu Gan and Mingyu Liang and Sundar Dev and David Lo and Christina Delimitrou},
  title = {{Sage: Leveraging ML to Diagnose Unpredictable Performance in Cloud Microservices}},
  year = {2021},
  eprint = {2112.06263},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2112.06263},
}
Figure