Introduction
Serverless computing, or Function-as-a-Service (FaaS), has revolutionized cloud application development by abstracting infrastructure management. However, a significant inefficiency persists in how resources are allocated. Most major cloud providers currently employ a "coupled" resource model, where developers specify a memory limit, and the provider automatically scales CPU and network bandwidth proportionally. This approach often leads to significant over-provisioning, particularly for tasks that are either highly CPU-intensive or memory-intensive but not both.
The Resource Configuration Challenge
In complex serverless workflows—represented as Directed Acyclic Graphs (DAGs)—the problem of resource allocation is compounded. When resources are decoupled (allowing independent selection of CPU and memory), the configuration space grows exponentially. For a workflow with multiple functions, finding the optimal balance between performance (meeting Service Level Objectives or SLOs) and cost becomes a "curse of dimensionality" problem. Traditional optimization techniques, such as Bayesian Optimization (BO), often prove too slow, unstable, or fail to converge in these high-dimensional spaces.
The AARC Framework
To address these challenges, we introduce AARC (Automated Affinity-aware Resource Configuration). AARC is an automated framework designed to optimize serverless workflows by decoupling resources and employing a targeted search strategy.
1. Graph-Centric Scheduler
AARC begins by profiling the workflow to identify the critical path—the specific sequence of functions that dictates the overall execution time. By focusing on the critical path, the framework can prioritize resource adjustments where they matter most. The scheduler converts the workflow into a weighted DAG and establishes "sub-SLOs" for non-critical branches, ensuring that optimizations in one area do not create new bottlenecks elsewhere.
2. Priority Configurator
Rather than relying on black-box optimization or random sampling, AARC utilizes a priority-based heuristic search. The configurator maintains a priority queue of potential resource adjustments (e.g., reducing CPU allocation by a specific increment). It iteratively "deallocates" resources from functions where the cost-to-performance trade-off is most favorable. To maintain stability, AARC employs an exponential backoff mechanism; if a resource reduction violates the SLO or increases the total cost, the search step is refined, ensuring rapid convergence to an optimal state.
3. Input-Aware Configuration
Recognizing that resource requirements often vary with input data (e.g., processing a 4K video versus a 720p video), AARC includes an Input-Aware Configuration Engine. This component analyzes input metadata to select the most appropriate pre-calculated configuration for the specific task, further refining cost-efficiency.
Experimental Evaluation
AARC was evaluated using three representative real-world serverless workflows:
- Chatbot: Parallel intent detection and remote storage operations.
- ML Pipeline: A sequence involving dimensionality reduction (PCA), model training, and testing.
- Video Analysis: A pipeline for video splitting, frame extraction, and classification.
The framework was compared against two state-of-the-art baselines: Bayesian Optimization (BO) and MAFF (a gradient-descent-based method).
Key Results
The evaluation demonstrated that AARC significantly outperforms existing methods across several metrics:
- Search Efficiency: AARC reduced the configuration search time by 85.8% compared to BO and 89.6% compared to MAFF. This rapid convergence makes it viable for production environments where workflows change frequently.
- Cost Reduction: By decoupling resources, AARC achieved substantial cost savings—up to 49.6% for the ML Pipeline and 61.7% for the Video Analysis workflow. In the ML Pipeline specifically, decoupling allowed for an 87.5% reduction in memory usage without impacting runtime.
- SLO Compliance: AARC maintained 100% SLO compliance throughout the testing process. Its heuristic approach allows it to intelligently revert resource cuts that threaten performance targets, a feat that gradient-based methods often struggle to achieve.
- Input Sensitivity: For the Video Analysis workflow, the input-aware plugin optimized costs by nearly 90% for lighter workloads compared to static configuration strategies.
Conclusion and Future Work
AARC demonstrates that decoupling CPU and memory resources is essential for cost-effective serverless computing. By leveraging the structural properties of workflow DAGs and employing a priority-based heuristic, AARC overcomes the limitations of traditional optimization methods.
While current cloud provider APIs often limit the immediate deployment of decoupled configurations, AARC provides a compelling case for more flexible resource models. Future research will explore the impact of decoupled configurations on "cold start" latencies and investigate dynamic intra-workflow scaling to mitigate the effects of transient cloud noise.
Summary updated