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)是无服务器计算最流行的实现方式,将应用表示为事件驱动的无状态函数。然而,现有研究表明FaaS应用的函数严重受冷启动延迟困扰。本文提出一种名为FaaSLight的方法,通过应用级优化加速FaaS应用的冷启动。我们首先进行测量研究,探究FaaS冷启动问题的可能根因。结果表明,应用代码加载延迟是显著开销。因此,仅从FaaS应用中加载不可或缺的代码是一个可行的解决方案。基于此洞察,我们通过构建函数级调用图识别与应用功能相关的代码,并将其他代码(即可选代码)从FaaS应用中分离。分离出的可选代码可按需加载,以避免因不可或缺代码识别不准确导致应用失败。特别地,指导FaaSLight设计的关键原则是内在通用性,即平台无关性和语言无关性。在真实FaaS应用上的评估结果表明,FaaSLight能显著降低代码加载延迟(最高78.95%,平均28.78%),从而减少冷启动延迟。最终,函数的总响应延迟可降低高达42.05%(平均19.21%)。与现有最优方法相比,FaaSLight在降低平均总响应延迟方面实现了21.25倍的提升。