Atys: An Efficient Profiling Framework for Identifying Hotspot Functions in Large-scale Cloud Microservices

Jiaqi Sun, Dingyu Yang, Shiyou Qian, Jian Cao, Guangtao XuearXiv 2025 · DOI

Introduction

In large-scale cloud environments, optimizing "hotspot" functions—those consuming significant CPU resources—can lead to substantial infrastructure cost savings. However, profiling modern microservices is challenging due to their multilingual nature (e.g., C++, Java, Python), massive scale across thousands of containers, and the performance overhead typically imposed by traditional profiling tools. To address these challenges, we present Atys, a distributed profiling framework designed for high efficiency and low overhead in production environments.

System Architecture

Atys utilizes a distributed architecture to minimize network congestion and central processing bottlenecks. The system consists of three primary components: a central Controller, a Prometheus Server for data storage and visualization, and Local Profilers deployed on individual worker nodes.

The overall architecture of Atys, showing the interaction between the central controller, Prometheus server, and distributed worker nodes.

The Controller manages profiling tasks, while the Prometheus server handles the storage of aggregated hotspot data. The Local Profilers are responsible for the heavy lifting of data collection and initial processing at the node level.

Methodology and Local Profiler Workflow

The core innovation of Atys lies in its Local Profiler, which implements several strategies to reduce overhead:

  • Language-agnostic Adaptation: Atys dynamically selects the appropriate profiling kernel (e.g., async-profiler for Java, py-spy for Python, or Perf for C++) based on the target service's runtime.
  • Function Selective Pruning (FSP): By identifying that a small percentage of threads (often the top 25%) account for the vast majority of CPU usage, Atys prunes inactive background threads to accelerate data processing.
  • Frequency Dynamic Adjustment (FDA): Using Jensen-Shannon (JS) divergence, Atys monitors the stability of hotspot distributions. It reduces sampling frequency when hotspots are stable and increases it when shifts are detected, optimizing CPU usage.
Detailed workflow of the Local Profiler, illustrating the steps from task release to metric exposure.

As shown in the workflow, the Agent coordinates the profiling kernel to sample the target service. The resulting stack traces are aggregated into compact flamegraphs locally before being uploaded as hotspot functions to the Prometheus client. This local aggregation reduces data transmission by approximately 99% compared to sending raw traces.

Evaluation and Key Results

Atys was evaluated using industry-standard benchmarks, including Specjbb2015 (Java) and VGG16 Inference (Python), on a 13-node cluster.

  • Efficiency and Accuracy: The FSP strategy reduced aggregation time by 6.8% while maintaining a tiny 0.58% error rate for the top 50 hotspot functions. This confirms that focusing on the "working" threads is sufficient for accurate profiling.
  • Cost Savings: The FDA scheme achieved an 87.6% reduction in CPU overhead compared to constant high-frequency sampling, providing results comparable to a 10,000Hz baseline.
  • Scalability: In stress tests, the central server managed 1,000 concurrent service instances while using only 175MB of memory and less than 6% CPU, proving it can handle the load of a modern data center.

Conclusion

Atys provides a non-invasive, scalable solution for hotspot detection in complex cloud ecosystems. By moving data processing to the edge and employing intelligent sampling adjustments, it significantly lowers the "profiling tax" without sacrificing the visibility required for performance optimization. Future work will explore extending Atys to monitor memory and I/O-bound hotspots and further automating parameter calibration for new services.

Summary updated

Abstract

To handle the high volume of requests, large-scale services are comprised of thousands of instances deployed in clouds. These services utilize diverse programming languages and are distributed across various nodes as encapsulated containers. Given their vast scale, even minor performance enhancements can lead to significant cost reductions. In this paper, we introduce Atys1, an efficient profiling framework specifically designed to identify hotspot functions within large-scale distributed services. Atys presents four key features. First, it implements a language-agnostic adaptation mechanism for multilingual microservices. Second, a two-level aggregation method is introduced to provide a comprehensive overview of flamegraphs. Third, we propose a function selective pruning (FSP) strategy to enhance the efficiency of aggregating profiling results. Finally, we develop a frequency dynamic adjustment (FDA) scheme that dynamically modifies sampling frequency based on service status, effectively minimizing profiling cost while maintaining accuracy. Cluster-scale experiments on two benchmarks show that the FSP strategy achieves a 6.8% reduction in time with a mere 0.58% mean average percentage error (MAPE) in stack traces aggregation. Additionally, the FDA scheme ensures that the mean squared error (MSE) remains on par with that at high sampling rates, while achieving an 87.6% reduction in cost.
BibTeX
@misc{sun2025atys,
  author = {Jiaqi Sun and Dingyu Yang and Shiyou Qian and Jian Cao and Guangtao Xue},
  title = {{Atys: An Efficient Profiling Framework for Identifying Hotspot Functions in Large-scale Cloud Microservices}},
  year = {2025},
  eprint = {2506.15523},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2506.15523},
}
Figure