Skip to main content

MAFF: Self-adaptive Memory Optimization for Serverless Functions

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 13226))

Abstract

Function-as-a-Service (FaaS), a key enabler of serverless computing, has been proliferating, as it offers a cheap alternative for application development and deployment. However, while offering many advantages, FaaS also poses new challenges. In particular, most commercial FaaS providers still require users to manually configure the memory allocated to the FaaS functions based on their experience and knowledge. This often leads to suboptimal function performance and higher execution costs. In this paper, we present a framework called MAFF that automatically finds the optimal memory configurations for the FaaS functions based on two optimization objectives: cost-only and balanced (balance between cost and execution duration). Furthermore, MAFF self-adapts the memory configurations for the FaaS functions based on the changing function inputs or other requirements, such as an increase in the number of requests. Moreover, we propose and implement different optimization algorithms for different objectives. We demonstrate the functionality of MAFF on AWS Lambda by testing on four different categories of FaaS functions. Our results show that the suggested memory configurations with the Linear algorithm achieve 90% accuracy with a speedup of 2x compared to the other algorithms. Finally, we compare MAFF with two popular memory optimization tools provided by AWS, i.e., AWS Compute Optimizer and AWS Lambda Power Tuning, and demonstrate how our framework overcomes their limitations.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    https://github.com/tetzubko/self-adaptive-memory-faas.

References

  1. Google cloud recommendations (2018). https://cloud.google.com/compute/docs/instances/apply-machine-type-recommendations-for-instances. Accessed 17 June 2021

  2. Akhtar, N., Raza, A., Ishakian, V., Matta, I.: COSE: configuring serverless functions using statistical learning. In: IEEE INFOCOM 2020 - IEEE Conference on Computer Communications, pp. 129–138 (2020). https://doi.org/10.1109/INFOCOM41043.2020.9155363

  3. Akin, M.: How does proportional CPU allocation work with AWS Lambda? Opsgenie Engineering. https://engineering.opsgenie.com/how-does-proportional-cpu-allocation-work-with-aws-lambda-41cd44da3cac

  4. Alipourfard, O., Liu, H.H., Chen, J., Venkataraman, S., Yu, M., Zhang, M.: CherryPick: adaptively unearthing the best cloud configurations for big data analytics. In: Proceedings of the 14th USENIX Conference on Networked Systems Design and Implementation, NSDI 2017, pp. 469–482. USENIX Association (2017)

    Google Scholar 

  5. AWS: AWS Lambda - Serverless Compute. https://aws.amazon.com/lambda/

  6. AWS: Choosing the Optimal Memory Size - Serverless Architectures with AWS Lambda. https://docs.aws.amazon.com/whitepapers/latest/serverless-architectures-lambda/choosing-the-optimal-memory-size.html

  7. AWS: Creating a CloudWatch Events Rule That Triggers on a Schedule - Amazon CloudWatch Events. https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/Create-CloudWatch-Events-Scheduled-Rule.html

  8. AWS: Supported resources and requirements - AWS Compute Optimizer. https://docs.aws.amazon.com/compute-optimizer/latest/ug/requirements.html#requirements-lambda-functions

  9. AWS: Aws lambda pricing (2020). https://aws.amazon.com/lambda/pricing/

  10. Baldini, I., et al.: Serverless computing: current trends and open problems. In: Chaudhary, S., Somani, G., Buyya, R. (eds.) Research Advances in Cloud Computing, pp. 1–20. Springer, Singapore (2017). https://doi.org/10.1007/978-981-10-5026-8_1

    Chapter  Google Scholar 

  11. Casalboni, A.: AWS Lambda Power Tuning. https://github.com/alexcasalboni/aws-lambda-power-tuning

  12. Chadha, M., Jindal, A., Gerndt, M.: Towards federated learning using FaaS fabric. In: Proceedings of the 2020 Sixth International Workshop on Serverless Computing, WoSC 2020, pp. 49–54. Association for Computing Machinery, New York (2020). https://doi.org/10.1145/3429880.3430100

  13. Chadha, M., Jindal, A., Gerndt, M.: Architecture-specific performance optimization of compute-intensive FaaS functions. In: 2021 IEEE 14th International Conference on Cloud Computing (CLOUD), pp. 478–483 (2021). https://doi.org/10.1109/CLOUD53861.2021.00062

  14. Eismann, S., Bui, L., Grohmann, J., Abad, C., Herbst, N., Kounev, S.: Sizeless: predicting the optimal size of serverless functions, pp. 248–259. Association for Computing Machinery, New York (2021). https://doi.org/10.1145/3464298.3493398

  15. Eivy, A.: Be wary of the economics of “serverless” cloud computing. IEEE Cloud Comput. 4(2), 6–12 (2017). https://doi.org/10.1109/MCC.2017.32

  16. Fan., C., Jindal., A., Gerndt., M.: Microservices vs serverless: a performance comparison on a cloud-native web application. In: Proceedings of the 10th International Conference on Cloud Computing and Services Science - CLOSER, pp. 204–215. INSTICC, SciTePress (2020). https://doi.org/10.5220/0009792702040215

  17. Grafberger, A., Chadha, M., Jindal, A., Gu, J., Gerndt, M.: FedLess: secure and scalable federated learning using serverless computing. In: 2021 IEEE International Conference on Big Data (Big Data), pp. 164–173, December 2021. https://doi.org/10.1109/BigData52589.2021.9672067

  18. Jarachanthan, J., Chen, L., Xu, F., Li, B.: Astra: autonomous serverless analytics with cost-efficiency and QoS-awareness. In: 2021 IEEE International Parallel and Distributed Processing Symposium (IPDPS), pp. 756–765 (2021). https://doi.org/10.1109/IPDPS49936.2021.00085

  19. Jindal, A., Chadha, M., Benedict, S., Gerndt, M.: Estimating the capacities of function-as-a-service functions. In: Proceedings of the 14th IEEE/ACM International Conference on Utility and Cloud Computing Companion, UCC 2021 Companion. Association for Computing Machinery, New York (2021). https://doi.org/10.1145/3492323.3495628

  20. Jindal, A., Frielinghaus, J., Chadha, M., Gerndt, M.: Courier: delivering serverless functions within heterogeneous FaaS deployments. In: Proceedings of the 14th IEEE/ACM International Conference on Utility and Cloud Computing, UCC 2021. Association for Computing Machinery, New York (2021). https://doi.org/10.1145/3468737.3494097

  21. Jindal, A., Gerndt, M.: From DevOps to NoOps: is it worth it? In: Ferguson, D., Pahl, C., Helfert, M. (eds.) Cloud Computing and Services Science, pp. 178–202. Springer International Publishing, Cham (2021)

    Chapter  Google Scholar 

  22. Linux: dd(1) - Linux manual. https://man7.org/linux/man-pages/man1/dd.1.html

  23. Ruder, S.: An overview of gradient descent optimization algorithms. Technical report (2017). http://caffe.berkeleyvision.org/tutorial/solver.html

  24. Shahrad, M., Balkind, J., Wentzlaff, D.: Architectural implications of function-as-a-service computing. In: Proceedings of the 52nd Annual IEEE/ACM International Symposium on Microarchitecture, pp. 1063–1075 (2019)

    Google Scholar 

  25. Shankar, V., et al.: Serverless linear algebra. In: Proceedings of the 11th ACM Symposium on Cloud Computing, SoCC 2020, pp. 281–295. Association for Computing Machinery, New York (2020). https://doi.org/10.1145/3419111.3421287

  26. Spillner, J.: Resource management for cloud functions with memory tracing, profiling and autotuning. In: WOSC 2020 - Proceedings of the 2020 6th International Workshop on Serverless Computing, Part of Middleware 2020, pp. 13–18. Association for Computing Machinery Inc., New York, December 2020. https://doi.org/10.1145/3429880.3430094

  27. Steinbach, M., Jindal, A., Chadha, M., Gerndt, M., Benedict, S.: TppFaas: modeling serverless functions invocations via temporal point processes. IEEE Access 10, 9059–9084 (2022). https://doi.org/10.1109/ACCESS.2022.3144078

    Article  Google Scholar 

  28. Wang, L., Li, M., Zhang, Y., Ristenpart, T., Swift, M.: Peeking behind the curtains of serverless platforms. In: 2018 USENIX Annual Technical Conference (USENIX ATC 18), pp. 133–146. USENIX Association (2018)

    Google Scholar 

  29. Serverless Working Group: CNCF WG-serverless whitepaper v1. 0, March 2018. https://gw.alipayobjects.com/os/basement_prod/24ec4498-71d4-4a60-b785-fa530456c65b.pdf. Accessed 15 July 2020

  30. Zhang, M., Zhu, Y., Zhang, C., Liu, J.: Video processing with serverless computing: a measurement study (2019). https://doi.org/10.1145/3304112.3325608

Download references

Acknowledgements

This work was supported by the funding of the German Federal Ministry of Education and Research (BMBF) in the scope of the Software Campus program. The authors also thank the anonymous reviewers whose comments helped in improving this paper.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Anshul Jindal .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2022 IFIP International Federation for Information Processing

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Zubko, T., Jindal, A., Chadha, M., Gerndt, M. (2022). MAFF: Self-adaptive Memory Optimization for Serverless Functions. In: Montesi, F., Papadopoulos, G.A., Zimmermann, W. (eds) Service-Oriented and Cloud Computing. ESOCC 2022. Lecture Notes in Computer Science, vol 13226. Springer, Cham. https://doi.org/10.1007/978-3-031-04718-3_9

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-04718-3_9

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-04717-6

  • Online ISBN: 978-3-031-04718-3

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics