End-to-End Application Cloning for Distributed Cloud Microservices with Ditto

Mingyu Liang, Yu Gan, Yueying Li, Carlos Torres, Abhishek Dhanotia, Mahesh Ketkar, Christina DelimitrouarXiv 2022

TL;DR

This paper introduces Ditto, an automated framework for creating "clones" of real-world cloud applications. These clones mimic the performance and behavior of the original services without revealing their proprietary code, enabling broader research and development in cloud systems. Ditto achieves this by capturing a comprehensive view of an application's system stack, from kernel operations to I/O and network activity.

What Problem Does This Paper Address?

The cloud computing landscape is dominated by complex, proprietary applications and microservices. Studying these systems is crucial for designing better infrastructure, but access to production code is often restricted. Existing benchmarks are often too simplistic, failing to capture the full complexity of real-world cloud workloads, which involve intricate interactions across the entire system stack, including I/O, networking, and kernel operations. This lack of representative, accessible workloads hinders research into performance optimization, system design, and hardware development for cloud environments.

Methods

Ditto employs a hierarchical, end-to-end approach to application cloning:

  1. Microservice Topology Discovery: For distributed microservices, Ditto first learns the dependency graph between services using distributed tracing. This forms the basis for recreating the communication interfaces between cloned services.
  2. Application Skeleton Generation: It then analyzes the network and thread models of each service. This involves profiling how services handle remote communication (client/server, synchronous/asynchronous) and how tasks are distributed among threads, using tools like SystemTap.
  3. Application Body Generation: This is the core of Ditto's novelty. It goes beyond user-level logic to capture:
  4. System Calls: Profiling the distribution and arguments of system calls to mimic kernel-level behavior and I/O.
  5. Instruction Mix: Capturing the dynamic count of x86 assembly instructions and clustering them by functionality and hardware resource needs.
  6. Branch Behavior: Analyzing branch taken/not-taken rates and transition rates to accurately clone branch prediction behavior.
  7. Data Memory Access Patterns: Synthesizing memory access patterns based on working set sizes to mimic cache behavior without leaking sensitive information.
  8. Instruction Memory Access Patterns: Similar to data memory, it synthesizes instruction access patterns based on i-cache behavior.
  9. Data Dependencies: Quantifying data dependency distances to influence instruction-level parallelism (ILP) and memory-level parallelism (MLP).
  10. Fine-Tuning: An iterative process using performance counters to calibrate the synthetic application against the original, ensuring high accuracy (over 95% in many cases) with minimal overhead.

A key principle is abstraction: Ditto generates synthetic code that mimics performance characteristics without revealing the original application's logic, making it safe to share.

Datasets

The paper evaluates Ditto on several well-known cloud services and benchmarks:

  • Single-tier applications: Memcached, NGINX, MongoDB, Redis.
  • Microservice topology: Social Network (a topology from DeathStarBench with a Facebook dataset).
  • Workload generators: tcpkali (for NGINX), YCSB (for MongoDB and Redis), and a mutated workload generator (for Memcached).

No new datasets were introduced; instead, Ditto leverages existing production services and standard workload generators.

Key Insights and Ideas

  • Beyond CPU: The Importance of the Full Stack: The paper strongly emphasizes that accurately cloning cloud applications requires looking far beyond CPU metrics. I/O, network activity, and kernel operations are critical bottlenecks that prior work often overlooked.
  • Abstraction for Sharing: Ditto's ability to generate functional clones without revealing proprietary code is a significant contribution. This opens doors for collaboration and research that was previously hindered by intellectual property concerns.
  • Platform-Independent Cloning: The synthetic applications generated by Ditto are designed to be portable and react to platform changes similarly to their originals, reducing the need for reprofiling across different environments.
  • Decomposition of Accuracy: The paper meticulously breaks down how each component of Ditto (system calls, instruction mix, branch behavior, etc.) contributes to the overall accuracy, demonstrating that all aspects are necessary for comprehensive cloning.

Key Results

  • Ditto accurately captures CPU performance metrics (IPC, branch mispredictions, cache misses) with average errors around 4-12% across various loads and services.
  • Network and disk bandwidth are also faithfully reproduced.
  • End-to-end latency (including p99) is closely matched between original and synthetic applications.
  • Synthetic applications exhibit similar behavior to originals when subjected to varying loads and platform changes.
  • Ditto's fine-tuning process can achieve over 95% accuracy within a few iterations.
  • The framework successfully clones interference effects, demonstrating its utility for power management and resource contention studies.

Limitations and Future Work

  • Hardware Accelerators: The authors acknowledge that cloning the behavior of devices like GPUs and hardware accelerators is deferred to future work.
  • Specific Instruction Set Architectures (ISAs): While Ditto supports x86, extending it to other ISAs would require further development.
  • Complexity of Microservice Interactions: While Ditto captures the dependency graph, the intricate inter-service communication patterns in very large microservice deployments could present ongoing challenges.
  • Initial Profiling Overhead: The profiling process, while performed only once, can introduce overhead to the original application.

Future work could focus on extending Ditto to cover a wider range of hardware and software components, and further automating the process for even more complex cloud environments.

Summary updated

Abstract

We present Ditto, an automated framework for cloning end-to-end cloud applications, both monolithic and microservices, which captures I/O and network activity, as well as kernel operations, in addition to application logic. Ditto takes a hierarchical approach to application cloning, starting with capturing the dependency graph across distributed services, to recreating each tier's control/data flow, and finally generating system calls and assembly that mimics the individual applications. Ditto does not reveal the logic of the original application, facilitating publicly sharing clones of production services with hardware vendors, cloud providers, and the research community. We show that across a diverse set of single- and multi-tier applications, Ditto accurately captures their CPU and memory characteristics as well as their high-level performance metrics, is portable across platforms, and facilitates a wide range of system studies.
BibTeX
@misc{liang2022end,
  author = {Mingyu Liang and Yu Gan and Yueying Li and Carlos Torres and Abhishek Dhanotia and Mahesh Ketkar and Christina Delimitrou},
  title = {{End-to-End Application Cloning for Distributed Cloud Microservices with Ditto}},
  year = {2022},
  eprint = {2212.13867},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2212.13867},
}
Figure