Abstract
Serverless computing is a popular cloud computing paradigm that frees developers from server management. Function-as-a-Service (FaaS) is the most popular implementation of serverless computing, representing applications as event-driven and stateless functions. However, existing studies report that functions of FaaS applications severely suffer from cold-start latency.
In this article, we propose an approach, namely, FaaSLight, to accelerating the cold start for FaaS applications through application-level optimization. We first conduct a measurement study to investigate the possible root cause of the cold-start problem of FaaS. The result shows that application code loading latency is a significant overhead. Therefore, loading only indispensable code from FaaS applications can be an adequate solution. Based on this insight, we identify code related to application functionalities by constructing the function-level call graph and separate other code (i.e., optional code) from FaaS applications. The separated optional code can be loaded on demand to avoid the inaccurate identification of indispensable code causing application failure. In particular, a key principle guiding the design of FaaSLight is inherently general, i.e., platform- and language-agnostic. In practice, FaaSLight can be effectively applied to FaaS applications developed in different programming languages (Python and JavaScript), and can be seamlessly deployed on popular serverless platforms such as AWS Lambda and Google Cloud Functions, without having to modify the underlying OSes or hypervisors, nor introducing any additional manual engineering efforts to developers. The evaluation results on real-world FaaS applications show that FaaSLight can significantly reduce the code loading latency (up to 78.95%, 28.78% on average), thereby reducing the cold-start latency. As a result, the total response latency of functions can be decreased by up to 42.05% (19.21% on average). Compared with the state-of-the-art, FaaSLight achieves a 21.25× improvement in reducing the average total response latency.
- [1] 2016. Image resize. Retrieved on November 10, 2021 from https://github.com/gxx/aws-lambda-python/tree/master/image_resize.Google Scholar
- [2] 2017. Lambda Pandas. Retrieved on November 10, 2021 from https://github.com/nicor88/aws-python-lambdas/tree/master/src/hello_pandas.Google Scholar
- [3] 2017. Python OpenCV module for AWS Lambda. Retrieved on November 10, 2021 from https://github.com/aeddi/aws-lambda-python-opencv.Google Scholar
- [4] 2017. TensorFlow to AWS Lambda. Retrieved on November 10, 2021 from https://github.com/jacopotagliabue/tensorflow_to_lambda_serverless.Google Scholar
- [5] 2018. 2018 serverless community survey: huge growth in serverless usage. Retrieved on May 01, 2022 from https://www.serverless.com/blog/2018-serverless-community-survey-huge-growth-usage.Google Scholar
- [6] 2019. AWS Lambda to predict the quality of your wine. Retrieved on November 10, 2021 from https://github.com/pierreant/wine-ml-on-aws-lambda.Google Scholar
- [7] 2019. Lxml requests. Retrieved on November 10, 2021 from https://github.com/ryfeus/lambda-packs/tree/master/Lxml_requests.Google Scholar
- [8] 2019. OpenCV PIL. Retrieved on November 10, 2021 from https://github.com/ryfeus/lambda-packs/tree/master/Opencv_pil.Google Scholar
- [9] 2019. Pandas NumPy. Retrieved on November 10, 2021 from https://github.com/ryfeus/lambda-packs/tree/master/Pandas_numpy.Google Scholar
- [10] 2019. Scikit example. Retrieved on November 10, 2021 from https://github.com/mpavlovic/serverless-machine-learning/tree/master/scikit-example.Google Scholar
- [11] 2019. Skimage NumPy. Retrieved on November 10, 2021 from https://github.com/ryfeus/lambda-packs/tree/master/Skimage_numpy.Google Scholar
- [12] 2019. Terraform AWS Lambda Python. Retrieved on November 10, 2021 from https://github.com/ruzin/terraform_aws_lambda_python/tree/master/example.Google Scholar
- [13] 2020. AWS Lambda container image support. Retrieved on May 01, 2022 from https://aws.amazon.com/cn/blogs/aws/new-for-aws-lambda-container-image-support/.Google Scholar
- [14] 2020. The CIO’s guide to serverless computing. Retrieved on May 01, 2022 from https://www.gartner.com/smarterwithgartner/the-cios-guide-to-serverless-computing/.Google Scholar
- [15] 2020. Sentiment analysis in the Cloud with AWS Lambda. Retrieved on November 10, 2021 from https://github.com/cloudacademy/sentiment-analysis-aws-lambda.Google Scholar
- [16] 2020. Serverless Bert hugging face AWS Lambda docker. Retrieved on November 10, 2021 from https://github.com/philschmid/serverless-bert-huggingface-aws-lambda-docker.Google Scholar
- [17] 2021. Comparison of cold starts in serverless functions across AWS, Azure, and GCP. Retrieved on May 01, 2022 from https://mikhail.io/serverless/coldstarts/big3/.Google Scholar
- [18] 2021. LightGBM Sklearn Scipy NumPy. Retrieved on November 10, 2021 from https://github.com/ryfeus/lambda-packs/tree/master/LightGBM_sklearn_scipy_numpy.Google Scholar
- [19] 2021. Python static analysis tools. Retrieved on May 01, 2022 from https://camelcaseguy.medium.com/python-static-analysis-tools-fe5960d8035.Google Scholar
- [20] 2021. Top 4 serverless computing platforms in 2021. Retrieved from https://www.loginradius.com/blog/async/serverless-overview/. Retrieved on November 10, 2021 .Google Scholar
- [21] 2021. Top 5 serverless platforms in 2021. Retrieved on November 10, 2021 from https://www.techmagic.co/blog/top-5-serverless-platforms-in-2020/.Google Scholar
- [22] 2021. Vulture—Find dead code. Retrieved on May 01, 2022 from https://github.com/jendrikseipp/vulture.Google Scholar
- [23] 2022. Advanced Topics in Programming Languages. Retrieved on September 01, 2022 from https://groups.seas.harvard.edu/courses/cs252/2011sp/.Google Scholar
- [24] 2022. Ast for Python. Retrieved on May 01, 2022 from https://docs.python.org/3/library/ast.html.Google Scholar
- [25] 2022. Astroid. Retrieved on February 01, 2022 from https://pylint.pycqa.org/projects/astroid/en/latest/.Google Scholar
- [26] 2022. AWS Lambda. Retrieved on May 01, 2022 from https://docs.aws.amazon.com/lambda/latest/dg/welcome.html.Google Scholar
- [27] 2022. AWS Lambda function handler. Retrieved on December 03, 2022 from https://docs.aws.amazon.com/lambda/latest/dg/nodejs-handler.html.Google Scholar
- [28] 2022. AWS Lambda NumPy. Retrieved on March 17, 2022 from https://github.com/Haodi-Ping/AWSLambda_numpy.Google Scholar
- [29] 2022. AWS SAM. Retrieved on November 10, 2021 from https://github.com/aws/aws-sam-cli.Google Scholar
- [30] 2022. Azure Functions. Retrieved on May 01, 2022 from https://docs.microsoft.com/en-us/azure/azure-functions/.Google Scholar
- [31] 2022. Callgraph. Retrieved on September 01, 2022 from https://github.com/gunar/callgraph.Google Scholar
- [32] 2022. Custom-LDA-classifier-model. Retrieved on September 01, 2022 from https://github.com/Haodi-Ping/Custom-LDA-classifier-model.Google Scholar
- [33] 2022. Effect size. Retrieved on May 01, 2022 from https://en.wikipedia.org/wiki/Effect_size##Cohen's_d.Google Scholar
- [34] 2022. Google Cloud Functions. Retrieved on May 01, 2022 from https://cloud.google.com/functions.Google Scholar
- [35] 2022. Google Cloud Functions handler. Retrieved on December 03, 2022 from https://cloud.google.com/functions/docs/writing/write-http-functions.Google Scholar
- [36] 2022. Google Cloud Functions numpy pandas. Retrieved on September 01, 2022 from https://github.com/ryfeus/gcf-packs/tree/master/pandas_numpy/sources.Google Scholar
- [37] 2022. Google Cloud Functions Python runtime demo. Retrieved on September 01, 2022 from https://github.com/simonprickett/google-cloud-functions-python.Google Scholar
- [38] 2022. Google gVisor. Retrieved from https://github.com/google/gvisor. Retrieved on September 01, 2022 .Google Scholar
- [39] 2022. How can you find unused functions in Python code? Retrieved on May 01, 2022 from https://stackoverflow.com/questions/693070/how-can-you-find-unused-functions-in-python-code.Google Scholar
- [40] 2022. How To: Optimize the Serverless Optimizer Plugin. Retrieved on September 01, 2022 from https://www.jeremydaly.com/how-to-optimize-the-serverless-optimizer-plugin/.Google Scholar
- [41] 2022. JavaScript async. Retrieved on November 27, 2022 . from https://bmaupin.github.io/wiki/programming/javascript/javascript-async.html.Google Scholar
- [42] 2022. Mann–Whitney U test. Retrieved on May 01, 2022 from https://en.wikipedia.org/wiki/Mann-Whitney_U_test.Google Scholar
- [43] 2022. Microcosm2RSS. Retrieved on September 01, 2022 from https://github.com/conoro/microcosm2rss.Google Scholar
- [44] 2022. Python—magic or dunder methods. Retrieved on May 01, 2022 from https://www.tutorialsteacher.com/python/magic-methods-in-python.Google Scholar
- [45] 2022. Quotas of Google Cloud Functions. Retrieved on November 27, 2022 from https://cloud.google.com/functions/quotas.Google Scholar
- [46] 2022. Serverless Image Processing. Retrieved on September 01, 2022 from https://github.com/unichat-io/serverless-image-processing.Google Scholar
- [47] 2022. Serverless-lunch. Retrieved on September 01, 2022 from https://github.com/deekim/serverless-lunch.Google Scholar
- [48] 2022. Serverless Optimize Plugin. Retrieved on September 01, 2022 from https://www.serverless.com/plugins/serverless-plugin-optimize.Google Scholar
- [49] 2022. Show me a dog. Retrieved on September 01, 2022 from https://github.com/hollandmatt/show-me-a-dog.Google Scholar
- [50] 2022. The state of serverless. Retrieved on September 01, 2022 from https://www.datadoghq.com/state-of-serverless/.Google Scholar
- [51] 2022. uglify-js. Retrieved on February 01, 2022 from https://lisperator.net/uglifyjs/.Google Scholar
- [52] Mikhail.io. 2022. Cold starts in AWS Lambda. Retrieved on May 01, 2022 from https://mikhail.io/serverless/coldstarts/aws/.Google Scholar
- [53] Mikhail.io. 2022. Cold starts in Azure Functions. Retrieved on May 01, 2022 from https://mikhail.io/serverless/coldstarts/azure/.Google Scholar
- [54] . 2018. Practical AJAX race detection for JavaScript web applications. In Proceedings of the 26th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering. 38–48.Google ScholarDigital Library
- [55] . 2018. SAND: Towards high-performance serverless computing. In Proceedings of the USENIX Annual Technical Conference (ATC’18). 923–935.Google Scholar
- [56] . 2018. Static javascript call graphs: A comparative study. In Proceedings of the IEEE 18th International Working Conference on Source Code Analysis and Manipulation. IEEE, 177–186.Google Scholar
- [57] . 2018. Sprocket: A serverless video processing framework. In Proceedings of the ACM Symposium on Cloud Computing (SoCC’18). 263–274.Google ScholarDigital Library
- [58] . 2019. Less is more: Quantifying the security benefits of debloating web applications. In Proceedings of the 28th USENIX Security Symposium (USENIX Security’19). 1697–1714.Google Scholar
- [59] . 2019. Carve: Practical security-focused software debloating using simple feature set mappings. In Proceedings of the 3rd ACM Workshop on Forming an Ecosystem Around Software Transformation. 1–7.Google ScholarDigital Library
- [60] . 2020. JShrink: In-depth investigation into debloating modern Java applications. In Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE’20). 135–146.Google ScholarDigital Library
- [61] . 2019. Cirrus: A serverless framework for end-to-end ML workflows. In Proceedings of the ACM Symposium on Cloud Computing (SoCC’19). 13–24.Google ScholarDigital Library
- [62] . 2020. Nimbus: Improving the developer experience for serverless applications. In Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering. 85–88.Google Scholar
- [63] . 1995. Optimization of object-oriented programs using static class hierarchy analysis. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP’95). Springer, 77–101.Google ScholarCross Ref
- [64] . 2020. Catalyzer: Sub-millisecond startup for serverless computing with initialization-less booting. In Proceedings of the 25th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS’20). ACM, 467–481.Google ScholarDigital Library
- [65] . 2022. The state of serverless applications: Collection, characterization, and community consensus. IEEE Trans. Softw. Eng. 48, 10 (2022), 4152–4166.Google ScholarDigital Library
- [66] . 2021. The wonderless dataset for serverless computing. In Proceedings of the IEEE/ACM 18th International Conference on Mining Software Repositories. IEEE, 565–569.Google ScholarCross Ref
- [67] . 2018. Exploring serverless computing for neural network training. In Proceedings of the IEEE 11th International Conference on Cloud Computing (CLOUD’18). 334–341.Google ScholarCross Ref
- [68] . 2019. From laptop to lambda: Outsourcing everyday jobs to thousands of transient functional containers. In Proceedings of the USENIX Annual Technical Conference (USENIX ATC’19). 475–488.Google Scholar
- [69] . 2017. Encoding, fast and slow: Low-latency video processing using thousands of tiny threads. In Proceedings of the USENIX Symposium on Networked Systems Design and Implementation (NSDI’17). 363–376.Google Scholar
- [70] . 2021. FaasCache: Keeping serverless computing alive with greedy-dual caching. In Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS’21). 386–400.Google ScholarDigital Library
- [71] . 2020. Is static analysis able to identify unnecessary source code? ACM Trans. Softw. Eng. Methodol. 29, 1 (2020), 1–23.Google ScholarDigital Library
- [72] . 2019. Serverless computing: One step forward, two steps back. In Proceedings of the 9th Biennial Conference on Innovative Data Systems Research. Retrieved from www.cidrdb.org.Google Scholar
- [73] . 2014. Make it work, make it right, make it fast: Building a platform-neutral whole-system dynamic binary analysis platform. In Proceedings of the International Symposium on Software Testing and Analysis (ISSTA’14). 248–258.Google ScholarDigital Library
- [74] . 2018. Effective program debloating via reinforcement learning. In Proceedings of the ACM SIGSAC Conference on Computer and Communications Security (CCS’18). 380–394.Google ScholarDigital Library
- [75] . 2015. Stateless model checking of event-driven applications. ACM SIGPLAN Notices 50, 10 (2015), 57–73.Google ScholarDigital Library
- [76] . 2021. Nightcore: Efficient and scalable serverless computing for latency-sensitive, interactive microservices. In Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems. 152–166.Google ScholarDigital Library
- [77] . 2019. Cloud programming simplified: A Berkeley view on serverless computing. Retrieved from https://arXiv:1902.03383.Google Scholar
- [78] . 2018. Pocket: Elastic ephemeral storage for serverless analytics. In Proceedings of the 13th USENIX Symposium on Operating Systems Design and Implementation (OSDI’18). 427–444.Google Scholar
- [79] . 2021. Muzeel: A dynamic JavaScript analyzer for dead code elimination in today’s web. Retrieved from https://arXiv:2106.08948.Google Scholar
- [80] . 2018. Evaluation of production serverless computing environments. In Proceedings of the IEEE 11th International Conference on Cloud Computing. IEEE, 442–450.Google ScholarCross Ref
- [81] . 2019. E3: Energy-efficient microservices on smartNIC-accelerated servers. In Proceedings of the USENIX Annual Technical Conference (ATC’19). 363–378.Google Scholar
- [82] . 2014. iMashup: A mashup-based framework for service composition. Sci. China Inf. Sci. 57, 1 (2014), 1–20.Google ScholarCross Ref
- [83] . 2007. Towards service composition based on mashup. In Proceedings of the IEEE International Conference on Services Computing Workshops (SCW’07). IEEE Computer Society, 332–339.Google ScholarCross Ref
- [84] . 2018. An evaluation of open source serverless computing frameworks. In Proceedings of the IEEE 10th International Conference on Cloud Computing Technology and Science (CloudCom’18). 115–120.Google ScholarCross Ref
- [85] . 2018. SOCK: Rapid task provisioning with serverless-optimized containers. In Proceedings of the USENIX Annual Technical Conference (ATC’18). USENIX Association, 57–70.Google Scholar
- [86] . 2018. An extensible approach for taming the challenges of JavaScript dead code elimination. In Proceedings of IEEE 25th International Conference on Software Analysis, Evolution and Reengineering (SANER’18). 291–401.Google ScholarCross Ref
- [87] . 2020. Allocation priority policies for serverless function-execution scheduling optimisation. In Proceedings of the International Conference on Service-Oriented Computing. Springer, 416–430.Google ScholarDigital Library
- [88] . 2020. Operating latency sensitive applications on public serverless edge cloud platforms. IEEE Internet Things J. 8, 10 (2020), 7954–7972.Google ScholarCross Ref
- [89] . 2020. Problems and opportunities in training deep learning software systems: An analysis of variance. In Proceedings of the 35th IEEE/ACM International Conference on Automated Software Engineering (ASE’20). 771–783.Google ScholarDigital Library
- [90] . 2019. Shuffling, fast and slow: Scalable analytics on serverless infrastructure. In Proceedings of the 16th USENIX Symposium on Networked Systems Design and Implementation (NSDI’19). 193–206.Google Scholar
- [91] . 2019. RAZOR: A framework for post-deployment software debloating. In Proceedings of the 28th USENIX Security Symposium (USENIX Security’19). 1733–1750.Google Scholar
- [92] . 2017. A multi-OS cross-layer study of bloating in user programs, kernel and managed execution environments. In Proceedings of the Workshop on Forming an Ecosystem Around Software Transformation, FEAST 2017. 65–70.Google ScholarDigital Library
- [93] . 2018. Debloating software through piece-wise compilation and loading. In Proceedings of the 27th USENIX Security Symposium. 869–886.Google ScholarDigital Library
- [94] . 2018. A multi-study investigation into dead code. IEEE Trans. Softw. Eng. 46, 1 (2018), 71–99.Google ScholarCross Ref
- [95] . 2020. Toward multicloud access transparency in serverless computing. IEEE Softw. 38, 1 (2020), 68–74.Google ScholarDigital Library
- [96] . 2020. Serverless in the wild: Characterizing and optimizing the serverless workload at a large cloud provider. In Proceedings of the USENIX Annual Technical Conference, (ATC’20). 205–218.Google Scholar
- [97] . 2020. Serverless linear algebra. In Proceedings of the ACM Symposium on Cloud Computing (SoCC’20). 281–295.Google ScholarDigital Library
- [98] . 2018. TRIMMER: Application specialization for code debloating. In Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering (ASE’18). 329–339.Google ScholarDigital Library
- [99] . 2020. Faasm: Lightweight isolation for efficient stateful serverless computing. In Proceedings of the USENIX Annual Technical Conference. 419–433.Google Scholar
- [100] . 2020. Prebaking functions to warm the serverless cold start. In Proceedings of the 21st International Middleware Conference. 1–13.Google ScholarDigital Library
- [101] . 2021. Atoll: A scalable low-latency serverless platform. In Proceedings of the ACM Symposium on Cloud Computing (SoCC’21). 138–152.Google ScholarDigital Library
- [102] . 2020. Serverless computing-where are we now, and where are we heading? IEEE Softw. 38, 1 (2020), 25–31.Google ScholarDigital Library
- [103] . 2020. Sequoia: Enabling quality-of-service in serverless computing. In Proceedings of the ACM Symposium on Cloud Computing (SoCC’20). 311–327.Google ScholarDigital Library
- [104] . 2020. Cold start in serverless computing: Current trends and mitigation strategies. In Proceedings of the International Conference on Omni-layer Intelligent Systems. IEEE, 1–7.Google Scholar
- [105] . 2021. FaaSNet: Scalable and fast provisioning of custom serverless container runtimes at Alibaba cloud function compute. In Proceedings of the USENIX Annual Technical Conference (USENIX ATC’21). 443–457.Google Scholar
- [106] . 2019. Replayable execution optimized for page sharing for a managed runtime environment. In Proceedings of the 14th EuroSys Conference (EuroSys’19). 1–16.Google ScholarDigital Library
- [107] . 2018. Peeking behind the curtains of serverless platforms. In Proceedings of the USENIX Annual Technical Conference (ATC’18). 133–146.Google Scholar
- [108] . 2023. Rise of the planet of serverless computing: A systematic review. ACM Trans. Softw. Eng. Methodol. (2023).Google ScholarDigital Library
- [109] . 2021. An empirical study on challenges of application development in serverless computing. In Proceedings of the 28th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (ESEC/FSE’21). 416–428.Google ScholarDigital Library
- [110] . 2021. Characterizing commodity serverless computing platforms. J. Softw.: Evol. Process (2021), e2394.Google ScholarCross Ref
- [111] . 2020. Characterizing serverless platforms with serverlessbench. In Proceedings of the ACM Symposium on Cloud Computing (SoCC’20). 30–44.Google ScholarDigital Library
- [112] . 2021. Caerus: NIMBLE task scheduling for serverless analytics. In Proceedings of the 18th USENIX Symposium on Networked Systems Design and Implementation. 653–669.Google Scholar
- [113] . 2021. Edge-adaptable serverless acceleration for machine learning Internet of Things applications. Softw.: Pract. Exper. 51, 9 (2021), 1852–1867.Google ScholarCross Ref
- [114] . 2010. Event handler-based coverage for GUI testing. In Proceedings of the 10th International Conference on Quality Software. 326–331.Google ScholarDigital Library
Index Terms
- FaaSLight: General Application-level Cold-start Latency Optimization for Function-as-a-Service in Serverless Computing
Recommendations
Supporting Multi-Provider Serverless Computing on the Edge
ICPP Workshops '18: Workshop Proceedings of the 47th International Conference on Parallel ProcessingServerless computing has recently emerged as a new execution model for cloud computing, in which service providers offer compute runtimes, also known as Function-as-a-Service (FaaS) platforms, allowing users to develop, execute and manage application ...
ACPM: adaptive container provisioning model to mitigate serverless cold-start
AbstractIn recent years, serverless computing has emerged as a new cloud service model that provides an elegant computing framework for application development. It allows developers to focus solely on application logic without having to worry about the ...
Holistic cold-start management in serverless computing cloud with deep learning for time series
AbstractServerless computing is the most innovative and affordable cloud service model that improves three strategic business objectives: flexibility, efficiency, and innovation. Compared to monolithic applications, serverless computing applications ...
Highlights- The complex cold-start problem involves many layers of the serverless cloud stack.
- Temporal Convolution Network models offer 5- to 15-minute forecast windows.
- Forecast windows enable a more holistic cold-start management policy.
Graphical abstractDisplay Omitted
Comments