Serverless computing is a popular cloud computing paradigm, which requires low response latency to handle on-demand user requests. There are two prominent techniques employed for reducing the response latency: keep fully initialized containers alive (Warm Container) or reduce the new container startup (cold start) latency. This paper presents the 3rd container startup mode: Hibernate Container, which starts faster than the cold start container mode and consumes less memory than the Warm Container mode. Hibernate Container is essentially a "deflated" Warm Container. Its application memory is swapped out to disk, the freed memory is reclaimed and file based mmap memory is cleaned-up. The Hibernate Container's deflated memory is inflated in response to user requests. As Hibernate Container's application is fully initialized, its response latency is less than the cold start mode; and as the application memory is deflated, its memory consumption is less than the Warm Container mode. Additionally, when a Hibernate Container is "woken up" to process a request, the Woken-up Container has similar response latency to Warm Container but less memory consumption because not all the deflated memory needs to be inflated. We implemented the Hibernate technique as part of the open source Quark secure container runtime project and our test demonstrated that Hibernate Container consumes about 7\% to 25\% of the Warm Container memory. All of this results in a higher deployment density, lower latency and appreciable improvements in the overall system performance.
翻译:Serverless计算是一种流行的云计算范式,要求低响应延迟以处理按需的用户请求。目前有两种主要技术用于降低响应延迟:保持完全初始化的容器存活(Warm Container)或减少新容器启动(冷启动)延迟。本文提出第三种容器启动模式:Hibernate Container,其启动速度比冷启动容器模式更快,且内存消耗低于Warm Container模式。Hibernate Container本质上是"紧缩"的Warm Container。其应用程序内存被交换到磁盘,释放的内存被回收,基于文件映射(mmap)的内存被清理。Hibernate Container的紧缩内存在响应请求时被膨胀。由于Hibernate Container的应用程序已完全初始化,其响应延迟低于冷启动模式;同时,由于应用程序内存被紧缩,其内存消耗低于Warm Container模式。此外,当Hibernate Container被"唤醒"以处理请求时,唤醒后的容器具有与Warm Container相似的响应延迟,但内存消耗更低,因为并非所有紧缩内存都需要膨胀。我们将Hibernate技术作为开源Quark安全容器运行时项目的一部分实现,测试表明Hibernate Container的内存消耗约为Warm Container的7%至25%。这些特性带来了更高的部署密度、更低的延迟以及整体系统性能的显著改进。