Method and system for improving software container performance and isolation

Through the kernel-based isolation layer and X-container architecture, the binary compatibility and multi-process support issues of software containers are solved, high performance and security isolation are achieved, and it is suitable for modern application requirements.

CN112236752BActive Publication Date: 2024-09-27CORNELL UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201980038261.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2018-04-11
Filing Date
2019-04-11
Publication Date
2024-09-27
Estimated Expiration
2039-04-11

AI Technical Summary

Technical Problem

Existing software containers lack the binary compatibility and support for multiple processes required to run modern applications, and trends in ex-kernel and library operating systems are incompatible, making security isolation and performance optimization difficult to achieve.

Method used

Adopting a kernel-based isolation layer, combined with a dedicated operating system kernel and hypervisor, to implement the X-container architecture, support unmodified multi-processing applications, and apply binary replacement through automatic dynamic optimization to reduce system call overhead and provide binary compatibility and safe isolation.

Benefits of technology

Significantly improves the performance and isolation capabilities of software containers, reduces the attack surface and trusted computing base, supports the safe operation of multiple processes, solves traditional container isolation problems such as the impact of meltdown CPU errors, and implements integration with Unikernel and Competitive performance of Graphene.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112236752B_ABST
    Figure CN112236752B_ABST
Patent Text Reader

Abstract

In one embodiment, a method includes: implementing a kernel-based isolation layer, configuring a software container on the kernel-based isolation layer to include a dedicated operating system kernel as a library operating system, and executing one or more user processes in the software container. The method is performed by a cloud-based processing platform, an enterprise processing platform, or other types of processing platforms including multiple processing devices, each of which includes a processor coupled to a memory. The library operating system illustratively runs in the software container at the same privilege level as the one or more user processes executed in the software container. The library operating system is illustratively configured to support automatic binary translation of one or more user processes in conjunction with converting system calls to corresponding function calls.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] Priority declaration

[0002] This application claims priority to U.S. Provisional Patent Application Serial No. 62 / 656,051, filed on April 11, 2018, entitled “Method and System for Improving Software Container Performance and Isolation,” the entire contents of which are incorporated herein by reference.

[0003] Government Support Statement

[0004] This invention was made with government support under Contract Nos. CSR-1422544, CNS-1601879, CSR-1704742, 1053757, and 0424422 awarded by the National Science Foundation (NSF); Contract Nos. 60NANB15D327 and 70NANB17H181 awarded by the National Institute of Standards and Technology (NIST); and Contract Nos. FA8750-10-2-0238, FA8750-11-2-0256, and D11AP00266 awarded by the Defense Advanced Research Projects Agency (DARPA). The government has certain rights in this invention. Technical Field

[0005] The field relates generally to information handling systems and, more particularly, to software containers for use in such systems. Background Art

[0006] Containers have become the preferred method for packaging applications and are a key component in serverless architectures and many other types of processing platforms. At the same time, exokernel architectures are gaining traction as hypervisors act as exokers and many library operating systems (OS) are offered or under development. Exokers have superior security isolation properties due to their smaller trusted computing base (TCB) and attack surface, while library OSes can be customized for specific applications. Unfortunately, these two trends are currently incompatible with each other. Current library OSes lack the binary compatibility and support for multiple processes required to run modern application containers. Summary of the invention

[0007] Illustrative embodiments provide improved software containers, referred to herein as X-containers. In the X-container architecture in one or more embodiments, the X-container runs on the X-kernel together with a dedicated Linux kernel as a library OS, illustratively implemented using one of a hypervisor and a host operating system. The X-kernel is an example of what is more generally referred to herein as a "kernel-based isolation layer." The resulting X-container arrangement illustratively supports unmodified multi-processing applications and automatically and dynamically optimizes application binary replacements. In some embodiments, this type of X-container advantageously provides a significant reduction in system call overhead compared to unmodified Linux, while also significantly outperforming library OSes (like Unikernel and Graphene) on network benchmarks.

[0008] In one embodiment, a method includes implementing a kernel-based isolation layer, configuring a software container on the kernel-based isolation layer to include a dedicated operating system kernel as a library operating system, and executing one or more user processes in the software container. The method is performed by a cloud-based processing platform, an enterprise processing platform, or other type of processing platform including a plurality of processing devices, wherein each such processing device includes a processor coupled to a memory.

[0009] The library operating system illustratively runs in the software container at the same privilege level as the privilege level of one or more user processes executing in the software container.

[0010] In some embodiments, the library operating system is illustratively configured to support automatic translation of binaries of one or more user processes in conjunction with converting system calls to corresponding function calls.

[0011] These and other illustrative embodiments of the present invention include, but are not limited to, systems, methods, apparatus, processing devices, integrated circuits, and computer program products including processor-readable storage media having software program code embodied therein. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 An information processing system including a cloud-based processing platform implementing X-containers in an illustrative embodiment is shown.

[0013] Figure 2 An information processing system including an enterprise processing platform implementing X-Containers in an illustrative embodiment is shown.

[0014] Figure 3 An example arrangement of X-containers in an illustrative embodiment is shown.

[0015] Figure 4Isolation boundaries in various architectures, including an architecture utilizing X-containers as disclosed herein, are shown.

[0016] Figure 5 An alternative configuration of two applications using different numbers of X-containers in an illustrative embodiment is shown.

[0017] Figure 6 An example of binary replacement implemented in one or more X-containers in an illustrative embodiment is shown.

[0018] Figure 7 An example of a software stack used in the evaluation of the illustrative embodiments is shown.

[0019] Figures 8 to 12 is a diagram showing the results of an evaluation performed on the exemplary embodiment. DETAILED DESCRIPTION

[0020] Embodiments of the present invention may be implemented, for example, in the form of an information processing system that includes a computer network or other arrangements of networks, clients, servers, processing devices, and other components. Illustrative embodiments of such systems will be described in detail herein. However, it should be understood that embodiments of the present invention are more generally applicable to a variety of other types of information processing systems and associated networks, clients, servers, processing devices, or other components. Therefore, the term "information processing system" as used herein is intended to be broadly interpreted as covering these arrangements and other arrangements.

[0021] Figure 1 An information processing system 100 implementing an X-container in an exemplary embodiment is shown. System 100 includes a plurality of user devices 102 - 1 , 102 - 2 , . . . , 102 -N. User device 102 is configured to communicate with a cloud-based processing platform 104 via a network 105 .

[0022] One or more of the user devices 102 may each include, for example, a laptop computer, a tablet computer or a desktop personal computer, a mobile phone or another type of computer or communication device, as well as a combination of multiple such devices. In some embodiments, one or more of the user devices 102 may include corresponding computing nodes, which are illustratively implemented on one or more processing platforms (possibly including a cloud-based processing platform 104).

[0023] It is assumed that the communication between the various elements of the system 100 occurs over one or more networks collectively represented in the figure by network 105. Network 105 may illustratively include, for example, a global computer network (such as the Internet), a wide area network (WAN), a local area network (LAN), a satellite network, a telephone or cable network, a cellular network, a wireless network implemented using a wireless protocol (such as WiFi or WiMAX), or various portions or combinations of these and other types of communication networks.

[0024] The cloud-based processing platform 104 is an example of what is more generally referred to herein as a "processing platform" that includes multiple processing devices, each including a processor coupled to a memory. One or more of the processing devices may each include multiple processors and / or multiple memories.

[0025] The processor of a given such processing device of a processing platform may include, for example, a microprocessor, an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), a central processing unit (CPU), an arithmetic logic unit (ALU), a graphics processing unit (GPU), a digital signal processor (DSP), or other similar processing device components, as well as other types and arrangements of processing circuit systems, in any combination.

[0026] The memory of a given such processing device of a processing platform may include, for example, electronic memory (such as static random access memory (SRAM), dynamic random access memory (DRAM) or other types of RAM), read-only memory (ROM), flash memory or other types of non-volatile memory, magnetic memory, optical memory, or other types of storage devices, in any combination.

[0027] The memory illustratively stores program code for execution by the process. Such memory is an example of what is more generally referred to herein as a "processor-readable storage medium" having program code embodied therein.

[0028] Articles of manufacture including such processor-readable storage media are considered embodiments of the present invention.The term "article of manufacture" as used herein should be understood to exclude transitory, propagating signals.

[0029] In other embodiments, other types of computer program products including processor-readable storage media may be implemented.

[0030] Furthermore, embodiments of the present invention may be implemented in the form of an integrated circuit including processing circuitry configured to implement processing operations associated with implementing X-containers as disclosed herein.

[0031] A given processing device of a cloud-based processing platform 104 or other processing platform disclosed herein will typically include other components in addition to the processor and memory described above. For example, a given processing device illustratively includes a network interface that is configured to allow the processing device to communicate with other system elements via a network 105. Such a network interface illustratively includes one or more conventional transceivers.

[0032] The cloud-based processing platform 104 in this embodiment more specifically utilizes a virtualization infrastructure 112 running on a physical infrastructure 114 to implement multiple X-containers 110. The physical infrastructure 114 illustratively includes multiple processing devices of the above-mentioned types, each processing device including at least one processor and at least one memory. For example, in some embodiments, the physical infrastructure includes a bare metal host or other type of computer or server. The virtualization infrastructure 112 in some embodiments includes a virtual machine hypervisor, although a hypervisor is not required to implement the X-container 110. Therefore, in other embodiments, the virtualization infrastructure 112 can be eliminated.

[0033] Figure 2 The information processing system 200 of FIG. 1 represents a possible alternative embodiment that does not include a virtualization infrastructure (such as virtualization infrastructure 112). In system 200, enterprise processing platform 204 implements multiple X-containers 210 directly on physical infrastructure 214, eliminating any hypervisor or other virtualization infrastructure between X-containers 210 and the underlying physical infrastructure 214, which is illustratively implemented as a bare metal host or other type of computer or server. The other elements of system 200 are generally combined with the above in other aspects. Figure 1 The elements are the same as those described for system 100 .

[0034] It should be understood that Figure 1 and Figure 2 The specific arrangements of systems 100 and 200 shown in FIG. 1 are presented by way of illustrative examples only, and many other arrangements are possible.

[0035] For example, while the embodiments implement X-containers in respective cloud-based and enterprise processing platforms, a variety of additional or alternative processing platforms may be used, such as Internet of Things (IoT) platforms and Network Function Virtualization (NFV) platforms.

[0036] Other examples include platforms implemented according to a Platform as a Service (PaaS) model, a Software as a Service (SaaS) model, an Infrastructure as a Service (IaaS) model, and / or a Function as a Service (FaaS) model, as well as enterprise application container platforms, serverless computing platforms, microservices platforms, and cloud-based native application platforms, and other general-purpose cloud computing or enterprise computing infrastructures. More generally, X-Containers can be implemented on any platform that can benefit from their security and performance advantages.

[0037] When implementing X-container 110 or 210, system 100 or 200 is illustratively configured to implement what is referred to herein as a "kernel-based isolation layer". A given one of X-containers 110 or 210 is illustratively configured as a software container on a kernel-based isolation layer. A given X-container includes a dedicated operating system kernel as a library operating system, and one or more user processes are executed in a given X-container. In some embodiments, the kernel-based isolation layer is more specifically implemented in the form of an X-kernel relative to the dedicated operating system kernel of the X-container. The X-kernel may more specifically include at least a portion of a virtual machine hypervisor or a host operating system. In other embodiments, other types of kernel-based isolation layers may be used.

[0038] Figure 3 A portion of an information processing system 300 is shown, which includes an example arrangement of X-containers 310 in an illustrative embodiment. In this example, the X-containers 310 more specifically include a first X-container 310-1, a second X-container 310-2, and a third X-container 310-3, all of which are implemented on an X-kernel 312.

[0039] As described above, in some embodiments, the X-kernel may include a virtual machine hypervisor (e.g., Xen). For example, the X-kernel 312 in a given embodiment of this type may use Figure 1 The virtualization infrastructure 112 may be implemented by one or more hypervisors of the virtualization infrastructure 112. Virtual machines are also referred to herein as individual VMs.

[0040] In other embodiments, X-kernel 312 may include at least a portion of the host operating system. For example, in this type of embodiment, the X-kernel may be implemented using a Linux kernel or a Windows OS kernel. Such an embodiment illustratively directly in Figure 2 runs on physical infrastructure 214.

[0041] By way of example only, the first X-container 310-1 contains a single user process, the second X-container 310-2 contains two user processes, and the third X-container 310-3 contains three user processes. Different numbers and arrangements of X-containers and their corresponding associated processes (or multiple associated processes) may be used.

[0042] Figure 3 Each of the X-containers 310 in the embodiment contains a corresponding dedicated operating system kernel as a library operating system (represented as X-LibOS in the figure). X-LibOS is illustratively converted from a single operating system kernel of a specified type. X-LibOS runs in the X-container at the same privilege level as the privilege level of one or more user processes executed in the X-container. X-LibOS is illustratively configured to support automatic translation of the binary of one or more user processes in conjunction with converting system calls into corresponding function calls, as will be described in more detail elsewhere herein.

[0043] As described above, each of the X-containers 310 on the X-kernel 312 includes a separate dedicated operating system kernel as its corresponding X-LibOS instance. One or more user processes of different groups are executed using their corresponding X-LibOS instances in corresponding X-containers in the X-containers 310. Therefore, the user process executed in any one of the X-containers 310 is securely isolated from the user process executed in each of the other X-containers in the X-container 310.

[0044] The X-kernel 312 and X-LibOS instances of the corresponding X-container 310 need not all utilize the same type of operating system. For example, a given one of the X-kernel 312 and X-LibOS instance may be implemented using different types of corresponding first and second operating systems.

[0045] In some embodiments, configuring a given one of the X-containers 310 on the X-kernel 312 to include a dedicated operating system kernel as its X-LibOS instance further includes extracting a container image of an existing software container, and utilizing the extracted container image as a virtual machine image when configuring the X-container on the X-kernel 312. In this type of arrangement, the X-container on the X-kernel 312 may contain a packaged version of an existing software container. In such an embodiment, one or more user processes of an existing software container are illustratively allowed to execute as one or more user processes in a given X-container on the X-kernel 312 without any modification to those one or more user processes.

[0046] Different types of X-containers 310 may be implemented in different embodiments. For example, in some embodiments, X-containers 310 are implemented as what is referred to herein as paravirtualized X-containers or PV X-containers, in which a library operating system and one or more user processes run in user mode. Some embodiments of this type illustratively implement X-kernel 312 as a modified version of another standard hypervisor or operating system kernel.

[0047] As another example, in other embodiments, the X-container is implemented as what is referred to herein as a hardware-assisted virtualized X-container or HV X-container, where the library operating system and one or more user processes run in kernel mode within a hardware-assisted virtual machine. Some embodiments of this type implement the X-kernel 312 as a standard hypervisor or operating system kernel. In other embodiments of this type, some modifications may also be made to the hypervisor or operating system.

[0048] Figure 3 The example X-container architecture shown in provides improved performance and isolation for software containers. In some embodiments, the X-container architecture transforms a traditional single operating system kernel (such as the Linux kernel) into an X-LibOS instance that runs at the same privilege level as one or more user processes in the X-container. The isolation of different X-containers is protected by the minimum trusted computing base and kernel attack surface.

[0049] Unlike traditional container implementations, X-Container Isolation is not sensitive to the recently discovered Meltdown CPU bug that affects most Intel processors manufactured in the past 20 years. The illustrative embodiments can be used to mitigate issues with container isolation caused by this vulnerability and other security issues.

[0050] In some embodiments, the X-container is illustratively configured to automatically translate system call instructions into function calls, which enables full binary compatibility to be supported, as in some embodiments, existing containers can run in the X-container without any modification.

[0051] X-Containers exhibit enhanced isolation compared to conventional approaches. For example, the disclosed arrangement prevents a compromised container on a given host from putting other containers on the same host at risk. X-Containers provide secure container isolation for existing applications, as well as solutions to urgent container security issues such as the above-mentioned Meltdown vulnerability.

[0052] As described above, in an exemplary embodiment, X-containers solve these and other problems by using a hypervisor or operating system kernel for an X-kernel (e.g., acting as a so-called "exo-kernel") A traditional single operating system kernel (such as a Linux kernel) is illustratively converted to a library OS, and it runs with one or more user processes at the same privilege level.

[0053] User process binaries can be dynamically patched to convert system calls to function calls for best performance and full binary compatibility.

[0054] Existing Linux containers (e.g., Docker, LXC) can be automatically wrapped into X-Containers by extracting the container disk image and using it as a virtual machine image.

[0055] The X-container architecture can be used in public container clouds or serverless computing platforms that support secure isolation and efficient execution of programs from mutually untrusted users, as well as in a variety of other cloud-based processing platforms or enterprise processing platforms.

[0056] As mentioned above, in some embodiments, X-kernel and X-LibOS instances can be implemented based on different operating system types. For example, X-kernel can be implemented based on Xen, and X-LibOS can be implemented based on the Linux kernel.

[0057] In some embodiments, the X-container architecture utilizes a Linux kernel modified to act as an efficient LibOS in order to provide full compatibility with existing applications and kernel modules, while a hypervisor or operating system kernel can be used as an exo-kernel to run and isolate X-containers.

[0058] Each X-container illustratively hosts an application with a dedicated and possibly customized LibOS based on the Linux kernel. An X-container can support one or more user processes, where one or more user processes run with the LibOS at the same privilege level. For resource management and compatibility, different processes still have their own address space, but they no longer provide security isolation between each other, because processes are used for concurrency, and X-containers provide isolation.

[0059] The X-container architecture automatically optimizes application binaries during runtime to improve performance by rewriting expensive system calls into cheaper function calls into LibOS. X-containers have much higher raw system call throughput than native Docker containers, and for other benchmarks, they are competitive with or better than native containers.

[0060] The X-Container architecture also outperforms architectures dedicated to containers and serverless services. For example, we have run the wrk network benchmark with NGINX on X-Container, Unikernel, and Graphene. Under this benchmark, the X-Container architecture has comparable performance to Unikernel and has about twice the throughput of Graphene. However, when running PHP and MySQL, the X-Container architecture shows much better performance than Unikernel.

[0061] Although in some embodiments, the X-container architecture leverages many software foundations of Linux, the design and implementation methods must address various challenges. The illustrative embodiments include multiple different example designs. In the first example design, we run the Linux kernel in user mode with user processes on top of Xen. This requires a lot of modifications to the Xen hypervisor, but no special hardware support is required. In fact, this design can run both on bare metal and inside virtual machines in public clouds. In the second example design, we run user processes in kernel mode with a Linux kernel that leverages hardware virtualization support. This design can run on any hypervisor and still securely isolate different containers. In both cases, only the architecture-dependent parts of Linux need to be modified.

[0062] In some embodiments, the X-container architecture includes an exo-kernel-based container architecture that is compatible with Linux containers and provides performance and isolation that is competitive or superior to native Docker containers and other LibOS designs. Moreover, this architecture supports secure isolation of containers without sacrificing compatibility, portability, or performance.

[0063] X-Containers as disclosed herein can be used to package and distribute software components and serve as basic building blocks in serverless and microservices architectures, providing advantages such as portability (because developers can load an application and all its dependencies in a container, which can then run anywhere in public and private clouds) and performance (because containers can be booted in milliseconds with negligible overhead compared to virtual machines). In other embodiments, X-Containers support a variety of other use cases.

[0064] It is apparent from the foregoing that in the exemplary embodiments, X-containers provide significant advantages over conventional approaches. For example, X-containers provide a new security model based on a library OS, with significantly improved performance and isolation over conventional approaches. We support multiple processes sharing the same library OS, an important feature for a large class of containers. Using our approach, we turn the Linux kernel itself into a library OS, providing 100% compatibility. The exemplary embodiments redirect system calls only when we see them for the first time, and then automatically convert them into function calls to optimize subsequent execution. The exemplary embodiments allow existing unmodified containers to be run while also automatically optimizing the binary for performance. Moreover, such embodiments have a significantly reduced attack surface and TCB, and are therefore much more secure. A variety of different implementations are possible, including embodiments without hardware virtualization support.

[0065] The above-described aspects of these and other exemplary embodiments disclosed herein are presented by way of example only and should not be construed as limiting in any way.

[0066] Now refer to Figures 4 to 12 Additional details regarding the operation of the exemplary embodiments are described.

[0067] Modern OSes that support multiple users and processes support various types of isolation, including kernel isolation, which ensures that a process cannot compromise the integrity of the kernel or read confidential information held in the kernel, and process isolation, which ensures that one process cannot easily access or harm another process.

[0068] The cost of protecting kernel isolation can be high. System calls for accessing kernel code are orders of magnitude slower than function calls into libraries. Moreover, to eliminate data dependencies between kernel and user-mode code, data copies are often performed in the input-output (I / O) stack. At the same time, there is a trend to push more and more functionality into the OS kernel, and it is becoming increasingly difficult to defend against attacks on the kernel. Modern single OS kernels (such as Linux) have become huge code bases with complex services, device drivers, and system call interfaces. It is impractical to verify the security of such a complex system, and new vulnerabilities are constantly being discovered.

[0069] Process isolation is similarly problematic. First, this type of isolation often relies on kernel isolation due to the way it is implemented and enforced. But perhaps more importantly, processes are not only intended for security isolation. They are primarily used for resource sharing and concurrency support, and to support this, modern OSes provide interfaces across isolations, including shared memory, shared file systems, signaling, user groups, and debug hooks. These mechanisms expose a large attack surface, which creates many vulnerabilities for applications that rely on processes for security isolation.

[0070] For example, the Apache web server spawns child processes with the same user ID. A compromised process can easily access the memory of other processes by exploiting debugging interfaces (such as ptrace) or the proc file system. Without careful configuration, a compromised process could also access shared file systems and steal information from configuration files or even databases. Finally, there are privilege escalation attacks that allow hackers to gain root privileges in order to defeat most process isolation mechanisms without compromising the kernel.

[0071] In fact, few existing multi-client applications rely on processes to isolate mutually untrusted clients, and in particular, they do not specify a process for each client. Many do not even use processes at all. For example, popular production systems (such as NGINX web server, Apache Tomcat, MySQL, and MongoDB) use event-driven models or multithreading instead of multiprocessing. Multi-process applications (such as Apache web server) use process pools to achieve concurrency, but not security, so that each process has multiple threads and can be reused to serve different clients. These applications implement client isolation in the application logic, using mechanisms such as role-based access control, authentication, and encryption.

[0072] However, there are exceptions. The SSH daemon relies on process isolation to isolate different users. Also, if there are multiple applications using the same MySQL daemon on the same kernel, the combination of process isolation and client isolation built into MySQL provides security for the applications in case some applications are compromised, because each application appears to be a different client to MySQL.

[0073] The exemplary embodiments disclosed herein involve rethinking the isolation boundary, as will now be referred to in Figure 4 As described.

[0074] Processes are useful for resource management and concurrency, but ideally, security isolation should be divorced from the process model. In practice, other isolation mechanisms have been introduced.

[0075] Figure 4Isolation boundaries in various alternative architectures are shown. Container isolation separates namespaces above the kernel so that each container appears to be its own instantiation of the kernel. However, the technology used is essentially the same as process isolation, in that any isolation that can be achieved with containers can be achieved without containers. It does not address the problem that the kernel is a large and vulnerable TCB with a large attack surface due to the many system calls available.

[0076] From a security perspective, running containers in individual virtual machines (VMs), each with its own dedicated kernel, is a possible solution. TCBs today consist of a relatively small hypervisor with a much smaller attack surface. Unfortunately, the overhead is high due to redundant resource consumption and isolation boundaries. Nonetheless, this is now a de facto solution for multi-tenant container clouds. In response to the high cost of this solution, more experimental systems such as Unikernel, EbbRT, OSv, and Dune are lightweight OS kernel alternatives designed to run inside VMs. Unfortunately, they do not support existing applications well due to a lack of binary-level compatibility. Moreover, they can usually only support single-process applications.

[0077] In a microkernel architecture, most traditional OS services run in separate user processes along with application processes. This architecture can provide binary compatibility. However, since different applications share those OS services, compromised OS services will destroy the isolation between applications, making it impossible to reduce TCB and attack surface. Moreover, the system call overhead is often large.

[0078] The X-container architecture in the illustrative embodiments of this document provides an improved paradigm for secure isolation between applications. For example, in some embodiments, the architecture is based on an exo-kernel architecture, with a smaller kernel attack surface and lower system call overhead. A single X-container can have multiple processes, for example for resource management and concurrency, but those processes in a single X-container are not isolated from each other. Instead, users and / or applications are isolated from each other by generating separate X-containers for different users and / or applications. Eliminating isolation within an X-container can reduce system call overhead to the overhead of a function call.

[0079] As described above, in an exemplary embodiment, X-Container uses X-LibOS based on a standard OS kernel with full binary compatibility. In some embodiments, X-LibOS is derived from Linux, and only the architecture-dependent parts of Linux need to be changed. The advantages of using a standard kernel are many. For example, Linux is highly optimized and mature, and is being developed by an active community. X-Container takes full advantage of this, but relies on a much smaller X-kernel for isolation. In some embodiments, the X-kernel is derived from Xen.

[0080] As mentioned before, different applications should be placed in different X-containers. Figure 5 This is shown in the context of an illustrative embodiment involving two applications each using a MySQL database. Figure 5 It consists of three parts, expressed as Figure 5 (a) Figure 5 (b) and Figure 5 (c).

[0081] One option is to create X-containers for each application, plus a third X-container dedicated to MySQL, such as Figure 5 (a) In other words, this option treats MySQL as its own isolated application. MySQL contains access control logic to safely separate the tables of the two applications.

[0082] A safer configuration would create two instances of MySQL, one for each application, each running in its own X-container, resulting in a total of four X-containers, such as Figure 5 (b) shows. This will eliminate the reliance on access control logic within the MySQL implementation, and thus strictly improve the security of the configuration. In addition, this option will provide better customizability, both for the MySQL server and the operating system kernel that supports them.

[0083] However, please note Figure 5 (b) Each application has its own MySQL instance. Each application relies on its MySQL instance to persist its data and respond to queries correctly, while in contrast, each MySQL instance is dedicated and will not lose anything by being compromised by its own application. Therefore, we can safely deploy only two X-containers, each containing the application logic and its dedicated MySQL instance, such as Figure 5 (c). This option provides Figure 5 (a) and Figure 5 (b) shows much better performance for three or four X-container configurations, respectively.

[0084] For applications running on X-containers (or containers in general), we can consider two types of threats: external threats and internal threats, and these threats may collude with each other. One external threat consists of messages designed to destroy application logic. This threat can be resisted by the application and operating system logic, and is the same for standard containers and X-containers. Another external threat may attempt to break through the isolation barrier of the container. In the case of standard containers, this isolation barrier is provided by the underlying general-purpose operating system kernel, which has a large TCB and a large attack surface due to a large number of system calls. In contrast, in an exemplary embodiment, the X-container relies on a relatively small X-kernel dedicated to providing isolation for isolation. It has a smaller TCB and a small number of hypervisor calls that are relatively easy to protect. We believe that X-containers provide better protection against external threats in a strict sense than standard containers.

[0085] Insider threats are posed by applications that rely on third-party libraries or, as in the MySQL example above, third-party services deployed in the same container. In Linux containers, applications trust Linux to provide isolation between processes owned by different user accounts. X-containers explicitly do not provide security isolation between processes in the same container. Applications that rely on security isolation barriers between processes should use standard VM and Linux solutions or reorganize the application so that conflicting processes run in different X-containers. The latter will provide better security but requires more implementation effort.

[0086] Additional design and implementation details of an illustrative embodiment of an X-container will now be described.

[0087] Ideally, containers should provide a secure and isolated environment for running applications. The following are key principles for designing an architecture for running application containers securely:

[0088] 1. Self-sufficiency and customizability: The container should contain all the dependencies of the application. This includes not only libraries, file system layout, and third-party tools, but also the OS kernel. The container should be able to use a customized OS kernel and load its own kernel modules.

[0089] 2. Compatibility: Ideally, a container platform should not require changes to applications. Binary-level compatibility allows users to deploy containers immediately without rewriting or even recompiling their applications.

[0090] 3. Isolation with smaller TCB: Containers should be securely isolated from each other. Although it is necessary to share privileged software to access shared physical resources, the software must be trusted and should be small.

[0091] 4. Portability: The key advantage of containers is that they are packaged once and can then be run anywhere, including bare metal and virtualized cloud environments.

[0092] 5. Scalability and efficiency: Application containers should be lightweight and execute with less overhead.

[0093] In some embodiments of the X-container disclosed herein, we use the hypervisor as the X-kernel, and we modify the Linux kernel distribution to an X-LibOS instance, which allows it to run in the same privileged mode as the application. We describe the following two example embodiments in more detail:

[0094] 1. Paravirtualized (PV) X-Containers that run X-LibOS and applications in user mode. This implementation illustratively requires modifications to the hypervisor (running in kernel mode), but it does not require special hardware support and can be deployed on bare metal as well as in VMs deployed in public clouds.

[0095] 2. Hardware-assisted virtualization (HV) of X-Containers, which runs X-LibOS and applications in kernel mode. This implementation illustratively requires hardware virtualization support, but works with an unmodified hypervisor.

[0096] For the first implementation example above, we have based the X-kernel implementation on Xen. Xen is open source, and support for its paravirtualization interface in Linux is mature. For the second implementation example, we used unmodified Xen with hardware virtualization as the X-kernel, but other hypervisors can also be used. For example, we have run HV X-containers on KVM in Google Compute Engine.

[0097] Two implementation examples provide advantageous features. The first implementation allows for greater control over how X-containers are managed. For example, it allows multiple X-containers to be securely run in the same VM, isolated from each other. Running multiple X-containers on a single high-performance VM will perform better and be more cost-effective than running each X-container on its own smaller VM. Also, for PV X-containers, Xen VM management features such as live migration, consolidation, and memory expansion are supported as an added benefit; these features are not well supported in conventional Linux containers.

[0098] The second implementation tends to have better performance when hardware virtualization is available. However, in a virtualized environment, the HV X-Container needs to take over the entire VM unless nested hardware virtualization is supported. VMs in public clouds typically do not expose nested hardware virtualization.

[0099] For the experiments described in this paper, we exported two versions of X-LibOS from Linux kernel 4.4.44. Modifications to the kernel were made in an architecture-dependent layer and were transparent to other layers in the kernel. We focused on applications running in x86-64 long mode.

[0100] Using Linux gives us binary compatibility, but in addition the Linux kernel is also highly customizable. It has hundreds of boot parameters, thousands of compile configurations, and many fine-grained runtime tuning knobs. Since most kernel functions can be configured as kernel modules and loaded during runtime, a customized Linux kernel can be highly optimized. For example, for applications running single-threaded (such as many event-driven applications), disabling multi-core and symmetric multiprocessing (SMP) support can eliminate unnecessary locks and translation lookaside buffer (TLB) shootdowns, which greatly improves performance. Depending on the workload, applications can configure the Linux scheduler with different scheduling policies. For many applications, the potential of the Linux kernel is not fully exploited due to lack of control over the kernel configuration or having to share the kernel with other applications. Turning the Linux kernel into a LibOS and dedicating it to a single application can unlock all this potential.

[0101] An exemplary embodiment of the above-mentioned PV X-container will now be described in more detail. We implemented a PV X-container based on the Xen paravirtualization (PV) architecture. The PV architecture enables running multiple concurrent Linux VMs (e.g., PV guests or domain-Us) on the same physical machine without supporting hardware-assisted virtualization, but the guest kernel requires modest changes to work with the underlying hypervisor. In the following, we will review the key technologies in Xen's PV architecture and its limitations on the x86-64 platform.

[0102] In the PV architecture, Xen runs in the most privileged mode (kernel mode), and both the guest kernel and user processes run with lower privileges. All sensitive system instructions that may affect security isolation (such as installing new page tables and changing segment selectors) are executed by Xen. The guest kernel requests these services by executing hypercalls, which are verified by Xen before being serviced. Exceptions and interrupts are virtualized through efficient event channels.

[0103] For device I / O, instead of emulating hardware, Xen defines a simpler split driver model. There is a privileged domain (usually domain-0, the host domain created by Xen during boot) that accesses hardware devices and multiplexes the devices so that other domain-Us can share it. Domain-U installs the front-end driver, which connects to the corresponding back-end driver in domain-0 through Xen's event channel and uses shared memory (asynchronous buffer descriptor ring) to transfer data.

[0104] Xen's PV interface has been widely supported by the mainstream Linux kernel because it is one of the most efficient virtualization technologies on the x86-32 platform. Because there are four different privilege levels (ring-0 to ring-3) for memory segmentation protection, we can run Xen, the guest kernel, and user processes at different privilege levels to achieve isolation. System calls can be executed without Xen's involvement. However, on the x86-64 platform, the PV architecture faces fundamental challenges. Due to the elimination of segment protection in x86-64 long mode, we can only run both the guest kernel and user processes in user mode. In order to protect the guest kernel from user processes, the guest kernel needs to be isolated in another address space. Each system call needs to be forwarded by the Xen hypervisor as a virtual exception and cause a switch of page tables and TLB flushes. This involves a lot of overhead and is one of the main reasons why 64-bit Linux VMs now prefer to run fully virtualized in hardware virtualization rather than paravirtualization.

[0105] Various aspects related to eliminating kernel isolation in a PV X-container will now be described.

[0106] The PV X-Container architecture is similar to the Xen PV architecture, with a key difference being that the guest kernel (i.e., X-LibOS) is not isolated from the user process. Instead, they use the same segment selector and page table privilege levels, so that kernel access no longer requires switching between (guest) user mode and (guest) kernel mode, and system calls can be performed using function calls.

[0107] This leads to a complication: Xen needs to know whether the CPU is in guest user mode or guest kernel mode for proper syscall forwarding and interrupt delivery. Xen does this using flags that it can maintain, since all user-kernel mode switches are handled by Xen. However, in X-LibOS, with lightweight system call and interrupt handling as described in this article, guest user-kernel mode switches no longer involve the X-kernel. Instead, the X-kernel determines whether the CPU is executing kernel code or process code by checking the location of the current stack pointer. As with the normal Linux memory layout, X-LibOS is mapped into the upper half of the virtual memory address space and is shared by all processes. User process memory is mapped into the lower half of the address space. Therefore, the most significant bit in the stack pointer indicates whether it is in guest kernel mode or guest user mode.

[0108] In paravirtualized Linux, the "global" bit in the page table is disabled, so that switching between different address spaces causes a full TLB flush. This is not needed for X-LibOS, so both X-LibOS and X-kernel mappings have the global bit set in the page table. Switching between different processes running on the same X-LibOS does not require a full TLB flush, which greatly improves the performance of address translation. Context switches between different X-containers do trigger a full TLB flush.

[0109] Because kernel code is no longer protected, kernel routines do not need a dedicated stack if only one process exists. However, X-LibOS supports multiple processes. Therefore, we still need a dedicated kernel stack in kernel context, and a switch from user stack to kernel stack is necessary when a system call is executed.

[0110] Various aspects related to lightweight interrupt handling in PV X-containers will now be described.

[0111] In the Xen PV architecture, interrupts are delivered as asynchronous events. There is a variable shared by Xen and the guest kernel that indicates whether there are any events pending. If so, the guest kernel issues a hypercall to Xen to deliver these events. In the X-Container architecture, when any pending events are seen, X-LibOS is able to emulate an interrupt stack frame and jump directly to the interrupt handler without first trapping into the X-kernel.

[0112] To return from an interrupt handler, the iret instruction is used to reset the code and stack segments, stack pointer, flags, and instruction pointer together. Interrupts must also be enabled atomically. But in the Xen PV architecture, virtual interrupts can only be enabled by writing to a memory location, which cannot be performed atomically with other operations. In order to guarantee atomicity and safety when switching privilege levels, Xen provides a hypercall for implementing iret. In the X-container architecture, we can implement iret completely in user mode.

[0113] There are two challenges when implementing iret in user mode: First, all general-purpose registers must be restored before jumping to the return address, so temporary values ​​such as the stack pointer and instruction pointer can only be saved in memory, not in registers. Second, virtual interrupts cannot be enabled atomically with other operations without issuing a hypercall. Therefore, code that manipulates temporary values ​​saved in memory must support reentrancy.

[0114] There are two cases to consider. When returning to a location running on the kernel-mode stack, X-LibOS pushes temporary registers including the return address onto the target stack and switches the stack pointer before enabling interrupts, thus ensuring that preemption is safe. The code then jumps to the return address using a simple ret instruction. When returning to the user-mode stack, the user-mode stack pointer may be invalid, so X-LibOS saves temporary values ​​on the kernel stack for system call processing, enables interrupts, and then executes the iret instruction. Similar to iret, the sysret instruction used to return from a system call handler is optimized to not trap into kernel mode. Implementing sysret is easier because it can take advantage of certain temporary registers.

[0115] The exemplary embodiment of the above HV X-container will now be described in more detail. As mentioned above, the generality of PV X-containers brings the cost of executing all sensitive system instructions through hypercalls, including page table manipulation and context switching. If hardware virtualization support is available, HV X-containers can eliminate this cost.

[0116] With hardware virtualization support, X-LibOS can run in kernel mode and execute most privileged instructions directly, which greatly improves the performance of page table management and context switching. The main challenge also comes from running user processes in kernel mode. In addition to modifying the memory and CPU management components in the Linux kernel so that user processes can run in kernel mode, we also need to change the way interrupts and exceptions are handled. Because the CPU delivers interrupts and exceptions directly in the HV X-container, the X-kernel has no control over how they are handled. The default behavior on the x86 platform is that when there is an interrupt or exception in kernel mode, no stack switch occurs. This means that the interrupt handler can be executed directly on the user stack, which breaks the basic assumptions in both user code and kernel code: the data on the user stack may be damaged, and in order to handle this situation correctly, a lot of code in the Linux kernel needs to be changed.

[0117] Fortunately, x86-64 introduces a new interrupt stack switching mechanism, called Interrupt Stack Table (IST), to force stack switching for interrupts and exceptions. By specifying a flag in the Interrupt Descriptor Table (IDT), the CPU will switch to a new stack pointer even if the privilege level has not changed. However, in this case, nested interrupts become a problem if the same stack pointer is reused. We solve this problem by specifying a temporary stack pointer in the IST. Just after entering the interrupt handler, we copy the stack frame to the normal kernel stack so that the same stack pointer can be used for nested interrupts.

[0118] Various aspects related to lightweight system calls in PV and HV X-containers will now be described.

[0119] In the x86-64 architecture, user-mode programs perform system calls using the syscall instruction, which transfers control to a routine in kernel mode. The X-kernel immediately transfers control to X-LibOS, thus ensuring binary-level compatibility, allowing existing applications to run on X-LibOS without any modifications.

[0120] Because both X-LibOS and the process run at the same privilege level, it is more efficient to call the system call handler directly. However, the setup of the GS segment poses a challenge. The Linux kernel stores per-CPU variables in the GS segment. This segment is set up by the swapgs instruction on entry to the kernel for each system call and reset before returning to the user program. Unfortunately, the swapgs instruction is only effective in kernel mode. By avoiding the use of segmentation, it is possible to change the per-CPU variable placement. But to keep changes to the Linux kernel to a minimum, we instead disable GS segment switching when entering or leaving X-LibOS, thus keeping the GS segment always effective. Although x86-64 applications may use the FS segment for thread-local storage, they generally do not touch the GS segment. We have not seen any applications that require customization of the GS segment.

[0121] Another challenge comes from the mechanism to enable lightweight system calls. X-LibOS stores the system call entry table in the vsyscall page, which is mapped to a fixed virtual memory address in each process. Updating X-LibOS does not affect the location of the system call entry table. Using this entry table, applications can optimize libraries and binaries for X-containers by patching the source code to change system calls to function calls, like most existing LibOS. However, it greatly increases the deployment complexity, and it cannot handle third-party tools and libraries for which no source code is available. To avoid rewriting or recompiling applications, we implemented an online automatic binary optimization module (ABOM) in the X-kernel for PV X-containers and in X-LibOS for HV X-containers. It automatically and dynamically replaces syscall instructions with function calls. There are many challenges with on-site binary replacement:

[0122] 1. Binary-level equivalence: The total length of the patch instructions cannot be changed, and the program must perform exactly the same functionality even when the application code jumps into the middle of the patch block.

[0123] 2. Position independence: We can only call absolute addresses stored in memory or registers, but not relative address displacement, because libraries such as glibc are loaded in different locations for different processes.

[0124] 3. Minimal performance impact: It is impractical to scan the entire binary when loading the application or during runtime.

[0125] 4. Handling read-only pages: Most of the binary code is mapped as read-only in memory. Binary replacement cannot trigger the copy-on-write mechanism in X-LibOS, otherwise multiple copies of the same memory page may be created for different processes.

[0126] 5. Concurrency safety: Multiple CPUs running different threads or processes can share the same code. Replacement should be done automatically without affecting or stopping other CPUs.

[0127] 6. Swap safety: Memory swapping may occur during replacement. The system should be able to detect and handle it correctly without compromising memory or incurring high performance overhead.

[0128] ABOM performs binary replacement dynamically when a syscall request is received from a user process, thus avoiding scanning the entire binary. Before forwarding the syscall request, ABOM examines the binary surrounding the syscall instruction to see if it matches any of the patterns it recognizes. If so, ABOM temporarily disables the write protection bit in the CR-0 register, making it possible for code running in kernel mode to change any memory page, even if it is mapped as read-only in the page table. ABOM then performs the binary patch with an atomic cmpxchg instruction. Since each cmpxchg instruction can process up to eight bytes, if we need to modify more than eight bytes, we need to ensure that any intermediate state of the binary remains valid for concurrency safety. The patch is almost transparent to X-LibOS, except that the page table dirty bit will be set for read-only pages. X-LibOS can choose to ignore those dirty pages, or flush them to disk so that the same patch is not needed in the future.

[0129] A bigger problem was dealing with swap safety. In particular, in PV X-containers, although the decision to swap memory is made by X-LibOS, all page table manipulation is done through hypercalls in the X-kernel. The X-kernel can lock the page tables to prevent swapping during binary replacement, but this can result in higher performance overhead. We eventually implemented binary replacement as follows: Binary replacement runs in the context of a system call, so if the target page is swapped out before the replacement, a write to the page will trigger a page fault. ABOM catches this page fault and continues forwarding the system call without propagating it to X-LibOS's page fault handler. The next time it is executed, ABOM will try to patch the same location.

[0130] Figure 6Three binary code patterns identified by ABOM are shown. To perform a system call, a program typically sets the system call number in the rax or eax register with a mov instruction and then executes the syscall instruction. The syscall instruction is 2 bytes, and the mov instruction is 5 or 7 bytes, depending on the size of the operand. We replace these two instructions with a single call instruction with the absolute address stored in memory, which can be implemented in 7 bytes. The memory address of the entry point is retrieved from the system call entry table stored in the vsyscall page. The binary replacement only needs to be performed once for each location.

[0131] With the 7-byte replacement we merge two instructions into one. Rarely, after setting the rax register somewhere else or an interrupt occurs, the program will jump directly to the location of the original syscall instruction. After the replacement, this will result in a jump to the last two bytes of our call instruction, which are always "0x60 0xff". These two bytes cause an invalid opcode trap into the X-kernel (PV) or X-LibOS (HV). To provide binary level equivalence, we add special trap handlers in the X-kernel (only in the case of PV) and X-LibOS to fix the trap by moving the instruction pointer backwards to the beginning of the call instruction. We have only seen this being triggered during the boot time of some operating systems.

[0132] like Figure 6 As shown, the 9-byte replacement is performed in two stages, each of which produces a result equivalent to the original binary. Since the mov instruction requires 7 bytes, we replace it directly with a call into the syscall handler. We could keep the original syscall instruction unchanged in case the program jumps directly to this instruction. But we optimize it further by taking advantage of the jump to the preceding call instruction. The syscall handler in X-LibOS will check again whether the instruction at the return address is a syscall or a specific jmp to the call instruction. If so, the syscall handler modifies the return address to skip this instruction.

[0133] Our online binary replacement solution only handles the case where a syscall instruction is followed by a mov instruction. For more complex cases, it is possible to inject some code into the binary and redirect larger blocks of code. We also provide tools for doing this offline. For most standard libraries (such as glibc), the default system call wrappers are usually written using Figure 6 Therefore, this embodiment is sufficient to optimize most system call wrappers on the critical path.

[0134] Various aspects related to lightweight booting of Docker images in PV and HV X-containers will now be described.

[0135] X-Containers do not have VM disk images and do not go through the same boot phase that VMs go through. To boot an X-Container, the X-kernel loads X-LibOS into memory with a special boot loader and jumps directly to the entry point of X-LibOS. The boot loader initializes the virtual devices, including setting up IP addresses, and then spawns processes in the container without running any unnecessary services. The first process in the container can fork additional processes if necessary. In addition, HV X-LibOS can also be loaded by GNU GR and the Unified Boot Loader (GRUB) using a special boot loader without the help of the underlying hypervisor. This approach makes X-Containers smaller than typical VMs and starts faster. For example, we were able to spawn a new Ubuntu-16 X-Container with a single bash process in three seconds with a memory size of 64MB.

[0136] Because X-containers support binary-level compatibility, we can run any existing Docker image without modification. We use Docker wrappers to connect our X-container architecture to the Docker platform. An unmodified Docker engine running in the host X-container is used to extract and build Docker images. We use devicemapper as a storage driver, which stores different layers of Docker images as thin-provisioned copy-on-write snapshot devices. The Docker wrapper then retrieves metadata from Docker, creates a thin block device, and connects it to the new X-container. Processes in the container are then spawned using a dedicated X-LibOS.

[0137] To demonstrate the various advantages of these exemplary embodiments, example implementations of certain exemplary embodiments described above were evaluated against conventional arrangements.

[0138] Figure 7 An example of a software stack used in such an evaluation of an illustrative embodiment is shown. In the figure, a dashed box indicates a Docker container or an X-container. Solid lines indicate isolation boundaries between privilege levels. Dashed lines indicate library interfaces.

[0139] As part of our evaluation, we conducted experiments on both bare metal and VMs in the public cloud. For the bare metal experiments, we used four Dell PowerEdge R720 servers (two 2.9GHz Intel Xeon E5-2690 CPUs, 16 cores, 32 threads, 96GB memory, 4TB disk) connected to a 10Gbit switch. For the cloud environment, we ran the experiments in four VMs in the Amazon EC2 Northern Virginia region (m3.xlarge instances, 2 CPU cores, 4 threads, 15GB memory, and 2 40GB SSD storage devices).

[0140] As a baseline, we ran the Docker container platform both on bare metal and in Amazon HV machines. We call these two configurations Docker / native / bare metal and Docker / native / cloud, respectively. We compared their performance with Docker containers running in a single Xen HV and PV domain-U VM, and with X-container. This resulted in six additional configurations: Docker / HV / bare metal, Docker / PV / bare metal, X-container / HV / bare metal, X-container / PV / bare metal, X-container / HV / cloud, and X-container / PV / cloud. Figure 7 Various software stacks for these configurations are shown. Note that of the eight configurations, three are running in the cloud and five are running on bare metal.

[0141] The host (physical machine or Amazon EC2 instance) running native Docker has Ubuntu 16.04-LTS installed with Docker engine 17.03.0-ce and Linux kernel 4.4.44. The host running Xen VM has CentOS-6 installed in domain-0, Ubuntu 16.04-LTS installed in domain-U with Docker engine 17.03.0-ce, Linux kernel 4.4.44 and Xen 4.2 installed. The host running X-Container uses X-LibOS based on Linux kernel 4.4.44 and CentOS-6 as host X-Container. Docker containers use the default NUMA-aware Linux scheduler with IRQ balancing service turned on. Domain-0 and host X-Container are configured with dedicated CPU cores, and we manually balance IRQs to different cores. Other VMs or X-Containers are evenly allocated to other CPU cores according to NUMA placement.

[0142] For each set of experiments, the same Docker image was used. The Docker engines were all configured with the device-mapper storage driver. When running network benchmarks involving clients or servers, separate machines or VMs were used.

[0143] Because applications running in X-containers have full control over X-LibOS, they can disable symmetric multiprocessing (SMP) and multi-core support when only a single thread is busy. In many cases, this optimization can significantly improve performance, eliminating concurrency management and TLB shootdowns. Applications running in Docker containers cannot make this optimization because it requires root privileges. In the following micro-benchmarks and macro-benchmarks, we performed both single-process tests and multi-process tests. For the single-process case, we disabled SMP support in X-LibOS.

[0144] For most experiments described in this paper, we report the average of five runs and show the standard deviation.

[0145] We evaluated the performance of X-Containers with a set of microbenchmarks. We started with an Ubuntu 16 Docker image and ran UnixBench and iperf on it. The execl benchmark measures the speed of the exec system call, which overwrites a new binary on the current process. The file copy benchmark tests the throughput of copying files with different buffer sizes. The pipe throughput benchmark measures the throughput of reads and writes in a pipe. The pipe-based context switch benchmark tests the speed of two processes communicating with a pipe. The process creation benchmark measures the performance of spawning a new process with the fork system call. The system call benchmark tests the speed of issuing a series of system calls (including dup, close, getpid, getuid, and umask). Finally, the iperf benchmark tests the performance of TCP transport. For concurrency testing, we ran 4 replicas in the bare metal experiment and 2 replicas in the Amazon EC2 experiment because EC2 instances only have two CPU cores.

[0146] Figure 8 Shows various Figure 7 Relative performance of the configurations with respect to the above microbenchmarks. Figure 8 It consists of four parts, expressed as Figure 8 (a) Figure 8 (b) Figure 8 (c) and Figure 8 (d).

[0147] In general, it is found that X-container has significantly higher system call throughput because we turn system calls into lightweight function calls. For single-process benchmarks, we optimize X-LibOS by disabling SMP support, and therefore X-container significantly outperforms Docker. Compared to Docker / native, X-container / PV has a lot of overhead in process creation and context switching, especially in virtualized environments (such as Amazon EC2). This is because process creation and context switching involve many page table operations, which must be done in the X-kernel. X-container / HV eliminates this overhead and achieves better performance than both Docker / native and Docker / HV / bare metal. In the file copy benchmark, Docker / HV / bare metal achieves better performance than Docker / native / bare metal because there is an additional disk cache layer.

[0148] We also evaluate the performance of X-Container using two macro benchmarks, where the results are shown in Fig. 9 middle. Fig. 9 It consists of four parts, expressed as Fig. 9 (a) Fig. 9 (b) Fig. 9 (c) and Fig. 9 (d) The evaluation results of NGINX web server throughput are shown in Fig. 9 (a) and Fig. 9 (b), and the evaluation results of the kernel compilation time are shown in Fig. 9 (c) and Fig. 9 (d) in.

[0149] For NGINX server, we ran the Docker image NGINX:1.11 on all platforms. We used the wrk benchmark to test the throughput of NGINX server with single and multiple worker processes. The wrk client started 10 threads and 100 connections for each worker process in the NGINX server. On bare metal, the Docker containers and X-containers used bridged networking and could connect directly to the client. On Amazon EC2, they used private networking with port forwarding. Note that X-container / HV / cloud takes over the entire HVM in EC2, so it can access the network without port forwarding. For kernel compilation testing, we used the Ubuntu-16.04 Docker image and installed the compilation tools in it. We compiled the latest 4.10 Linux kernel using the “tiny” configuration. Concurrency testing was performed by running 4 parallel jobs in the bare metal experiment and 2 parallel jobs in the Amazon EC2 experiment.

[0150] Fig. 9 (a) and Fig. 9 (b) shows the throughput of the NGINX web server measured on bare metal and Amazon EC2. X-containers consistently outperform Docker containers within a Xen VM due to kernel customization and reduced system call overhead. When running a single worker process, X-containers / PV / bare-metal and X-containers / HV / bare-metal are further optimized by disabling SMP support and achieve 5% and 23% higher throughput than Docker / native / bare-metal containers, respectively. When running concurrent workers on bare metal, X-containers performs on par with Docker / native / bare-metal containers. In Amazon EC2, X-containers / HV / cloud achieves 69% to 78% higher throughput than Docker / native / cloud because it takes over the entire HVM and runs without port forwarding. Due to context switching overhead, X-containers / PV / cloud suffers a 20% performance loss in concurrent tests compared to Docker / native / cloud. This result shows that for network I / O intensive workloads, X-containers outperform VMs and in many cases even outperform native Docker containers.

[0151] Fig. 9 (c) and Fig. 9 (d) shows kernel compile times on bare metal and Amazon EC2 instances, where lower kernel compile times outperform higher kernel compile times. Similar to the NGINX experiments, single-process X-containers on bare metal perform significantly better than Docker containers running natively or in a VM. We do not see similar improvements in Amazon EC2, which we suspect is due to another layer of I / O scheduling. PV X-containers’ performance suffers slightly due to the high overhead of page table management in a paravirtualized environment, which slows down operations such as fork and exec. This result suggests that for CPU-intensive workloads, the performance benefit we gain from lightweight system calls is limited, but performance gains through kernel customization are still possible.

[0152] The exemplary embodiment of X-Container is also compared with Graphene and Unikernel, and the results are shown in Fig.10 middle. Fig.10 It consists of three parts, expressed as Fig.10 (a) Fig.10 (b) and Fig.10 (c).

[0153] To make these comparisons, we ran the wrk benchmark on bare metal with the NGINX web server, PHP, and MySQL database. Graphene was run on Linux with Ubuntu-16.04 and compiled without the security isolation module (which should improve its performance). For unikernels, we used Rumprun because it can run those applications with small patches (running with MirageOS would require rewriting the entire application in OCaml). Unikernels do not support running in Xen HV, so we only tested them in PV mode.

[0154] Fig.10 (a) Comparison of the throughput of an NGINX web server and a single worker process serving static web pages. Since only one NGINX server process is running, we optimize X-Container by disabling SMP. The throughput achieved by X-Container is comparable to Unikernel and more than twice that of Graphene.

[0155] Fig.10 (b) shows the case of 4 worker processes running a single NGINX web server. This is not supported by Unikernel, so we only compare with Graphene. In this case, X-Container outperforms Graphene by more than 50%. Graphene's performance is limited because in Graphene, multiple processes use IPC calls to coordinate access to shared POSIX libraries, which incurs a lot of overhead.

[0156] We combine Figure 5 We evaluated the scenario described previously, with two PHP CGI servers connected to a MySQL database. We enabled PHP's built-in web server and used the wrk client to access pages that made requests to the database (with equal probability of reads and writes). Figure 5 As shown in Figure 1, PHP servers can share a database or have separate databases. Graphene does not support PHP CGI servers, so we only compare with Unikernel. The total throughput of two PHP servers was measured with different configurations, and the results are shown in Figure 1. Fig.10(c). All VMs run a single process with one CPU core. In the 3-VM and 4-VM configurations, X-Container outperforms Unikernel by more than 40%. We believe this is because the Linux kernel is better optimized compared to the Rumprun kernel. Furthermore, X-Container supports running PHP and MySQL in a single container, which is not possible with Unikernel. This convenience also greatly helps performance: the throughput of X-Container is about three times that of the Unikernel setup.

[0157] A scalability evaluation of the exemplary embodiment was also performed, and the results are shown in Fig.11 middle.

[0158] We evaluated the scalability of the X-Container architecture by running up to 400 containers on a single physical machine. For this experiment, we used the NGINX server with the PHP-FPM engine. We used the webdevops / PHP-NGINX Docker image and configured NGINX and PHP-FPM with a single worker process. We ran the wrk benchmark to measure the total throughput of all containers. Each container has a dedicated wrk thread with 5 concurrent connections, so the total number of wrk threads and concurrent connections increases linearly with the number of containers.

[0159] Each X-container was configured with a single virtual CPU and 128MB of memory, while X-LibOS was optimized by disabling SMP support. It should be noted that X-containers can operate with lower amounts of memory (e.g., 64MB of memory), but the 128MB memory size was small enough to boot 400 X-containers. For Docker / HV / baremetal and Docker / PV / baremetal, each Xen VM was allocated a virtual CPU and 512MB of memory (512MB is the recommended minimum size for Ubuntu-16 OS). However, since the physical machine only had 96GB of memory, we had to change the memory size of the VM to 256MB when booting more than 200 VMs. We found that the VMs could still boot, but the network stack began to drop packets. We were unable to properly boot more than 250 PV instances or more than 200 HV instances on Xen.

[0160] Fig.11The cumulative throughput for all bare metal configurations is shown. We can see that Docker / native / bare metal containers achieve higher throughput for smaller numbers of containers. This is because context switches between Docker containers are cheaper than context switches between X-containers and between Xen VMs. However, as the number of containers increases, the performance of Docker containers degrades faster. This is because each NGINX+PHP container runs 4 processes: with N containers, the Linux kernel running the Docker containers schedules 4N processes, while the X-kernel schedules N virtual CPUs, each running 4 processes. This hierarchical scheduling proves to be a more scalable way to schedule many containers together, and with N=400, X-container / PV / bare metal outperforms Docker / native / bare metal by 18%.

[0161] The evaluation further demonstrated the additional performance benefits of kernel customization, as will now be referenced Fig.12 As described in the description. The exemplary embodiment of X-Container implements an application container that requires a custom kernel module. For example, X-Container can use software RDMA (both Soft-iwarp and Soft-ROCE) applications. In a Docker environment, such a module requires root privileges and exposes the host network directly to the container, which raises security issues.

[0162] We tested the scenario with three NGINX web servers and a load balancer. The NGINX web servers were each configured to use one worker process. The Docker platform typically uses a user-level load balancer such as HAProxy. HAProxy is a single-threaded, event-driven proxy server widely deployed in production systems. X-Containers supports HAProxy, but kernel-level load balancing solutions such as IPVS (IP Virtual Server) can also be used. IPVS requires inserting new kernel modules and changing iptable and ARP table rules, which is not possible in a Docker container without root privileges and access to the host network.

[0163] In this experiment, we used the HAProxy:1.7.5 Docker image. The load balancer and NGINX server ran on the same physical machine. We configured each X-container with a single virtual CPU, with SMP support turned off in X-LibOS for optimal performance. We used the wrk workload generator and measured the total throughput.

[0164] Fig.12Various configurations were compared. X-Container Platform with HAProxy achieved twice the throughput of Docker Container Platform. With IPVS kernel-level load balancing using NAT mode, X-Container further increased the throughput by 12%. In this case, the load balancer is the bottleneck because it acts as both a network frontend and a NAT server. IPVS supports another load balancing mode called "direct routing". In the case of direct routing, the load balancer only needs to forward requests to the backend servers, and the responses from the backend servers are routed directly to the clients. This requires changing iptable rules and inserting kernel modules in the load balancer and NGINX servers. With direct routing mode, the bottleneck shifts to the NGINX server and the overall throughput is improved to 1.5 times.

[0165] It should be understood that the specific X-container embodiments described in conjunction with the above evaluations are merely examples intended to demonstrate the advantages of the illustrative embodiments and should not be considered limiting in any way.

[0166] It should be understood that, in conjunction with Figures 1 to 12 The specific arrangements shown and described are presented only by way of illustrative examples, and many alternative embodiments are possible. Therefore, the various embodiments disclosed herein should not be construed as limiting in any way. In other embodiments, a variety of alternative arrangements for implementing software containers may be utilized. For example, other types of kernel-based isolation layers may be used in place of the specific X-kernel arrangements described in conjunction with certain illustrative embodiments. Those skilled in the art will also recognize that alternative processing operations and associated system entity configurations may be used in other embodiments.

[0167] Therefore, other embodiments may include additional or alternative system elements relative to the entities of the illustrative embodiments. Therefore, in other embodiments, the specific system configuration and associated software container and kernel-based isolation layer implementations may vary.

[0168] As described herein, a given processing device or other component of an information processing system is illustratively configured to utilize a corresponding processing device that includes a processor coupled to a memory. The processor executes software program code stored in the memory to control the performance and other functions of the processing operation. The processing device also includes a network interface that supports communication through one or more networks.

[0169] The processor may include, for example, a microprocessor, an ASIC, an FPGA, a CPU, an ALU, a GPU, a DSP, or other similar processing device components, as well as other types and arrangements of processing circuitry, in any combination. For example, a given processing device as disclosed herein may be implemented using such circuitry.

[0170] The memory stores software program code for execution by the processor in implementing part of the functionality of the processing device. A given such memory storing such program code for execution by the corresponding processor is an example of a processor-readable storage medium more generally referred to herein as having program code contained therein, and may include, for example, electronic memory (such as SRAM, DRAM or other types of random access memory), ROM, flash memory, magnetic storage, optical storage or other types of storage devices in any combination.

[0171] As mentioned above, articles containing such processor-readable storage media are considered embodiments of the present invention. The term "article" as used herein should be understood to exclude temporary, propagating signals. In other embodiments, other types of computer program products containing processor-readable storage media can be implemented.

[0172] Furthermore, embodiments of the present invention may be implemented in the form of an integrated circuit including processing circuitry configured to implement processing operations associated with providing a software container on a kernel-based isolation layer.

[0173] An information handling system as disclosed herein may be implemented using one or more processing platforms, or portions thereof.

[0174] For example, an exemplary embodiment of a processing platform that can be used to implement at least a portion of an information processing system includes a cloud infrastructure that includes virtual machines implemented using a hypervisor running on a physical infrastructure. Such virtual machines can include corresponding processing devices that communicate with each other through one or more networks.

[0175] In such an embodiment, the cloud infrastructure may further include one or more sets of applications running on corresponding ones of the virtual machines under the control of the hypervisor. Multiple hypervisors may also be used, each hypervisor using at least one underlying physical machine to provide a set of virtual machines. Different sets of virtual machines provided by one or more hypervisors may be used to configure multiple instances of various components of the information processing system.

[0176] Another exemplary embodiment of a processing platform that can be used to implement at least a portion of an information processing system as disclosed herein includes a plurality of processing devices that communicate with each other via at least one network. It is assumed that each processing device of the processing platform includes a processor coupled to a memory.

[0177] Again, these specific processing platforms are presented by way of example only, and the information handling system may include additional or alternative processing platforms in any combination, as well as a number of different processing platforms, with each such platform including one or more computers, servers, storage devices or other processing devices.

[0178] For example, instead of or in addition to a virtualization infrastructure including virtual machines, other processing platforms for implementing embodiments of the present invention may include a different type of virtualization infrastructure. Thus, in some embodiments, it is possible that system components may be run at least partially in a cloud infrastructure or other type of virtualization infrastructure.

[0179] Therefore, it should be understood that in other embodiments, different arrangements of additional or alternative elements may be used.At least a subset of these elements may be implemented together on a common processing platform, or each such element may be implemented on a separate processing platform.

[0180] Moreover, many other arrangements of computers, servers, storage devices or other components in an information handling system are possible. Such components can communicate with other elements of the information handling system through any type of network or other communication medium.

[0181] As previously mentioned, the components of the system disclosed herein may be implemented at least in part in the form of one or more software programs stored in a memory and executed by a processor of a processing device. For example, certain functions disclosed herein may be implemented at least in part in the form of software.

[0182] The particular configurations of the information processing systems described herein are exemplary only, and in other embodiments a given such system may include other elements in addition to or in place of those specifically illustrated, including one or more elements of a type that is common in conventional implementations of such systems.

[0183] For example, in some embodiments, an information handling system may be configured to utilize the disclosed techniques to provide additional or alternative functionality in other environments.

[0184] It should be emphasized again that the embodiments of the present invention as described herein are merely illustrative. Other embodiments of the present invention may be implemented using information processing systems, networks and devices of various different types and arrangements in addition to those used in the specific illustrative embodiments described herein, and in many alternative processing environments. In addition, the specific assumptions made herein in the context of describing certain embodiments need not apply to other embodiments. These and many other alternative embodiments will be apparent to those skilled in the art.

Claims

1. A method comprising: Implement a kernel-based isolation layer; configuring a software container on the kernel-based isolation layer to include a dedicated operating system kernel as a library operating system; and executing one or more user processes in the software container; wherein the method is performed by a processing platform comprising a plurality of processing devices, each of the processing devices comprising a processor coupled to a memory; and The library operating system runs in the software container at the same privilege level as the one or more user processes executing in the software container.

2. The method of claim 1, wherein the kernel-based isolation layer is implemented in the form of at least a portion of a hypervisor or a host operating system relative to the dedicated operating system kernel of the software container. 3 . The method of claim 1 , wherein the kernel-based isolation layer comprises one of a hypervisor and a host operating system.

4. The method of claim 1, wherein the library operating system is converted from a single operating system kernel of a specified type.

5. The method of claim 1 , wherein executing one or more user processes in the software container comprises executing a plurality of user processes in the software container, and further wherein the library operating system runs in the software container at the same privilege level as a privilege level of each of the plurality of user processes executed in the software container.

6. The method of claim 1, wherein the library operating system is configured to support automatic translation of binaries of the one or more user processes in conjunction with converting system calls to corresponding function calls.

7. The method of claim 1, wherein configuring a software container on the kernel-based isolation layer to include a dedicated operating system kernel as a library operating system further comprises: Extracting container images of existing software containers; and When configuring the software container on the kernel-based isolation layer, utilizing the extracted container image as a virtual machine image; The software container on the kernel-based isolation layer includes a packaged version of the existing software container.

8. The method of claim 7, wherein the one or more user processes of the existing software container are allowed to execute on the kernel-based isolation layer as the one or more user processes in the software container without any modification to those one or more user processes.

9. The method of claim 1, wherein configuring a software container on the kernel-based isolation layer to include a dedicated operating system kernel as a library operating system further comprises: configuring a plurality of software containers on the kernel-based isolation layer, wherein each of the plurality of software containers includes a separate dedicated operating system kernel as a library operating system.

10. The method of claim 9, wherein executing one or more user processes in the software container further comprises executing different groups of one or more user processes in corresponding software containers in the plurality of software containers, and wherein at least one of the different groups comprises a plurality of different user processes.

11. The method of claim 10, wherein a first group of the different groups of one or more user processes executed in a first software container in the multiple software containers is isolated from a second group of the different groups of one or more user processes executed in a second software container in the multiple software containers.

12. The method of claim 1, wherein configuring the software container comprises configuring the software container as a paravirtualized software container, wherein the library operating system and the one or more user processes run in user mode.

13. The method of claim 12, wherein implementing the kernel-based isolation layer on which the paravirtualized software container runs comprises implementing the kernel-based isolation layer as a modified version of an otherwise standard hypervisor or operating system kernel.

14. The method of claim 1, wherein configuring the software container comprises configuring the software container as a hardware-assisted virtualized software container, wherein the library operating system and the one or more user processes run in kernel mode within a hardware-assisted virtual machine.

15. The method of claim 14, wherein implementing the kernel-based isolation layer on which the hardware-assisted virtualized software container runs comprises implementing the kernel-based isolation layer as a standard hypervisor or operating system kernel.

16. The method of claim 1, wherein the kernel-based isolation layer and the library operating system of the software container are implemented using respective first and second operating systems of different types.

17. A system comprising: a processing platform comprising a plurality of processing devices, each of the processing devices comprising a processor coupled to a memory; The processing platform is configured to: Implement a kernel-based isolation layer; configuring a software container on the kernel-based isolation layer to include a dedicated operating system kernel as a library operating system; as well as executing one or more user processes in the software container; The library operating system runs in the software container at the same privilege level as the one or more user processes executing in the software container.

18. The system of claim 17, wherein the processing platform is configured to provide different sets of one or more software containers to corresponding different tenants on the kernel-based isolation layer, wherein each such software container includes a dedicated operating system kernel as a library operating system.

19. The system of claim 17, wherein the processing platform comprises at least one of: Cloud-based processing platform; Enterprise processing platform; IoT platforms; and Network Function Virtualization Platform.

20. A computer program product comprising a non-transitory processor-readable storage medium having stored therein program code of one or more software programs, wherein the program code, when executed by a processing platform comprising a plurality of processing devices, each processing device comprising a processor coupled to a memory, causes the processing platform to: Implement a kernel-based isolation layer; configuring a software container on the kernel-based isolation layer to include a dedicated operating system kernel as a library operating system; as well as executing one or more user processes in the software container; The library operating system runs in the software container at the same privilege level as the one or more user processes executing in the software container.

21. A computer program product according to claim 20, wherein executing one or more user processes in the software container includes executing multiple user processes in the software container, and further wherein the library operating system runs in the software container at a privilege level that is the same as the privilege level of each of the multiple user processes executed in the software container.

22. The computer program product of claim 20, wherein the library operating system is configured to support automatic translation of binaries of the one or more user processes in conjunction with converting system calls to corresponding function calls.