TL;DR
MSGAF is a novel framework that accurately predicts end-to-end latency in cloud-native microservices to enable efficient, proactive autoscaling. By modeling microservice interactions as a multi-scale graph (microscopic, mesoscopic, and macroscopic) and employing scene-aware expert networks, it dynamically adapts to shifting runtime bottlenecks (like CPU vs. I/O intensive workloads) without requiring any modifications to the application code.
What Problem Does This Paper Address?
Proactive autoscaling is essential for cloud providers to balance Service Level Agreement (SLA) compliance with resource efficiency. To scale resources before a performance dip occurs, systems must accurately estimate end-to-end latency under varying resource quotas and fluctuating workloads.
However, modern microservice environments present two major hurdles for existing latency estimation models:
- Single-Scale Limitations: Microservices naturally form implicit, multi-level structures (fine-grained components at the bottom, functional groups in the middle, and user-facing services at the top). Current methods rely on single-scale graph modeling, missing these hierarchical dependencies.
- High Runtime Variability: A system's performance bottleneck changes dynamically depending on the workload type—a CPU-bound scenario behaves entirely differently from a network- or I/O-bound one. "One-size-fits-all" models fail to generalize across these diverse operational contexts.
Methods
The authors introduce MSGAF (Multi-Scale Graph Adaptive Fusion with Scene-Aware learning), which consists of three core components:
- System State Encoding Module: Gathers heterogeneous real-time metrics (CPU, memory, file I/O, incoming/outgoing network traffic, request rate, and pod count) and encodes them into a unified feature matrix. Crucially, this is done non-intrusively using an infrastructure-layer Service Mesh (Istio sidecars) and Prometheus, meaning developers don't need to alter their application code.
- Multi-Scale Graph Adaptive Fusion Module: Constructs hierarchical graph representations using learnable, aggregation-based coarsening. It extracts features across three distinct abstraction levels: Microscopic (individual service interactions), Mesoscopic (grouped service modules), and Macroscopic (global load distribution). Graph Attention Networks (GATs) process each scale, and an adaptive fusion mechanism dynamically weights their contributions based on the input context.
- Scene-Aware Estimation Module: Functions like a Mixture-of-Experts (MoE) architecture. A scene recognizer identifies the current runtime environment (e.g., CPU-intensive vs. I/O-intensive) and dynamically allocates weights to specialized expert networks to generate the final latency prediction.
Datasets
The framework was evaluated using two widely adopted open-source microservice benchmarks:
- Online Boutique: A Google-developed e-commerce application simulating product browsing, carts, and checkouts across a variety of gRPC-based services.
- Sock Shop: A microservice-based retail store application comprising 13 services implemented in Spring Boot, Go Kit, and Node.js.
To simulate realistic traffic patterns, the authors used real-world production traces from the 2022 Alibaba Cluster Trace Dataset to drive asynchronous load testing via Locust.
Key Insights and Ideas
- The 3-Level Hierarchy Sweet Spot: Through a structural case study, the authors discovered that a 3-level graph configuration (micro, meso, macro) yields optimal prediction accuracy. A single level lacks abstraction, while adding a fourth level introduces noise and causes overfitting, degrading generalization.
- Why P90 Latency Matters Most for Autoscaling: While P50 (median) latency is too stable to highlight performance gaps and P99 (extreme tail) latency is too volatile and unpredictable for any model to forecast reliably, P90 latency strikes the perfect balance. It captures tail latencies experienced by the majority of users without being completely derailed by extreme outliers.
- Dynamic Bottleneck Prioritization: The scene-aware module successfully shifts its reliance to different expert networks as the system transitions between compute-bound and network-bound states, validating the need for context-specific estimation.
Key Results
MSGAF was compared against six baseline approaches, including traditional machine learning models (Linear Regression, MLP, Random Forest) and state-of-the-art microservice modeling frameworks (Sinan and GRAF).
MSGAF consistently achieved the lowest error rates across P50, P90, and P99 latency percentiles:
- P90 Latency (Tail): On the Online Boutique dataset, MSGAF achieved a Mean Absolute Error (MAE) of 36.52, significantly outperforming the closest state-of-the-art baselines, Sinan (45.72) and GRAF (52.18).
- Sock Shop Performance: For P90 latency on Sock Shop, MSGAF hit an MAE of 20.75, compared to Sinan's 22.16 and GRAF's 43.35.
An ablation study confirmed that removing the multi-scale graph component caused the most severe drop in performance, proving that capturing hierarchical system behavior is vital for accurate estimation.
Limitations and Future Work
The authors note that predicting P99 extreme tail latency remains highly challenging for all models due to its volatile, erratic nature during peak loads or unexpected anomalies. While MSGAF still outperforms other models in this category, its error rates naturally degrade under extreme conditions. Future work will likely focus on improving robustness against these rare, high-impact tail events and fully integrating MSGAF into closed-loop, automated resource provisioning systems.
Summary updated