On the Throughput Optimization in Large-scale Batch-processing Systems

Sounak Kar, Robin Rehrmann, Arpan Mukhopadhyay, Bastian Alt, Florin Ciucu, Heinz Koeppl, Carsten Binnig, Amr Rizk

Abstract

In large-scale data systems, service batching is a critical technique for amortizing fixed overhead costs across multiple tasks. However, determining the optimal batch size involves a complex tradeoff between reducing overhead and preventing server idling. Traditional stochastic models, such as Markov chains, suffer from state-space explosion, making optimization computationally prohibitive for large systems. This paper introduces a mean-field model that approximates these stochastic processes with deterministic ordinary differential equations (ODEs). By proving the existence of a globally attractive stationary point, we derive a closed-form solution for throughput optimization. This approach reduces the computational complexity of finding the optimal batch size from $O(n^4)$ to $O(1)$, enabling near-instantaneous tuning for high-concurrency environments.

Introduction

Modern commercial databases and large-scale batch-processing systems frequently employ "service batching" to enhance performance. By grouping $k$ individual queries or jobs into a single execution unit, systems can significantly reduce the per-job overhead associated with task initialization and context switching. This creates a "speedup" effect where the marginal cost of processing decreases as the batch size increases.

Despite these benefits, batching introduces a significant challenge: the "Goldilocks" problem of batch size selection. If the batch size $k$ is too small, the system is overwhelmed by fixed overhead costs. Conversely, if $k$ is too large, servers may sit idle while waiting for enough jobs to arrive to form a complete batch, leading to underutilization and increased latency. Finding the exact point where throughput is maximized is a non-trivial optimization problem that has historically required either computationally expensive simulations or lengthy empirical testing.

The Computational Barrier

Standard mathematical approaches to this problem typically rely on Markov chain modeling. While accurate, these models are plagued by the "state-space explosion" problem. As the number of clients ($n$) and servers ($m$) grows, the number of possible states in the system increases exponentially. Calculating the optimal batch size in these regimes often requires $O(n^4)$ time, which is impractical for real-time system tuning. Consequently, many production systems currently rely on multi-day empirical searches to find sub-optimal batch sizes through trial and error.

Methodology: The Mean-Field Approximation

To overcome these computational limits, this research proposes a shift from stochastic modeling to mean-field theory. The core insight is that as a system scales up, the random fluctuations of individual clients begin to cancel each other out. The aggregate behavior of the system converges toward a predictable, deterministic path.

1. Stochastic to Deterministic Mapping

Instead of tracking the state of every individual client, the model tracks the fraction of clients in various states (e.g., waiting, being served, or idling). This allows the system's dynamics to be described using a set of Ordinary Differential Equations (ODEs).

2. Global Attraction and Stability

A critical contribution of this work is the mathematical proof that these ODEs possess a unique stationary point that is "globally attractive." Regardless of the system's initial state, it will naturally settle into this predictable equilibrium. This stability ensures that the mean-field approximation is a reliable proxy for long-term system throughput.

3. $O(1)$ Optimization

By analyzing the stationary point of the ODEs, the researchers derived a closed-form equation that characterizes throughput as a function of batch size. Solving this equation to find the optimal $k$ takes constant time—$O(1)$—regardless of whether the system has ten clients or ten thousand. This represents a massive leap in efficiency over traditional $O(n^4)$ methods.

Experimental Validation

The model was validated through two distinct lenses: synthetic simulations and real-world database benchmarks.

  • Synthetic Simulations: These tests confirmed that the mean-field approximation becomes increasingly accurate as the system size grows. Even in relatively small "finite" regimes (e.g., 100–300 clients), the model's predictions almost perfectly overlapped with fine-grained stochastic simulations.
  • TATP Benchmark: Using the Telecommunication Application Transaction Processing (TATP) benchmark on a research prototype of a commercial in-memory database, the authors tested the model against real SQL query patterns. The model successfully predicted the performance of operations like GET_SUBSCRIBER_DATA and DELETE_CALL_FORWARDING under varying batch sizes.

One counter-intuitive result confirmed by the model is that increasing the number of available servers can actually decrease the optimal batch size. This occurs because a larger pool of servers requires more frequent batches to keep all units busy; if the batch size remains too high, servers spend too much time idling, waiting for batches to fill.

Insights and Future Work

The research demonstrates that mean-field models are not just theoretical curiosities but practical tools for systems engineering. They provide a rigorous way to quantify the idling tradeoff and work across various "speedup" behaviors, whether the efficiency gains from batching are linear, logarithmic, or follow a power law.

However, some limitations remain. The current model assumes that job arrivals and service times follow exponential distributions. While this is a common assumption in queueing theory, real-world "bursty" traffic may require more sophisticated distribution modeling. Additionally, the current work focuses on single-stage service stations. Future research will look toward multi-stage data pipelines and "dynamic batching," where the system adjusts $k$ in real-time based on fluctuating traffic loads.

By reducing the optimization of batch-processing systems to a simple calculation, this work paves the way for self-tuning databases and more efficient cloud infrastructure.

Summary updated

BibTeX
@inproceedings{kar2020throughput,
  author = {Sounak Kar and Robin Rehrmann and Arpan Mukhopadhyay and Bastian Alt and Florin Ciucu and Heinz Koeppl and Carsten Binnig and Amr Rizk},
  title = {{On the Throughput Optimization in Large-scale Batch-processing Systems}},
  booktitle = {Perform. Evaluation},
  year = {2020},
  doi = {10.1016/j.peva.2020.102142},
}
Figure