KylinX: A Dynamic Library Operating System for Simplified and Efficient Cloud Virtualization

Yiming Zhang, Jon Crowcroft, Dongsheng Li, Chengfen Zhang, Huiba Li, Yaozheng Wang, Kai Yu, Yongqiang Xiong, Guihai Chen

TL;DR

KylinX introduces a "process-like VM" (pVM) abstraction on top of hypervisors, bridging the gap between the strong isolation of Unikernels and the flexibility of traditional processes. By enabling dynamic library linking and page mapping, KylinX offers simplified cloud virtualization with improved efficiency and applicability without sacrificing security.

What Problem Does This Paper Address?

Cloud environments often use virtual machines (VMs) as "appliances" for specific online applications. While traditional VMs offer strong isolation, they are resource-intensive due to running a full OS. Unikernels address this by creating single-purpose VMs from a library OS and an application, significantly reducing overhead. However, Unikernels strip away the process abstraction, sacrificing flexibility, dynamic updates, and efficient multi-process management. This paper tackles the challenge of achieving both the strong isolation of Unikernels and the flexibility and efficiency of traditional processes in cloud virtualization.

Methods

KylinX builds upon the Unikernel concept by introducing a "process-like VM" (pVM) abstraction. The core idea is to treat the hypervisor as the OS and the Unikernel appliance as a process. This is achieved through two key innovations:

  • Dynamic Page Mapping: KylinX enables dynamic page-level mapping, allowing for features like PVM fork (similar to process fork) and inter-pVM communication (IpC). This is implemented by leveraging Xen's shared memory and grant tables.
  • Dynamic Library Linking: KylinX allows shared libraries to be dynamically linked to a Unikernel appliance at runtime. This enables features like online library updates and faster recycling of VM resources.

These dynamic capabilities are implemented within the hypervisor's toolstack (specifically, Xen's libxc), which allows for better security enforcement and more flexible dynamic management. KylinX also enforces security restrictions on dynamic mapping to mitigate potential threats.

Datasets

Not discussed in the paper. The paper focuses on evaluating its system using existing applications and benchmarks.

Key Insights and Ideas

  • Bridging the Unikernel-Process Divide: The paper demonstrates that it's possible to combine the benefits of Unikernel's isolation with the flexibility and efficiency of traditional processes, moving beyond the static, monolithic nature of existing Unikernels.
  • Hypervisor as the OS: By treating the hypervisor as the OS and the pVM as a process, KylinX simplifies the virtualization stack and leverages existing hypervisor capabilities for management.
  • Dynamic Mapping is Key: The introduction of dynamic page and library mapping is crucial for enabling process-like features (fork, IPC, runtime updates) in a Unikernel-like environment.
  • Security through Restrictions: KylinX doesn't sacrifice security for flexibility. By enforcing restrictions on dynamic mapping (signature, version, loader), it aims to maintain security guarantees comparable to static Unikernels.
  • Source Code Compatibility: Unlike some Unikernels that require complete rewrites in specific languages, KylinX aims for C source code compatibility, making it easier to adopt for existing applications.

Key Results

  • Fast PVM Fork: KylinX can fork a pVM in approximately 1.3 ms, which is comparable to process fork on Linux (around 1 ms).
  • Fast Library Linking: Linking a library to a running pVM takes only a few milliseconds.
  • Efficient IPC: KylinX's inter-pVM communication (IpC) latencies are comparable to traditional UNIX IPCs.
  • Reduced Boot Times: KylinX's standard boot time is slightly faster than MiniOS VMs and significantly faster than Docker containers, attributed to its lazy loading/linking of shared libraries.
  • Smaller Memory Footprint: KylinX pVMs exhibit smaller memory footprints compared to statically-sealed MiniOS and Docker containers due to library sharing.
  • Runtime Library Update: KylinX can update libraries dynamically in about 5 milliseconds, significantly reducing the burden of recompiling and rebooting.
  • Application Performance: KylinX demonstrates competitive performance for applications like Redis server and a web server, comparable to their counterparts running on Ubuntu, especially when considering the overhead of traditional VMs.

Limitations and Future Work

  • Limited IPC: Currently, KylinX's IPC is limited to the API listed in Table 2.
  • Select vs. Epoll: KylinX (and MiniOS) currently supports select but not the more efficient epoll for asynchronous I/O, which can impact performance for certain applications.
  • PVM Recycling: The pVM recycling mechanism is still tentative. It can only checkpoint empty domains, recycled pVMs cannot communicate with others using event channels or shared memory, and applications must be self-contained shared libraries without external dependencies.
  • Future Work: The authors plan to improve security through modularization, disaggregation, and SGX enclaves. They also aim to enhance performance by adopting more efficient runtimes (like MUSL) and exploring a MultiLibOS model for spanning pVMs across multiple machines. Addressing the limitations of the pVM recycling mechanism is also a priority.

Summary updated

BibTeX
@inproceedings{zhang2018kylinx,
  author = {Yiming Zhang and Jon Crowcroft and Dongsheng Li and Chengfen Zhang and Huiba Li and Yaozheng Wang and Kai Yu and Yongqiang Xiong and Guihai Chen},
  title = {{KylinX: A Dynamic Library Operating System for Simplified and Efficient Cloud Virtualization}},
  booktitle = {USENIX ATC},
  year = {2018},
}
Figure