AARC: Automated Affinity-aware Resource Configuration for Serverless Workflows

Lingxiao Jin, Zinuo Cai, Zebin Chen, Hongyu Zhao, Ruhui Ma

TL;DR

AARC is an automated framework designed to optimize serverless workflows by decoupling CPU and memory allocations, breaking away from traditional rigid resource-coupling models. By combining a graph-centric scheduler to isolate critical paths with a priority-based resource configurator, AARC slashes configuration search times by up to 89% and cuts execution costs by up to 61% while strictly honoring latency deadlines (SLOs).

What Problem Does This Paper Address?

In serverless computing (Function-as-a-Service or FaaS), cloud providers traditionally couple CPU and memory allocation. For instance, in AWS Lambda, allocating more memory proportionally scales up the allocated vCPU. However, many modern serverless applications are asymmetric. A machine learning training function might be highly compute-intensive but require very little memory, forcing developers to over-provision expensive memory just to get adequate CPU performance.

While decoupling CPU and memory resources offers a clear path to cost savings, it introduces a massive challenge: it exponentially expands the configuration search space. When individual functions are chained together into complex serverless workflows—represented as Directed Acyclic Graphs (DAGs)—finding the optimal resource mix for every single function becomes an intractable search problem. Existing optimization techniques, such as Bayesian Optimization or gradient descent, either take too long to converge or easily get trapped in local optima, resulting in high search overhead and unstable performance.

Methods

The authors introduce AARC (Automated Affinity-aware Resource Configuration), a framework that bypasses brute-force search by leveraging a smart heuristic approach divided into two main components:

  1. Graph-Centric Scheduler: AARC first profiles the user's workflow using dummy inputs to calculate the baseline execution time of each function. It converts the workflow into a weighted DAG and extracts the critical path—the longest chain of dependent functions that dictates the overall end-to-end latency. It then isolates non-critical sub-paths and calculates sub-SLOs for them based on the remaining "slack time."
  2. Priority Configurator: Instead of optimizing all functions simultaneously, the framework uses a priority queue to iteratively adjust resource allocations along the identified paths. It systematically deallocates resources (reducing CPU or memory step-by-step) to minimize cost. If an adjustment violates the workflow's SLO or triggers an Out-Of-Memory (OOM) error, an exponential backoff mechanism reverts the change and fine-tunes the step size to guarantee convergence.

AARC also includes an Input-Aware Configuration Engine Plugin to handle input-sensitive workflows, dynamically routing incoming requests to different optimal configurations based on data characteristics (like video bitrate or size).

Fig. 4: System Architecture.

Datasets

The framework was evaluated using three realistic serverless workflows from popular benchmarks, chosen to reflect distinct structural and communication patterns:

  • Chatbot Workflow: Processes user inputs and trains intent classifiers in parallel (Scatter pattern).
  • ML Pipeline Workflow: Performs dimensionality reduction (PCA), model training, and testing (Broadcast pattern).
  • Video Analysis Workflow: Splits input videos, extracts keyframes, and performs classification (Sequential/Scatter pattern).

No new datasets or benchmarks were introduced; the authors relied on these established open-source serverless application structures.

Key Insights and Ideas

  • The Cost of Coupled Resources: The authors show that for compute-heavy tasks like the ML Pipeline, traditional memory-centric scaling wastes up to 87.5% of memory resources because the function only scales effectively with more vCPUs.
  • Divide and Conquer via Critical Paths: Trying to optimize a multi-function workflow all at once leads to a combinatorial explosion. AARC's "aha moment" is realizing that by optimizing the critical path first, the remaining sub-paths can be configured within strict sub-latency boundaries without risking overall SLO violations.
  • The Failure of Black-Box Optimization: Extending standard Bayesian Optimization to workflows results in extreme instability. In testing, a 100-round sampling run failed to converge, fluctuated wildly, and took nearly 10 hours of runtime, proving that workflows require structure-aware heuristics rather than pure statistical black-box models.

Key Results

  • Search Time Reduction: During the resource discovery phase, AARC reduced total search runtime by 85.8% compared to Bayesian Optimization and 89.6% compared to MAFF (a gradient-descent baseline).
  • Drastic Cost Savings: AARC achieved execution cost savings of 49.6% over Bayesian Optimization and 61.7% over MAFF for the ML Pipeline workflow.
  • Strict SLO Compliance: Across 100 test executions of the optimized configurations, AARC consistently met end-to-end latency targets with zero SLO violations.
  • Input-Sensitive Gains: With the input-aware plugin enabled on the Video Analysis workflow, AARC optimized costs by 89.9% under light inputs compared to static configuration baselines.

Limitations and Future Work

  • Profiling Dependency: AARC relies on an initial profiling step with dummy inputs to establish the weights of the DAG. If production workloads exhibit highly unpredictable or wildly fluctuating execution paths that differ from the profiling phase, the initial critical path calculation might become inaccurate.
  • Upfront Overhead for Input Tiers: The input-aware plugin successfully mitigates data sensitivity but requires separate profiling runs for different input tiers (light, middle, heavy) beforehand.
  • Future Directions: The authors note that future iterations could integrate continuous, low-overhead online learning mechanisms to adapt to shifting workload patterns dynamically without relying heavily on offline profiling.

Summary updated

BibTeX
@inproceedings{jin2025aarc,
  author = {Lingxiao Jin and Zinuo Cai and Zebin Chen and Hongyu Zhao and Ruhui Ma},
  title = {{AARC: Automated Affinity-aware Resource Configuration for Serverless Workflows}},
  booktitle = {DAC},
  year = {2025},
  doi = {10.1109/dac63849.2025.11132894},
}
Figure