Introduction
In modern cloud computing, microservice architectures have become the standard for building scalable applications. However, managing these services efficiently remains a significant challenge due to "resource mismatch." Over-allocation leads to substantial financial waste, while under-allocation risks system instability and crashes. Accurate workload prediction is essential for proactive resource management.
Challenges in Workload Prediction
Predicting microservice workloads is complicated by two primary factors:
- Temporal Complexity: Workload data is inherently non-stationary, meaning its statistical properties shift over time. It also exhibits multi-periodicity, where multiple overlapping cycles (e.g., daily and weekly) occur simultaneously. Furthermore, external system states, such as response times and the number of active replicas, exert a dynamic influence on CPU usage.
- Spatial Complexity: Unlike physical infrastructures with fixed topologies, microservices possess "logical" dependencies based on behavioral patterns. Traditional models often rely on arbitrary similarity thresholds to map these relationships, which can introduce noise and degrade prediction accuracy.
The STEAM Framework
To address these challenges, the authors propose STEAM (Spatio-Temporal Heterogenous Graph Contrastive Learning). The framework utilizes a "spatio-temporal sandwich" architecture designed to capture both long-term trends and short-term fluctuations.
Long-Term Temporal Encoding
STEAM employs a De-stationary Module that normalizes input series to improve predictability, later re-introducing statistical trends to ensure accuracy. This is paired with Auto-Correlation and Series Decomposition to disentangle complex periodic patterns.
System States Encoding
Rather than treating CPU usage in isolation, STEAM incorporates auxiliary data such as Response Time (RT), request volume, and replica counts. These are processed through a decoupled embedding layer to prevent "feature entanglement," ensuring that secondary signals do not obscure the primary workload patterns.
Spatial Feature Encoding
The core innovation of STEAM lies in its use of Heterogeneous Graph Contrastive Learning. To avoid the pitfalls of fixed-threshold similarity graphs, the model generates multiple "views" of the system based on different metrics. It then learns consistent, robust features across these views, effectively filtering out statistical noise and identifying true service dependencies.
Short-Term Temporal Encoding
Finally, a Temporal Convolutional Network (TCN) is used to capture sudden, localized fluctuations, providing the model with the agility needed for real-time cloud environments.
Experimental Evaluation
STEAM was evaluated on two large-scale real-world datasets:
- MS Dataset: Workload data for 46 microservices over 10 days from Ant Group.
- Ali Dataset: Workload records for 148 machines over 8 days from the Alibaba Cluster Trace.
Key Results
STEAM consistently outperformed state-of-the-art baselines, including PatchTST, MTGNN, and FEDformer.
- MS Dataset: STEAM achieved a Mean Absolute Error (MAE) of 0.0738 at a prediction horizon of $L=48$, significantly better than PatchTST (0.0788) and traditional ARIMA (0.0965).
- Ali Dataset: STEAM maintained its lead with an MAE of 0.1348, compared to 0.1612 for PatchTST.
Ablation studies confirmed that the De-stationary module and System State Augmentation are critical to the model's performance.
Conclusion
The STEAM framework demonstrates that combining contrastive learning with decoupled system state encoding provides a robust solution for microservice workload prediction. By filtering spatial noise and accounting for non-stationary temporal patterns, it offers a path toward more efficient and reliable cloud resource management. Future research may explore integrating additional metrics like memory pressure or network bandwidth to further enhance predictive power.
Summary updated