Serverless computing is a recently introduced deployment model to provide cloud services. The autoscaling of function instances allows adapting allocated resources to workload, so as to reduce latency and improve resource usage efficiency. However, autoscaling mechanisms could be affected by undesired ‘cold starts’ events, causing latency peaks due to spawning of new instances, which can be critical in edge deployments where applications are typically sensitive to latency. In order to regulate autoscaling of functions and mitigate the latency for accessing services, which may hinder the adoption of the serverless model in edge computing, we resort to the usage of reinforcement learning. Our experimental system is based on OpenFaaS, the most popular open-source Kubernetes-based serverless platform. In this system, we introduce a Q-Learning (QL) agent to dynamically configure the Kubernetes Horizontal Pod Autoscaler (HPA). This is accomplished via a QL model state space and a reward function definition that enforce service level agreement (SLA) compliance, in terms of latency, without allocating excessive resources. The agent is trained and tested using real serverless function invocation patterns, made available by Microsoft Azure. The experimental results show the benefits provided by the proposed solution over state-of-the-art in terms of compliance to the SLA, while limiting resource consumption and service request losses.
Management of autoscaling serverless functions in edge computing via Q-Learning
Benedetti P.Software
;Femminella M.
Conceptualization
;Reali G.Writing – Review & Editing
2026
Abstract
Serverless computing is a recently introduced deployment model to provide cloud services. The autoscaling of function instances allows adapting allocated resources to workload, so as to reduce latency and improve resource usage efficiency. However, autoscaling mechanisms could be affected by undesired ‘cold starts’ events, causing latency peaks due to spawning of new instances, which can be critical in edge deployments where applications are typically sensitive to latency. In order to regulate autoscaling of functions and mitigate the latency for accessing services, which may hinder the adoption of the serverless model in edge computing, we resort to the usage of reinforcement learning. Our experimental system is based on OpenFaaS, the most popular open-source Kubernetes-based serverless platform. In this system, we introduce a Q-Learning (QL) agent to dynamically configure the Kubernetes Horizontal Pod Autoscaler (HPA). This is accomplished via a QL model state space and a reward function definition that enforce service level agreement (SLA) compliance, in terms of latency, without allocating excessive resources. The agent is trained and tested using real serverless function invocation patterns, made available by Microsoft Azure. The experimental results show the benefits provided by the proposed solution over state-of-the-art in terms of compliance to the SLA, while limiting resource consumption and service request losses.I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.


