Application of Proximal Policy Optimization for Resource Orchestration in Serverless Edge Computing
<p>General model of a controlled serverless computing cluster.</p> "> Figure 2
<p>Performance of the baseline system without the reinforcement learning in terms of (<b>a</b>) service latency, (<b>b</b>) resource utilization (CPU), and (<b>c</b>) fraction of lost requests.</p> "> Figure 3
<p>Performance of PPO-driven serverless edge system in terms of service latency as a function of the value of CPU <tt>limits</tt> for both (<b>a</b>) training and (<b>b</b>) test.</p> "> Figure 4
<p>Performance of PPO-driven serverless edge system in terms of fraction of lost service requests as a function of the value of CPU <tt>limits</tt> for both (<b>a</b>) training and (<b>b</b>) test.</p> "> Figure 5
<p>Average value of the HPA threshold in the PPO-driven serverless edge system as a function of the value of CPU <tt>limits</tt> for both (<b>a</b>) training and (<b>b</b>) test.</p> "> Figure 6
<p>Performance of PPO-driven serverless edge system in terms of CPU utilization efficiency as a function of the value of CPU <tt>limits</tt> for both (<b>a</b>) training and (<b>b</b>) test.</p> "> Figure 7
<p>Boxplot of service latency for PPO-driven serverless edge system (CPU <tt>limits</tt> set to 500 m, <math display="inline"><semantics> <mrow> <msub> <mo>Δ</mo> <mi>S</mi> </msub> <mo>=</mo> <mn>30</mn> </mrow> </semantics></math> s) as a function of the discount factor <math display="inline"><semantics> <mi>γ</mi> </semantics></math> in the test phase.</p> "> Figure 8
<p>CPU utilization efficiency for PPO-driven serverless edge system (CPU <tt>limits</tt> set to 500 m, <math display="inline"><semantics> <mrow> <msub> <mo>Δ</mo> <mi>S</mi> </msub> <mo>=</mo> <mn>30</mn> </mrow> </semantics></math> s) as a function of the discount factor <math display="inline"><semantics> <mi>γ</mi> </semantics></math> for both training and test phases.</p> ">
Abstract
:1. Introduction
- It highlights the typical problems to be addressed in edge systems when computing resources are managed through serverless technologies.
- It proposes a control system based on PPO to increase efficiency without penalizing latency.
- It compares the achievable performance of the proposal with a baseline system based on default Kubernetes parameters and comments critically on the results according to the dynamics of function invocations.
2. Background on Serverless Computing
- Computing cluster: This cluster is made of physical computing servers. In our experiments, we use just one server, which represents an IoT edge computing system. Clearly, it is necessary to deploy functions with an appropriate degree of isolation. In our system, they are deployed in containers implemented through the containerd runtime. Such containers are orchestrated through Kubernetes. For this reason, containers are included in Kubernetes . If there are function replicas running in the computing cluster, it is possible to assume that the service requests are equally distributed to these pods.
- Scheduler: This element is responsible for finding the most suitable node for a newly create pod to run on.
- Metrics Server: The role of this element is to collect resource metrics, such as memory and CPU load. These metrics are stored in a Log Repository made available to the HPA.
- Horizontal Pod Autoscaler (HPA): This element controls the number of active function replicas, and hence the number of running pods that implement the considered function. Therefore, the HPA allows the workload of each pod to be controlled in order to to match the desired load of computing cores. Thus, when the incoming load increases, the HPA instructs the controller to increase the number of running pods, and, when the load decreases, they are scaled back until the configured minimum number is reached. The HPA behavior can be influenced by some configuration parameters, in particular, the CPU threshold values for scaling the number of function instances up and down and their maximum and minimum values. To highlight their importance, we included a Configuration Parameters box in Figure 1.
- Controller Manager: This component manages the pod life cycle. It controls their status and enforces the instantiation of the number of running replicas received from the HPA.
3. Related Work
4. Reinforcement Learning Model
4.1. Basic Concepts of Bellman’s Equation
4.2. Proximal Policy Optimization
4.3. Proposed System Model
- 1.
- Mean response latency to a request issued to a running function during a time step ();
- 2.
- HPA CPU threshold value in percent (Threshold, as in (1));
- 3.
- Number of function replicas within the cluster, evaluated as in (1);
- 4.
- Total usage of CPU by all active replicas in one minute, retrieved by the Metrics Server as ;
- 5.
- Total usage of RAM by all active replicas in one minute, retrieved by the Metrics Server as ;
- 6.
- Average CPU usage in percent () with respect to the guaranteed resources (requests), used as currentMetricValue for evaluating the number of replicas in (1);
- 7.
- Average RAM usage () with respect to the guaranteed resources (requests) in percent;
- 8.
- Number of requests received in a time step ;
- 9.
- Success rate of requests , that is, the fraction of correctly served during the observed time step;
- 10.
- Cosine of the angle computed using the current minute of the day;
- 11.
- Sine of the angle computed using the current minute of the day.
5. Experimental Results
5.1. System Architecture and Testbed Technologies
5.2. Numerical Results
- requests: memory: “100 MB”, CPU: “100 m”;
- limits: values are reported in Table 3.
6. Conclusions
Supplementary Materials
Author Contributions
Funding
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- ETSI. Multi-Access Edge Computing (MEC); Framework and Reference Architecture. In ETSI ISG MEC, ETSI GS MEC 003 V2.1.1; ETSI: Valbonne, France, 2023. [Google Scholar]
- Hassan, N.; Yau, K.L.A.; Wu, C. Edge Computing in 5G: A Review. IEEE Access 2019, 7, 127276–127289. [Google Scholar] [CrossRef]
- Li, Q.; Ding, Z.; Tong, X.; Wu, G.; Stojanovski, S.; Luetzenkirchen, T.; Kolekar, A.; Bangolae, S.; Palat, S. 6G Cloud-Native System: Vision, Challenges, Architecture Framework and Enabling Technologies. IEEE Access 2022, 10, 96602–96625. [Google Scholar] [CrossRef]
- Hong, C.H.; Varghese, B. Resource Management in Fog/Edge Computing: A Survey on Architectures, Infrastructure, and Algorithms. ACM Comput. Surv. 2019, 52, 1–37. [Google Scholar] [CrossRef]
- Kleinrock, L. Theory, Volume 1, Queueing Systems; Wiley-Interscience: Hoboken, NJ, USA, 1975. [Google Scholar]
- Aslanpour, M.S.; Toosi, A.N.; Cicconetti, C.; Javadi, B.; Sbarski, P.; Taibi, D.; Assuncao, M.; Gill, S.S.; Gaire, R.; Dustdar, S. Serverless Edge Computing: Vision and Challenges. In Proceedings of the 2021 Australasian Computer Science Week Multiconference, Dunedin, New Zealand, 1–5 February 2021. ACSW’21. [Google Scholar] [CrossRef]
- Raith, P.; Nastic, S.; Dustdar, S. Serverless Edge Computing—Where We Are and What Lies Ahead. IEEE Internet Comput. 2023, 27, 50–64. [Google Scholar] [CrossRef]
- Benedetti, P.; Femminella, M.; Reali, G.; Steenhaut, K. Reinforcement Learning Applicability for Resource-Based Auto-scaling in Serverless Edge Applications. In Proceedings of the 2022 IEEE International Conference on Pervasive Computing and Communications Workshops and other Affiliated Events (PerCom Workshops), Pisa, Italy, 21–25 March 2022; pp. 674–679. [Google Scholar] [CrossRef]
- OpenFaaS: Open Function as a Service. Available online: https://www.openfaas.com/ (accessed on 22 July 2024).
- Nguyen, T.T.; Yeom, Y.J.; Kim, T.; Park, D.H.; Kim, S. Horizontal Pod Autoscaling in Kubernetes for Elastic Container Orchestration. Sensors 2020, 20, 4621. [Google Scholar] [CrossRef] [PubMed]
- Kubernetes Horizontal Pod Autoscaler. Available online: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ (accessed on 22 July 2024).
- Wang, L.; Li, M.; Zhang, Y.; Ristenpart, T.; Swift, M. Peeking Behind the Curtains of Serverless Platforms. In Proceedings of the 2018 USENIX Annual Technical Conference (USENIX ATC 18), Boston, MA, USA, 11–13 July 2018; pp. 133–146. [Google Scholar]
- Shahrad, M.; Fonseca, R.; Goiri, I.; Chaudhry, G.; Batum, P.; Cooke, J.; Laureano, E.; Tresness, C.; Russinovich, M.; Bianchini, R. Serverless in the Wild: Characterizing and Optimizing the Serverless Workload at a Large Cloud Provider. In Proceedings of the 2020 USENIX Annual Technical Conference (USENIX ATC 20), USENIX Association, Online, 15–17 July 2020; pp. 205–218. [Google Scholar]
- Mohanty, S.K.; Premsankar, G.; di Francesco, M. An Evaluation of Open Source Serverless Computing Frameworks. In Proceedings of the 2018 IEEE International Conference on Cloud Computing Technology and Science (CloudCom), Nicosia, Cyprus, 10–13 December 2018; pp. 115–120. [Google Scholar] [CrossRef]
- Palade, A.; Kazmi, A.; Clarke, S. An Evaluation of Open Source Serverless Computing Frameworks Support at the Edge. In Proceedings of the 2019 IEEE World Congress on Services (SERVICES), Milan, Italy, 8–13 July 2019; Volume 2642-939X, pp. 206–211. [Google Scholar] [CrossRef]
- Javed, H.; Toosi, A.; Aslanpour, M.S. Serverless Platforms on the Edge: A Performance Analysis. In New Frontiers in Cloud Computing and Internet of Things; Springer: Cham, Swizerland, 2022; pp. 165–184. [Google Scholar] [CrossRef]
- Balla, D.; Maliosz, M.; Simon, C. Open Source FaaS Performance Aspects. In Proceedings of the 2020 43rd International Conference on Telecommunications and Signal Processing (TSP), Milan, Italy, 7–9 July 2020; pp. 358–364. [Google Scholar] [CrossRef]
- Li, J.; Kulkarni, S.G.; Ramakrishnan, K.K.; Li, D. Understanding Open Source Serverless Platforms: Design Considerations and Performance. In Proceedings of the 5th International Workshop on Serverless Computing, Davis, CA, USA, 9–13 December 2019; WOSC’19; pp. 37–42. [Google Scholar] [CrossRef]
- Ascigil, O.; Tasiopoulos, A.; Phan, T.; Sourlas, V.; Psaras, I.; Pavlou, G. Resource Provisioning and Allocation in Function-as-a-Service Edge-Clouds. IEEE Trans. Serv. Comput. 2021, 15, 2410–2424. [Google Scholar] [CrossRef]
- Pinto, D.; Dias, J.P.; Sereno Ferreira, H. Dynamic Allocation of Serverless Functions in IoT Environments. In Proceedings of the 2018 IEEE 16th International Conference on Embedded and Ubiquitous Computing (EUC), Bucharest, Romania, 29–31 October 2018; pp. 1–8. [Google Scholar] [CrossRef]
- Mahmoudi, N.; Khazaei, H. Performance Modeling of Serverless Computing Platforms. IEEE Trans. Cloud Comput. 2022, 10, 2834–2847. [Google Scholar] [CrossRef]
- Femminella, M.; Reali, G. Comparison of Reinforcement Learning Algorithms for Edge Computing Applications Deployed by Serverless Technologies. Algorithms 2024, 17, 320. [Google Scholar] [CrossRef]
- Sheng, S.; Chen, P.; Chen, Z.; Wu, L.; Yao, Y. Deep Reinforcement Learning-Based Task Scheduling in IoT Edge Computing. Sensors 2021, 21, 1666. [Google Scholar] [CrossRef] [PubMed]
- Arabnejad, H.; Pahl, C.; Jamshidi, P.; Estrada, G. A Comparison of Reinforcement Learning Techniques for Fuzzy Cloud Auto-Scaling. In Proceedings of the 2017 17th IEEE/ACM International Symposium on Cluster, Cloud and Grid Computing (CCGRID), Madrid, Spain, 14–17 May 2017. [Google Scholar] [CrossRef]
- Rossi, F.; Nardelli, M.; Cardellini, V. Horizontal and Vertical Scaling of Container-Based Applications Using Reinforcement Learning. In Proceedings of the 2019 IEEE 12th International Conference on Cloud Computing (CLOUD), Milan, Italy, 8–13 July 2019; pp. 329–338. [Google Scholar]
- Horovitz, S.; Arian, Y. Efficient Cloud Auto-Scaling with SLA Objective Using Q-Learning. In Proceedings of the 2018 IEEE 6th International Conference on Future Internet of Things and Cloud (FiCloud), Barcelona, Spain, 6–8 August 2018; pp. 85–92. [Google Scholar] [CrossRef]
- Toka, L.; Dobreff, G.; Fodor, B.; Sonkoly, B. Machine Learning-Based Scaling Management for Kubernetes Edge Clusters. IEEE Trans. Netw. Serv. Manag. 2021, 18, 958–972. [Google Scholar] [CrossRef]
- Schuler, L.; Jamil, S.; Kuhl, N. AI-based Resource Allocation: Reinforcement Learning for Adaptive Auto-scaling in Serverless Environments. In Proceedings of the 2021 IEEE/ACM 21st International Symposium on Cluster, Cloud and Internet Computing (CCGrid), Los Alamitos, CA, USA, 10–13 May 2021; pp. 804–811. [Google Scholar] [CrossRef]
- Zafeiropoulos, A.; Fotopoulou, E.; Filinis, N.; Papavassiliou, S. Reinforcement learning-assisted autoscaling mechanisms for serverless computing platforms. Simul. Model. Pract. Theory 2022, 116, 102461. [Google Scholar] [CrossRef]
- Kubeless. Available online: https://github.com/vmware-archive/kubeless (accessed on 22 July 2024).
- Mampage, A.; Karunasekera, S.; Buyya, R. A Deep Reinforcement Learning based Algorithm for Time and Cost Optimized Scaling of Serverless Applications. arXiv 2023. [Google Scholar] [CrossRef]
- Agarwal, S.; Rodriguez, M.A.; Buyya, R. A Deep Recurrent-Reinforcement Learning Method for Intelligent AutoScaling of Serverless Functions. IEEE Trans. Serv. Comput. 2024, 1–12. [Google Scholar] [CrossRef]
- Sutton, R.S.; Barto, A.G. Reinforcement Learning: An Introduction; A Bradford Book: Cambridge, MA, USA, 2018. [Google Scholar]
- Bellman, R.E. Dynamic Programming; Princeton University Press: Princeton, NJ, USA, 1957. [Google Scholar]
- Lee, G.H.; Park, H.; Jang, J.W.; Han, J.; Choi, J.K. PPO-Based Autonomous Transmission Period Control System in IoT Edge Computing. IEEE Internet Things J. 2023, 10, 21705–21720. [Google Scholar] [CrossRef]
- Zhang, R.; Xiong, K.; Lu, Y.; Fan, P.; Ng, D.W.K.; Letaief, K.B. Energy Efficiency Maximization in RIS-Assisted SWIPT Networks With RSMA: A PPO-Based Approach. IEEE J. Sel. Areas Commun. 2023, 41, 1413–1430. [Google Scholar] [CrossRef]
- Stable-Baselines3 Library. Available online: https://stable-baselines3.readthedocs.io/en/master/ (accessed on 22 July 2024).
- Gymnasium Library. Available online: https://gymnasium.farama.org/index.html (accessed on 22 July 2024).
- PyTorch Library. Available online: https://pytorch.org/ (accessed on 22 July 2024).
- Hey traffic Generator. Available online: https://github.com/rakyll/hey (accessed on 22 July 2024).
- Azure Functions Trace. Available online: https://github.com/Azure/AzurePublicDataset (accessed on 22 July 2024).
- OpenFaaS of-Watchdog. Available online: https://github.com/openfaas/of-watchdog (accessed on 22 July 2024).
- HPA Should Use the Limits Instead of Requests. Available online: https://github.com/kubernetes/kubernetes/issues/108026 (accessed on 22 July 2024).
- Horizontal Pod Autoscaler Should Use Resource Limit as Its Base for Calculation. Available online: https://github.com/kubernetes/kubernetes/issues/72811 (accessed on 22 July 2024).
- Completely Fair Scheduler. Available online: https://docs.kernel.org/scheduler/sched-design-CFS.html (accessed on 22 July 2024).
Device | CPU | RAM | Storage | OS | Software |
---|---|---|---|---|---|
Dell PowerEdge R630 1.3.6 (Tardis) | Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30 GHz: 40 threads | 64 GB @2133 MT/s | 279 GB (local) + 8 TB remote target iSCSI | Ubuntu 20.04 LTS | KVM + iSCSI client |
Dell PowerEdge R630 2.4.3 (Saul) | Intel(R) Xeon(R) CPU E5-2640 v4 @ 2.40 GHz: 40 threads | 128 GB @2133 MT/s | 279 GB (local) + 8 TB remote target iSCSI | Ubuntu 20.04 LTS | KVM + iSCSI client |
NAS QNAP TS-EC1280U (Hulk) | Intel(R) Xeon(R) CPU E3-1246 v3 @ 3.50 GHz: 8 threads | 4 GB | 72 TB (9 × 8 TB 3.5″ HDDs) | Firmware QTS 5.1.7.2770 | SW for implementing iSCSI LUN (local unit number) |
VM 1 (k8s Master) | 4 vCPUs | 12 GB | 100 GB | Ubuntu 22.04.2 LTS | Kubernetes master SW, Docker, OpenFaaS, Python 3, StableBaseline3, Hey |
VM 2 (k8s Worker) | 24 vCPUs | 32 GB | 100 GB | Ubuntu 22.04.2 LTS | Kubernetes worker SW, Docker |
Hyperparameter | Value |
---|---|
Learning rate, | 0.0003 |
Entropy coefficient, | 0.001 |
Discount factor, | 0.7–0.99 |
Batch size for gradient update (mini-batch) | 10 |
Number of steps per episode, T | 10 |
Limits Configuration | HPA 120 | HPA 250 | HPA 500 | HPA 750 | HPA 1000 |
---|---|---|---|---|---|
CPU (millicores) | 120 | 250 | 500 | 750 | 1000 |
Memory (MB) | 120 | 250 | 500 | 750 | 1000 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Femminella, M.; Reali, G. Application of Proximal Policy Optimization for Resource Orchestration in Serverless Edge Computing. Computers 2024, 13, 224. https://doi.org/10.3390/computers13090224
Femminella M, Reali G. Application of Proximal Policy Optimization for Resource Orchestration in Serverless Edge Computing. Computers. 2024; 13(9):224. https://doi.org/10.3390/computers13090224
Chicago/Turabian StyleFemminella, Mauro, and Gianluca Reali. 2024. "Application of Proximal Policy Optimization for Resource Orchestration in Serverless Edge Computing" Computers 13, no. 9: 224. https://doi.org/10.3390/computers13090224
APA StyleFemminella, M., & Reali, G. (2024). Application of Proximal Policy Optimization for Resource Orchestration in Serverless Edge Computing. Computers, 13(9), 224. https://doi.org/10.3390/computers13090224