[论文解读] FaaSLight: General Application-Level Cold-Start Latency Optimization for Function-as-a-Service in Serverless Computing
FaaSLight 通过应用层优化,利用函数级调用图识别并分离非必要(可选)代码与核心应用代码,从而减少函数即服务(FaaS)的冷启动延迟。通过按需加载可选代码,其将代码加载延迟最高降低 78.95%(平均降低 28.78%),总响应延迟最高降低 42.05%(平均降低 19.21%),相比现有最先进技术提升 21.25 倍,且无需修改底层平台或开发者参与。
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 paper, 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. 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.25X improvement in reducing the average total response latency.
研究动机与目标
- 为解决 FaaS 应用中冷启动延迟这一显著性能瓶颈,其可占总响应时间的 80%。
- 识别并隔离非必要(可选)代码与核心应用代码,以减少初始化开销。
- 设计一种与平台和语言无关的解决方案,无需修改底层操作系统或虚拟化层。
- 实现可选代码的按需加载,避免错误识别不可或缺代码,从而防止应用失败。
- 在无需手动工程或开发者干预的前提下实现显著的性能提升。
提出的方法
- 构建函数级调用图,静态分析依赖关系,识别对应用功能至关重要的代码。
- 将识别出的可选代码从主应用包中分离,以减少初始代码加载大小。
- 集成轻量级运行时机制,在执行期间仅在需要时获取并执行可选函数。
- 通过延迟可选代码加载至运行时,确保向后兼容性和正确性,最大限度减少对热启动性能的影响。
- 在 AWS Lambda 和 Google Cloud Functions 上,针对 Python 和 JavaScript 实现与平台和语言无关的原型进行评估。
- 使用轻量级文件 I/O 实现按需加载,其开销(约 100 ms)远小于典型的冷启动延迟。
实验结果
研究问题
- RQ1FaaS 应用中高冷启动延迟的主要根本原因是什么?
- RQ2是否可通过应用层代码分析在不修改底层无服务器平台的前提下降低冷启动延迟?
- RQ3函数级调用图分析在识别不可或缺代码与可选代码方面的有效性如何?
- RQ4可选代码按需加载的性能开销有多大?是否超过其带来的收益?
- RQ5所提出的优化是否能在多种编程语言和无服务器平台上实现显著性能提升?
主要发现
- 应用代码加载延迟是冷启动延迟的主要贡献因素,占总延迟的显著部分。
- FaaSLight 在真实世界 FaaS 应用中,最高降低代码加载延迟 78.95%,平均降低 28.78%。
- 总响应延迟最高降低 42.05%,平均降低 19.21%,展现出显著的端到端性能提升。
- 该方法相比现有最先进方案,在平均总响应延迟降低方面实现 21.25 倍的提升。
- 按需加载机制仅引入约 100 ms 的开销,与冷启动延迟相比可忽略不计,且不影响热启动性能。
- 该解决方案在不同编程语言(Python、JavaScript)和无服务器平台(AWS Lambda、Google Cloud Functions)上均有效,证实了其通用性。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。