Input-Based Ensemble-Learning Method for Dynamic Memory Configuration of Serverless Computing Functions

Siddharth Agarwal,Maria A. Rodriguez,Rajkumar Buyya
2024-11-12
Abstract:In today's Function-as-a-Service offerings, a programmer is usually responsible for configuring function memory for its successful execution, which allocates proportional function resources such as CPU and network. However, right-sizing the function memory force developers to speculate performance and make ad-hoc configuration decisions. Recent research has highlighted that a function's input characteristics, such as input size, type and number of inputs, significantly impact its resource demand, run-time performance and costs with fluctuating workloads. This correlation further makes memory configuration a non-trivial task. On that account, an input-aware function memory allocator not only improves developer productivity by completely hiding resource-related decisions but also drives an opportunity to reduce resource wastage and offer a finer-grained cost-optimised pricing scheme. Therefore, we present MemFigLess, a serverless solution that estimates the memory requirement of a serverless function with input-awareness. The framework executes function profiling in an offline stage and trains a multi-output Random Forest Regression model on the collected metrics to invoke input-aware optimal configurations. We evaluate our work with the state-of-the-art approaches on AWS Lambda service to find that MemFigLess is able to capture the input-aware resource relationships and allocate upto 82% less resources and save up to 87% run-time costs.
Distributed, Parallel, and Cluster Computing,Artificial Intelligence,Systems and Control
What problem does this paper attempt to address?
### Problems the paper attempts to solve This paper aims to solve the function memory configuration problem on the Function - as - a - Service (FaaS) platform in Serverless Computing. Specifically, developers usually need to manually configure the memory size of functions, which directly affects the CPU, network and other resources allocated when the function is executed. However, it is not easy to configure the memory reasonably because: 1. **Impact of input parameters**: The performance and resource requirements of a function are closely related to its input parameters (such as input size, type and quantity). Different input parameters will lead to different resource requirements and execution times. 2. **Complexity of configuration decisions**: Developers usually can only configure based on experience or speculation, which may lead to improper resource allocation, resulting in resource waste or increased execution costs. 3. **Limitations of static configuration**: The current practice is to set static memory configurations for all function calls, which will lead to performance fluctuations when facing different input parameters. Therefore, this paper proposes an input - aware - based memory configuration method to optimize function execution time and cost and reduce resource waste. By introducing the MemFigLess framework, the authors hope to achieve the following goals: - **Improve developer productivity**: By completely hiding resource - related decisions, developers do not need to worry about memory configuration. - **Optimize resource utilization**: By more accurate memory configuration, reduce resource waste. - **Provide a fine - grained cost - optimized pricing scheme**: Provide a more reasonable pricing model according to the actual resource usage. ### Overview of the solution The MemFigLess framework uses a Multi - output Random Forest Regression (RFR) model to predict the optimal memory configuration of functions. The specific steps are as follows: 1. **Offline phase**: - **Function analysis and data collection**: Through a series of experiments, collect function performance indicators (such as memory usage, execution time, etc.) under different input parameters. - **Model training**: Use the collected data to train the RFR model and learn the relationship between input parameters and memory requirements. 2. **Online phase**: - **Real - time prediction and optimization**: When there is a new function request, extract the input parameters and use the trained RFR model to predict the optimal memory configuration. - **Dynamic resource management**: Dynamically allocate resources according to the prediction results to ensure that the performance requirements are met while minimizing the cost. In this way, MemFigLess can automatically adjust the memory configuration according to the actual input parameters of the function, thereby significantly improving resource utilization and execution efficiency and reducing operating costs. ### Mathematical formula representation This problem is formalized as a Multi - objective Optimization (MOO) problem. The goal is to select the optimal memory configuration \( m \) to minimize the runtime cost \( C_f(m, P) \) and execution time \( T_f(m, P) \) under the premise of meeting the execution time and budget constraints. The mathematical representation is as follows: \[ \min_{m \in M} G(m, P)=(C_f(m, P), T_f(m, P)) \] where: - \( C_f(m, P)=T_f(m, P)\times C_m+\beta\leq B \) - \( T_f(m, P)\leq D \) - \( \text{Success}(m, P) = 1 \) Here, \( C_f(m, P) \) represents the runtime cost, \( T_f(m, P) \) represents the execution time, \( C_m \) represents the cost per unit of memory, \( \beta \) is the call cost constant, \( B \) is the budget limit, and \( D \) is the execution deadline. ### Conclusion By introducing the input - aware - based memory configuration method, the MemFigLess framework can effectively optimize the resource allocation of functions in the Serverless Computing environment, thereby improving performance and reducing costs.