×
Community Blog OpenAnolis White Paper: Using the EROFS Read-Only File System across the Cloud-Edge-End

OpenAnolis White Paper: Using the EROFS Read-Only File System across the Cloud-Edge-End

This short article discusses the background and technical scheme of EROFS.

By Jingbo Xu

EROFS is a kernel file system tailored for high-performance read-only scenarios. It provides features such as multi-layer mirroring and transparent compression and is officially incorporated into the Linux mainline in Linux 5.4.

Background

In cloud-native, desktop, terminal, and other application areas, a read-only scheme tends to be chosen to build, distribute, and run images efficiently and reliably. It has the advantages of distribution and signature verification, write protection, and reliable recovery of device faults. General-purpose file systems (such as EXT4 and XFS) often fail to meet the requirements of image size, compression, deduplication, and reproducible build. Unpopular features of general-purpose file systems increase format complexity and affect the security and controllability of distribution and execution. Therefore, building a high-performance and self-contained kernel read-only file system under Linux can better serve business scenarios (such as containers, terminals, and cluster OS).

Technical Scheme

EROFS is a kernel file system tailored for high-performance read-only scenarios. It provides features (such as multi-layer mirroring, transparent compression, block deduplication, native on-demand loading, and direct access to FSDAX memory). It is incorporated into Linux mainline in Linux 5.4. In the container image field, through deep integration with the Nydus image service of CNCF Dragonfly, EROFS has built technologies (such as RAFSv6 and FS-Cache) to serve containers (such as runC and Kata). In the future, EROFS will keep working on page cache memory sharing to provide the memory overselling capability. In the terminal field, EROFS has become the system partition file system format recommended by the Android Open-Source Project.

Technical Advantages

  • Native to Linux kernel and saves image storage space through compression, block deduplication, and byte rolling compression deduplication
  • Optimizes running state memory usage to improve performance through in-place decompression and other technologies
  • Provides the native on-demand loading capability of Linux kernel to address the additional copy and cut the context-switching overheads of FUSE from the source

Application Scenarios

Container/app/system image, software package management, AI data distribution, Function Compute, confidential computing, diskless boot, and installer

Optimizing the On-Demand Loading of Nydus Images Based on EROFS + FS-Cache

EROFS over FS-Cache is the next generation of container image on-demand loading technology. It is led by OpenAnolis and developed for Nydus and EROFS. It is the native image on-demand loading feature of the Linux kernel and is incorporated into the main line of the Linux kernel community in Linux 5.19. This scheme sinks the on-demand cache management to the kernel mode through the FS-Cache framework for execution. When the image has been cached locally, compared with the user mode scheme, this scheme can effectively avoid the context switching and memory copy of the kernel mode or the user mode. The user mode is notified to obtain data through the network after the cache misses. Therefore, this scheme achieves real on-demand and assures almost lossless performance and stability in non-on-demand scenarios.

1

EROFS over FS-Cache has better performance than FUSE in the on-demand loading scenario. (Note: The data is the average of three tests.)

OCI EROFS + FUSE EROFS + FS-Cache
Startup time of WordPress E2E 11.562s 5.263s 4.619s

EROFS over FS-Cache provides better performance than FUSE in non-on-demand scenarios.

OCI EROFS + FUSE EROFS + FS-Cache
Local cache 4K Sequential read 387068KB/s 211767KB/s 366291KB/s
Local cache 4K Random read 6153KB/s 5450KB/s 6170KB/s

The Homepage of High-Performance Storage SIG:
https://openanolis.cn/sig/high-perf-storage

0 1 0
Share on

OpenAnolis

85 posts | 5 followers

You may also like

Comments