Affinity-aware Serverless Function Scheduling
Giuseppe De Palma, Saverio Giallorenzo, Jacopo Mauro, Matteo Trentin, Gianluigi Zavattaro
TL;DR
This work addresses the lack of native affinity-aware scheduling in serverless platforms by extending the Allocation Priority Policies (APP) language to a affinity-aware variant, aAPP, and implementing it on Apache OpenWhisk. The authors formalize the syntax and semantics of aAPP, enabling directional affinity and anti-affinity constraints alongside standard scheduling features. They demonstrate feasibility with a prototype OpenWhisk extension, including parser and load balancer enhancements and runtime tracking of function placements to enforce policies. Experimental results show that affinity-aware scheduling can reduce average and tail latency and decrease database-access retries in co-tenant environments, while introducing negligible overhead compared to vanilla OpenWhisk and APP-based variants. The work positions affinity-aware FaaS as a viable mechanism to improve performance and isolation in serverless deployments and outlines clear avenues for broader platform support and further optimization.
Abstract
Functions-as-a-Service (FaaS) is a Serverless Cloud paradigm where a platform manages the scheduling (e.g., resource allocation, runtime environments) of stateless functions. Recent work proposed using domain-specific languages to express per-function policies, e.g., policies that enforce the allocation on nodes that enjoy lower latencies to databases and services used by the function. Here, we focus on affinity-aware scenarios, i.e., where, for performance and functional requirements, the allocation of a function depends on the presence/absence of other functions on nodes. We present aAPP, an extension of a declarative, platform-agnostic language that captures affinity-aware scheduling at the FaaS level. We implement an aAPP-based prototype on Apache OpenWhisk. Besides proving that a FaaS platform can capture affinity awareness using aAPP and improve performance in affinity-aware scenarios, we use our prototype to show that aAPP imposes no noticeable overhead in scenarios without affinity constraints.
