一种面向云函数的超轻量运行时环境构建方法
A Lightweight Runtime Environment Construction Method for Cloud Functions
DOI: 10.12677/CSA.2020.1011211, PDF,   
作者: 吴绍岭, 田春岐, 万 兴:同济大学计算机科学与技术系,上海;王 伟:华东师范大学数据科学与工程学院,上海
关键词: 云函数无服务器计算虚拟化容器资源共享Cloud Function Serverless Computing Virtualization Container Resource Sharing
摘要: 随着虚拟化技术和软件体系结构的不断发展,云函数(也称无服务计算)逐渐成为一种新的计算范式,该范式允许用户直接部署函数代码,而不必关心基础架构,同时能够提供极高的弹性和快速生灭能力。然而,现有的云函数通常运行在功能较为完备的容器中,存在启动延迟高、资源共享度低、镜像构建和分发时间长等问题。本文分析并验证了影响Linux容器启动时延和资源共享的关键因素,提出了面向云函数的超轻量运行时环境构建方法,该方法从资源隔离、资源限制、文件系统、网络通信等方面对运行时环境进行定义,基于操作系统虚拟化技术,通过进一步抽取共享层来提高资源共享度,通过降低网络隔离和控制组操作的性能瓶颈来加快启动速度。根据上述方法实现了超轻量运行时环境引擎FRE (Function Runtime Environment)。实验中,从顺序与并发启动时间、内存资源利用率、镜像大小等方面对FRE与当前主流的Docker容器引擎进行对比实验,验证了FRE在云函数场景下的有效性。
Abstract: With the development of virtualization technology and software architecture, cloud function (also known as serverless computing) has gradually become a new computing paradigm, which allows users to directly deploy function codes without having to consider the infrastructure, while providing high flexibility and rapid birth and destroy ability. However, existing cloud functions usually run in fully functional containers, with problems such as high startup latency, low resource sharing, and long image build and distribution time. This paper analyzes and verifies the key factors affecting Linux container startup latency and resource sharing, and presents a cloud function-oriented lightweight runtime environment construction method, which defines the runtime environment from four aspects: resource isolation, resource restriction, file system, and network communication. Based on the operating system virtualization technology, the resource sharing is improved by further extracting the shared layer, and the startup speed is accelerated by reducing the performance bottleneck of network isolation and control group operation. Based on these designs, we implement FRE (Function Runtime Environment), a lightweight runtime environment engine. Finally, we carry out a series of comparative experiments on sequence and concurrent startup time, memory re-source utilization, image volume etc. between FRE and Docker, and verify the effectiveness of the proposed method in the cloud function scenario.
文章引用:吴绍岭, 田春岐, 万兴, 王伟. 一种面向云函数的超轻量运行时环境构建方法[J]. 计算机科学与应用, 2020, 10(11): 1993-2005. https://doi.org/10.12677/CSA.2020.1011211

参考文献

[1] Hayes, B. (2008) Cloud Computing. Communications of the ACM, 51, 9-11. [Google Scholar] [CrossRef
[2] Wang, L., et al. (2018) Peeking behind the Curtains of Serverless Platforms. USENIX ATC’18 Proceedings of the 2018 USENIX Conference on Usenix Annual Technical Conference, Boston, MA, 11-13 July 2018, 133-145.
[3] Jonas, E., et al. (2019) Cloud Programming Simplified: A Berkeley View on Serverless Computing.
[4] Lloyd, W., et al. (2018) Serverless Computing: An Investigation of Factors Influencing Microservice Performance. 2018 IEEE International Conference on Cloud Engineering (IC2E), Orlando, 17-20 April 2018, 159-169. [Google Scholar] [CrossRef
[5] OpenWhisk.
https://openwhisk.apache.org
[6] Kubeless.
https://kubeless.io
[7] 吴松, 王坤, 金海. 操作系统虚拟化的研究现状与展望[J]. 计算机研究与发展, 2019, 56(1): 58-68.
[8] Seo, K.T., Hwang, H.S., Moon, I.Y., et al. (2014) Performance Comparison Analysis of Linux Con-tainer and Virtual Machine for Building Cloud. Advanced Science and Technology Letters, 66, 105-111. [Google Scholar] [CrossRef
[9] Merkel, D. (2014) Docker: Lightweight Linux Containers for Con-sistent Development and Deployment. Linux Journal, 2014, Article No. 2.
[10] Namespace-Linux Namespace.
https://man7.org/linux/man-pages/man7/namespaces.7.html
[11] Cgroups-Linux Control Groups. http://man7.org/linux/man-pages/man7/cgroups.7.html
[12] Harter, T., Salmon, B., Liu, R., et al. (2016) Slacker: Fast Distribution with Lazy Docker Containers. 14th USENIX Conference on File and Storage Technologies, Santa Clara, CA, 181-195.
[13] Thalheim, J., et al. (2018) Cntr: Lightweight OS Containers. 2018 USENIX Annual Technical Conference, Boston, MA, 11-13 July 2018.
[14] Wu, X.B., Wang, W.G. and Song, J. (2015) Totalcow: Unleash the Power of Copy-on-Write for Thin-Provisioned Containers. Proceedings of the 6th Asia-Pacific Workshop on Systems, Tokyo, July 2015. [Google Scholar] [CrossRef
[15] Oakes, E., Yang, L., Houck, K., et al. (2017) Pipsqueak: Lean Lambdas with Large Libraries. 2017 IEEE 37th International Conference on Distributed Computing Systems Workshops (ICDCSW), Atlanta, 5-8 June 2017, 395-400. [Google Scholar] [CrossRef
[16] Oakes, E., Yang, L., Zhou, D., et al. (2018) SOCK: Rapid Task Provisioning with Serverless-Optimized Containers. 2018 USENIX Annual Technical Conference, Boston, MA, 11-13 July 2018, 57-70.
[17] Akkus, I.E., Chen, R., Rimac, I., et al. (2018) SAND: Towards High-Performance Serverless Computing. 2018 USENIX Annual Technical Conference, Boston, MA, 11-13 July 2018, 923-935.
[18] Engler, D.R., et al. (1995) Exokernel: An Operating System Architecture for Application-Level Resource Management. ACM SIGOPS Operating Systems Review, 29, 251-266. [Google Scholar] [CrossRef
[19] Madhavapeddy, A., et al. (2013) Unikernels: Library Operating Sys-tems for the Cloud. Proceedings of the Eighteenth International Conference on Architectural Support for Programming Languages and Operating Systems, Vol. 41, 461-472. [Google Scholar] [CrossRef
[20] Manco, F., Lupu, C., Schmidt, F., et al. (2017) My VM Is Lighter (and Safer) than your Container. Proceedings of the 26th Symposium on Operating Systems Principles, Shanghai, Octo-ber 2017, 218-233. [Google Scholar] [CrossRef
[21] Shillaker, S. (2018) A Provider-Friendly Serverless Framework for Latency-Critical Applications. 12th Eurosys Doctoral Workshop, Porto, 23 April 2018.
[22] McGrath, G. and Brenner, P.R. (2017) Serverless Computing: Design, Implementation, and Performance. 2017 IEEE 37th International Conference on Distributed Computing Systems Workshops (ICDCSW), Atlanta, 5-8 June 2017, 405-410. [Google Scholar] [CrossRef
[23] Dumazet, E. (2020) Re: Net: Cleanup Net Is Slow.
https://lkml.org/lkml/2017/4/21/533
[24] Ferreira, J.B., Cello, M. and Iglesias, J.O. (2017) More Sharing, More Benefits? A Study of Library Sharing in Container-Based Infrastructures. In: LNCS 10417: Proc. of the 23rd European Conf on Parallel Processing, Springer, Cham, 358-371. [Google Scholar] [CrossRef
[25] Zhang, L.Q., et al. (2019) An Ultra Lightweight Container That Maximizes Memory Sharing and Minimizes the Runtime Envi-ronment. Journal of Computer Research and Development, 56, 1545.