Serverless Scheduling Policies based on Cost Analysis

Giuseppe De Palma,Saverio Giallorenzo,Cosimo Laneve,Jacopo Mauro,Matteo Trentin,Gianluigi Zavattaro
DOI: https://doi.org/10.4204/EPTCS.392.3
2023-10-31
Abstract:Current proprietary and open-source serverless platforms follow opinionated, hardcoded scheduling policies to deploy the functions to be executed over the available workers. Such policies may decrease the performance and the security of the application due to locality issues (e.g., functions executed by workers far from the databases to be accessed). These limitations are partially overcome by the adoption of APP, a new platform-agnostic declarative language that allows serverless platforms to support multiple scheduling logics. Defining the "right" scheduling policy in APP is far from being a trivial task since it often requires rounds of refinement involving knowledge of the underlying infrastructure, guesswork, and empirical testing. In this paper, we start investigating how information derived from static analysis could be incorporated into APP scheduling function policies to help users select the best-performing workers at function allocation. We substantiate our proposal by presenting a pipeline able to extract cost equations from functions' code, synthesising cost expressions through the usage of off-the-shelf solvers, and extending APP allocation policies to consider this information.
Programming Languages
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is the limitations of scheduling strategies in existing serverless platforms. Specifically, current serverless platforms usually use predefined and hard - coded scheduling strategies to deploy functions to available workers, and these strategies may lead to a decline in application performance and a reduction in security due to data locality issues (for example, the worker that executes the function is far from the database that needs to be accessed). To solve these problems, the author proposes a method based on static analysis information to improve the function scheduling strategy in APP (a new platform - independent declarative language). Through this method, users can select the optimal worker according to the cost expressions extracted from the function code, thereby optimizing the execution efficiency of the function. The following are the core steps of this method: 1. **Code analysis**: Define code analysis techniques to extract meaningful scheduling information from the function source code. 2. **Cost calculation**: Use existing solvers to evaluate the scheduling information and generate cost expressions. 3. **Expand APP**: Integrate cost information into APP to support allocation strategies that depend on cost expressions. ### Specific problem description On current serverless platforms, scheduling strategies are usually platform - specific and fixed, which may lead to the following problems: - **Performance degradation**: Due to data locality issues, some workers may be far from the required accessed data, resulting in high latency. - **Security issues**: Unreasonable scheduling strategies may make applications more vulnerable to attacks or resource contention. To overcome these problems, the author proposes a framework that can consider the cost information obtained from static analysis when allocating functions, thereby helping users select the best worker. ### Solution overview The solution proposed by the author includes the following aspects: 1. **Static analysis**: Extract cost - related scheduling information by statically analyzing the function code. This information can include the number of function calls, the latency of involved service calls, etc. 2. **Cost expression generation**: Use existing solver tools (such as PUBS or CoFloCo) to calculate cost expressions that quantify the cost of function execution. 3. **Expand APP language**: Introduce new scheduling strategies (such as `min_latency`) and invalid conditions (such as `max_latency`), so that APP can dynamically select the optimal worker according to the cost expressions. In this way, the author hopes to achieve more intelligent and efficient function scheduling in the serverless environment, thereby improving the overall performance and security of applications. ### Example The author shows how to apply this framework through several specific examples. For example, when processing a function with conditional branches, the system can select the optimal worker according to the actual parameter values; when processing MapReduce tasks, the system can select an appropriate worker according to the expected total latency to ensure the shortest overall execution time. In summary, this paper aims to solve the deficiencies of scheduling strategies in existing serverless platforms by introducing cost - aware scheduling strategies based on static analysis, thereby improving the performance and security of applications.