节点文献
基于微内核的容器资源隔离机制研究
Research on Microkernel-Based Container Resource Isolation Mechanism
【作者】 张奇;
【导师】 金海;
【作者基本信息】 华中科技大学 , 计算机技术, 2021, 硕士
【摘要】 随着人工智能物联网时代的到来,越来越多的智能设备需要操作系统的支持。微内核架构操作系统具有内核精简、系统服务弱耦合的特性,这使其易于裁剪或扩展以适配各种各样的设备,但通过一套系统整合云边端各种异构设备又对应用的部署和迁移提出了巨大挑战。容器可以为各种应用提供一个可靠的轻量级虚拟运行环境,这为这些挑战提供了一条应对之策,但微内核架构操作系统上缺乏容器运行所必需的资源隔离机制,难以确保各容器公平地共享宿主机的物理资源。针对这个问题,结合微内核架构操作系统服务抽象、模块化的特点,在保持内核精简性的前提下设计并实现了微内核架构操作系统上的资源隔离机制。资源隔离机制总体上由用户态伪文件系统和各个资源隔离子系统所组成:1)用户态伪文件系统作为用户与各个资源隔离子系统交互的媒介,转发控制信息至各个资源隔离子系统;2)CPU资源隔离子系统结合系统现有的进程调度策略,确定了依据CPU权重值为进程分配时间片的CPU资源控制方式,保证了CPU资源的定量分配;3)内存资源隔离子系统根据以物理块为单位的内存分配策略,判断进程的每次内存申请是否超出用户设定的硬限制值,据此来决定是否满足其内存申请,从而限制进程的内存资源使用量;4)Freezer进程控制子系统通过系统调用改变进程在内核进程表中的状态标志位,借助内核中的进程调度机制来控制进程的运行状态。依托开源微内核架构操作系统Minix实现了资源隔离机制。资源隔离机制使系统物理资源变得用户可控,保证了容器之间不会出现对物理资源的无序竞争,避免了容器之间的互相干扰。测试结果表明,资源隔离机制可实现良好的隔离效果,资源隔离机制的引入仅为系统带来了最多3.14%的性能开销。
【Abstract】 With the advance of Artificial Intelligence and Internet of Things,more and more smart devices need operating system support.Microkernel architecture operating system has the characteristics of simple kernel and weak coupling of system services,which makes it easy to tailor or expand to adapt to various devices.However,integrating various heterogeneous devices in the cloud and edge through one system poses great challenges to the deployment and migration of applications.Containers can provide a reliable lightweight virtual operating environment for various applications,which provides a solution to these challenges.However,microkernel architecture operating system lacks resource isolation mechanism necessary for containers.It is difficult to ensure that each container fairly shares physical resources of host.In order to solve this problem,considering features of the microkernel architecture operating system’s service abstraction and modularization,microkernel-based resource isolation mechanism was designed and implemented while maintaining the simplicity of the kernel.The resource isolation mechanism is composed of a pseudo-file system and various resource isolation subsystems existing in the user space of operating system: 1)Pseudo file system acts as a medium for users to interact with each resource isolation subsystem,and forwards control information to each resource isolation subsystem;2)Combined with existing process scheduling strategy of system,CPU resource isolation subsystem allocates time slices to processes according to CPU weight value set by users,so as to ensure the quantitative allocation of CPU resources;3)According to the system’s memory allocation strategy in units of physical blocks,memory resource isolation subsystem determines whether each memory request of target process exceeds the hard limit value set by users,and then determines whether to satisfy its memory request,thereby limiting the amount of memory resources that the process can use;4)Freezer process control subsystem changes the status flag bit of process in the kernel process table through system calls,and controls running status of the process with the help of process scheduling mechanism in the kernel.Based on Minix,an open-source microkernel architecture operating system,resource isolation mechanism is realized.The resource isolation mechanism makes physical resources of system user-controllable.It ensures that there will be no disorderly competition for physical resources between containers,so as to avoid mutual interference between containers.Test results show that the resource isolation mechanism can achieve a good isolation effect,and the implementation of the resource isolation mechanism only brings a maximum of 3.14% performance overhead to system.
【Key words】 Internet of Things; Microkernel; Container; Resource isolation mechanism;
- 【网络出版投稿人】 华中科技大学 【网络出版年期】2022年 10期
- 【分类号】TP333
- 【下载频次】50