A Microservice Graph Generator with Production Characteristics

Fanrong Du, Jiuchen Shi, Quan Chen, Li Li, Minyi GuoarXiv 2024

Abstract

Production microservice applications are incredibly complex, often providing multiple services where queries follow distinct call graphs and share underlying microservices. Improving resource efficiency in these environments is hindered by the lack of realistic benchmarks, as production traces are often too massive for practical experimentation. This paper introduces the Service Dependency Graph Generator (DGG), a tool designed to synthesize small-scale benchmarks that retain production-level characteristics. DGG utilizes a Data Handler to extract fine-grained call graphs from traces and a Graph Generator that employs random graph models to simulate realistic invocation patterns, including "sibling influence." Case studies demonstrate that DGG-generated graphs closely mirror real-world topologies, and resource scaling based on its fine-grained insights can improve efficiency by up to 44.8%.

Introduction

As industry shifts toward microservice architectures, managing their complexity—specifically resource scaling—becomes a massive challenge. While cloud giants like Alibaba and Meta have released production traces, these datasets are often too large and unwieldy for academic or small-scale experimentation. Existing benchmarks and automatic generators are often "coarse-grained," treating microservices as black boxes and ignoring the fact that a single service might have dozens of different interfaces (APIs) or might call a database multiple times within a single query. Because these tools fail to capture the variability of real-world traffic, researchers often develop resource management strategies that are either too aggressive or too conservative.

The DGG Framework

The authors propose DGG, which consists of two main components:

  1. Data Handler: This component analyzes raw production traces to build "fine-grained" call graphs. Unlike standard graphs that just show Service A calling Service B, DGG maps specific interfaces and assigns weights to represent repeated calls. It then uses graph kernels and K-means clustering to categorize these services into distinct topological groups.
  2. Graph Generator: Using the analyzed data, DGG employs a random graph model to synthesize new benchmarks. A key innovation is the modeling of Sibling Influence—the idea that the set of downstream services a microservice calls is often dictated by which other services are being called alongside it in the same request.
Figure 1: Comparison between a service dependency graph and specific call graphs (CG1-3) showing different interface paths.

Production Trace Insights

The study utilizes two major open-source production datasets: the Alibaba Trace (v2022), containing over 20 million call graphs, and the Meta Trace, featuring 18,500 active services. Analysis of these traces revealed several critical insights:

  • Dynamic Interfaces are the Norm: Nearly half (48.8%) of microservices in production have more than two interfaces, and some have hundreds. Treating a service as having a single "load" is a significant oversimplification.
  • Repeated Calls are Frequent: Especially for stateful services like databases, a single upstream request often triggers multiple downstream calls (52.5% of the time in Alibaba).
  • The "Sibling Influence" Discovery: Researchers found that in the Alibaba trace, 55.7% of services are influenced by their "siblings." This means microservice behavior isn't just a series of independent events; the presence of one call often necessitates another.
Figure 5: Distribution of the maximum children set size for microservices in the Meta trace, illustrating typical fan-out characteristics.

Key Results and Evaluation

DGG’s generated graphs were significantly more realistic than previous state-of-the-art generators. Using Jensen-Shannon (JS) divergence (where lower is better), DGG scored 0.034 compared to the previous state-of-the-art (CGG) score of 0.193 when matching real-world call graph distributions.

Furthermore, the practical application of DGG's fine-grained insights leads to substantial gains in Resource Efficiency. In case studies, a scaling strategy based on DGG’s fine-grained insights reduced total CPU core-hour usage by an average of 25.3% and a maximum of 44.8% compared to traditional conservative scaling, all while maintaining strict Quality of Service (QoS) targets. DGG is also highly performant, establishing a random graph model for a real service in about 4ms and generating a new call graph in just 0.7ms.

Conclusion

DGG represents a significant step forward in microservice benchmarking by capturing the nuances of production environments—such as dynamic interfaces and sibling influence—that were previously ignored. While currently dependent on high-quality input traces, DGG provides a practical path for researchers to develop more efficient resource management strategies for the next generation of cloud applications.

Summary updated

BibTeX
@misc{du2024microservice,
  author = {Fanrong Du and Jiuchen Shi and Quan Chen and Li Li and Minyi Guo},
  title = {{A Microservice Graph Generator with Production Characteristics}},
  year = {2024},
  eprint = {2412.19083},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.19083},
}
Figure