WO2018145473A1 - 主机装置的容器运行加速方法及系统 - Google Patents

主机装置的容器运行加速方法及系统 Download PDF

Info

Publication number
WO2018145473A1
WO2018145473A1 PCT/CN2017/103664 CN2017103664W WO2018145473A1 WO 2018145473 A1 WO2018145473 A1 WO 2018145473A1 CN 2017103664 W CN2017103664 W CN 2017103664W WO 2018145473 A1 WO2018145473 A1 WO 2018145473A1
Authority
WO
WIPO (PCT)
Prior art keywords
host device
log file
containers
volatile memory
file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2017/103664
Other languages
English (en)
French (fr)
Inventor
李波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Publication of WO2018145473A1 publication Critical patent/WO2018145473A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45583Memory management, e.g. access or allocation

Definitions

  • the present invention generally relates to a container operation acceleration method for a host device and a container operation acceleration system, and more particularly to an acceleration method and system for reading and writing log files when a container of a host device is simultaneously operated.
  • container technology represented by Docker has been widely deployed on the Internet as a lightweight virtualization solution.
  • the container provides an isolated runtime for the application: each container contains an exclusive full user environment space, and changes within one container do not affect the running environment of the other container.
  • container technology uses a series of system-level mechanisms, such as using Linux namespaces for spatial isolation, determining which files a container can access through the mount point of the file system, and determining each container through cgroups. How many resources can be utilized.
  • the same system kernel is shared between containers. Thus, when the same library (ie, file system) is used by multiple containers, memory usage efficiency is improved.
  • the log file exists on the hard disk, and each time the file system is updated, the related operation is written into the log file to prevent the file system from crashing after the system suddenly loses power.
  • the disadvantage is that, first of all, the log file is stored on the hard disk, the performance is poor and the IO delay is long. Second, when multiple containers run in parallel, the log file becomes a system bottleneck and, in severe cases, causes a system denial of service (DOS).
  • DOS system denial of service
  • An aspect of the present invention provides a container operation acceleration method of a host device, comprising: writing a log file to a non-volatile memory when the shared file system is operated by a plurality of containers, wherein the log The file is configured to record operations performed by the plurality of containers on the file system, and when the host device is booted, map the non-volatile memory to a kernel address space of the host device.
  • a container operation acceleration method of a host device the plurality of containers simultaneously operating a shared file system.
  • the log file is written only to the nonvolatile memory without being written to the hard disk of the host device.
  • a container operation acceleration method of a host device when the host device is normally shut down, reading the log file from the nonvolatile memory, and writing the read log file Enter the hard disk of the host device.
  • a container operation acceleration method of a host device the kernel address space being a logical address space of an operating system of the host device.
  • a container operation acceleration system of a host device including: a write module that writes a log file into a non-volatile memory when a plurality of containers operate on a shared file system.
  • the log file is used to record operations performed by the plurality of containers on the file system; and
  • a mapping module is configured to map the non-volatile memory to a kernel of the host device when the host device is booted Address space.
  • a container operating acceleration system of a host device according to another aspect of the present invention, the plurality of containers simultaneously operating a shared file system.
  • a container operation acceleration system of a host device is written only to a non-volatile memory without being written to a hard disk of the host device.
  • a container operation acceleration system of a host device reads the log file from the nonvolatile memory when the host device is normally shut down, and reads the log file Write to the hard disk of the host device.
  • a container operation acceleration system of a host device according to another aspect of the present invention, the kernel address space being a logical address space of an operating system of the host device.
  • Another aspect of the present invention provides a host device comprising: a non-volatile memory; a processor; and a memory storing computer-executable instructions that, when executed by the processor, cause the processor to execute the present A container operation acceleration method of the host device of an aspect of the invention.
  • a further aspect of the present invention provides a computer readable storage medium storing computer executable instructions that, when executed by a processor, cause a processor to execute a container of the host device of an aspect of the present invention Run the acceleration method.
  • FIG. 1 schematically shows a block diagram of a host device 100 of an embodiment of the present invention.
  • FIG. 2 is a flow chart schematically showing a method of accelerating the operation of the container of the host device 100 of the embodiment of the present invention
  • FIG. 3 is a partial flow chart schematically showing a modification of the container operation acceleration method of the host device 100 of the embodiment of the present invention
  • FIG. 4 is a block diagram schematically showing a container operation acceleration system 500 corresponding to the container operation acceleration method of the host device 100 of the present invention
  • Fig. 5 is a view schematically showing the configuration of a host device 200 according to a modification of the present invention.
  • Embodiments of the present invention provide a container operation acceleration method and a container operation acceleration system of a host device capable of greatly improving storage IO performance of a container.
  • FIG. 1 schematically shows a block diagram of a host device 100 of an embodiment of the present invention.
  • the host device 100 of the present invention includes a processor 103 (e.g., a microprocessor ( ⁇ P), a digital signal processor (DSP), etc.).
  • the processor 103 can be for execution A single processing unit or a plurality of processing units for different actions of the flows described herein.
  • the host device 100 may also include an input unit 101 for receiving signals from other entities, and an output unit 102 for providing signals to other entities.
  • the input unit 101 and the output unit 102 may be arranged as a single entity or as separate entities.
  • the host device 100 includes a non-volatile memory 105, and the data stored in the non-volatile memory 105 can be recovered after the system is powered off.
  • the host device 100 may also include a hard disk 104.
  • a file system 11 is stored in the hard disk 104, and when a plurality of containers in the host device 100 operate on the shared file system 11, a log file for recording operations of the plurality of containers on the file system 11 is written.
  • the non-volatile memory 105 may be simultaneously operated in the host device 100, that is, the plurality of containers simultaneously operate on the shared file system 11.
  • a computer program module 12 can be stored in the hard disk 104, the computer program module 12 including code/computer readable instructions that, when executed by the processor 103 in the host device 100, enable the host device 100 to perform, for example, the following The flow described in 2 to 3 and any variations thereof.
  • the processor 103 may be a single CPU (Central Processing Unit), but may also include two or more processing units.
  • a processor can include a general purpose microprocessor, an instruction set processor, and/or a related chipset and/or a special purpose microprocessor (eg, an application specific integrated circuit (ASIC)).
  • ASIC application specific integrated circuit
  • Processor 103 may also include onboard memory for caching purposes.
  • the computer program modules can be carried by a computer program product coupled to processor 103.
  • FIG. 2 is a flow chart schematically showing a method of accelerating the container operation of the host device 100 of the embodiment of the present invention.
  • the nonvolatile memory 105 is mapped to the kernel address space of the host device 100 by using the APP mode of the nonvolatile memory 105 (step S1).
  • the above kernel address space refers to a logical address space of an operating system of the host device 100.
  • step S2 it is determined whether the plurality of containers of the host device 100 operate on the shared file system 11 to perform operations for recording the plurality of containers on the file system 11
  • the log file is written (step S2).
  • step S3 when the determination result of the above step S2 is YES, that is, when the plurality of containers operate on the file system 11 to write the log file, the log file is written in the non-volatile memory 105 (step S3), the process ends.
  • the determination result of the above step S2 is "NO", that is, when the plurality of containers do not operate the file system 11 without writing the log file, the processing ends.
  • the log after the log is written into the non-volatile memory cache, the log can be directly returned (write back mode) without waiting for synchronization to the background storage device ( On the hard disk), this solves the log file bottleneck problem.
  • the device written by the log is non-volatile memory, which is equivalent to the memory copy of the data, and the performance is greatly improved. There is an order of magnitude performance improvement for the storage IO performance of the container.
  • the data in the cache can be recovered after the system is powered down, so the log file is safe.
  • FIG. 3 is a partial flow chart schematically showing a modification of the container operation acceleration method of the host device 100 of the embodiment of the present invention.
  • step S3 As shown in FIG. 3, after the above step S3, that is, after the log file is written into the nonvolatile memory 105, it is judged whether or not the host device 100 is normally turned off (step S3-1).
  • step S3-1 when the result of the determination in the above step S3-1 is YES, that is, when the power is normally turned off, the log file is read from the nonvolatile memory 105 (step S3-2), and the processing proceeds to step S3-3.
  • the result of the determination in the above step S3-1 is "NO", that is, when the abnormal shutdown is performed, the processing ends.
  • step S3-3 the log file read by the above step S3-2 is written to the hard disk 104 as a final backup, and the processing ends.
  • the method of the modification can finally write the log file to the hard disk as a final backup during the normal shutdown, thereby implementing not only the method like the method of the above embodiment.
  • the effect is double-backed, which further ensures the safe preservation of log files and the reliable recovery of log files in the event of a system failure.
  • aspects of the embodiments disclosed herein may be implemented in an integrated circuit as a whole or in part, as one or more of one or more computers running on one or more computers.
  • a computer program eg, implemented as one or more programs running on one or more computer systems
  • implemented as one or more programs running on one or more processors eg, implemented as one or One or more programs running on a plurality of microprocessors, implemented as firmware, or substantially in any combination of the above, and those skilled in the art, in accordance with the present disclosure, will be provided with design circuitry and/or write software and / or firmware code capabilities.
  • signal bearing media include, but are not limited to, recordable media such as floppy disks, hard drives, compact disks (CDs), digital versatile disks (DVDs), digital tapes, computer memories, and the like; and transmission-type media such as digital and / or analog communication media (eg, fiber optic cable, waveguide, wired communication link, wireless communication link, etc.).
  • FIG. 4 a container operation acceleration system in which the container operation acceleration method of the above-described host device is realized by hardware will be described by taking FIG. 4 as an example.
  • FIG. 4 is a block diagram schematically showing a container operation acceleration system 500 of the present invention corresponding to the container operation acceleration method of the host device 100 of the embodiment.
  • the container operation acceleration system 500 includes a mapping module 501 and a log writing module 502.
  • the mapping module 501 when the host device 100 is booted, the nonvolatile memory 105 is mapped to the kernel address space of the host device 100 by using the APP mode of the nonvolatile memory 105.
  • the above kernel address space refers to a logical address space of an operating system of the host device 100.
  • the log writing module 502 it is judged whether or not a plurality of containers of the host device 100 operate on the shared file system 11 to write a log file for recording the operations performed by the plurality of containers on the file system 11.
  • the container running acceleration system of the host device can directly return (write back mode) after the log is written into the non-volatile memory cache, and does not need to wait for synchronization to the background storage device (hard disk). This will solve the log file bottleneck problem.
  • the device written by the log is non-volatile memory, which is equivalent to the memory copy of the data, and the performance is greatly improved. There is an order of magnitude performance improvement for the storage IO performance of the container.
  • the data in the cache can be recovered after the system is powered down, so the log file is safe.
  • a log reading and writing module 503 in the container operation acceleration system of the host device.
  • the log reading and writing module 503 it is first determined whether the host device 100 is normally shut down. When the above determination result is “Yes”, that is, during normal shutdown, the log file is read from the nonvolatile memory 105, and the read log file is written to the hard disk 104 as a final backup. When the above judgment result is "NO”, that is, when the abnormal shutdown is performed, the processing is ended.
  • the log file is finally written to the hard disk during the normal shutdown, as a final backup, thereby further ensuring the safe storage of the log file and the reliable recovery of the log file in the event of a system failure through double backup.
  • FIG. 5 is taken as an example.
  • the program module is not stored on the hard disk and stored in any other recording medium.
  • Fig. 5 is a view schematically showing the configuration of a host device 200 according to a modification of the present invention.
  • the host device 200 includes a non-volatile memory 205, and the data stored in the non-volatile memory 205 can be recovered after the system is powered off.
  • the host device 200 may also include a hard disk 204.
  • a file system 22 is stored in the hard disk 204, and when a plurality of containers in the host device 200 operate on the shared file system 21, log files for recording operations performed by the plurality of containers on the file system 21 are written.
  • the non-volatile memory 205 The plurality of containers may be simultaneously operated in the host device 200, that is, the plurality of containers simultaneously operate on the shared file system 11.
  • the host device 200 further includes a recording medium 206 (ie, a computer readable storage medium).
  • a computer program module 22 may be stored in the recording medium 206, the computer program module 22 including code/computer readable instructions that, when executed by the processor 203 in the host device 200, cause the host device 200 to perform, for example, the above FIG. 3 The described process and any variations thereof.
  • the above-described recording medium 206 may be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, etc.
  • the above computer program module 22 may use a memory in the UE in an alternative embodiment. Forms are distributed among different computer program products.
  • the host device 200 according to the modification of the present invention can also achieve the technical effects of the above embodiments.
  • the host device, the computer readable storage medium, and the container operation acceleration method and system of the host device according to the embodiments of the present invention can directly return (write back mode) after the log is written into the non-volatile memory cache, and does not need to be Waiting for synchronization to the background storage device, this will solve the log file bottleneck problem.
  • the device written by the log is non-volatile memory, which is equivalent to the memory copy of the data, and the performance is greatly improved.
  • the data in the cache can be recovered after the system is powered down, so the log file is safe.
  • a group having 1-3 units refers to a group having 1, 2, or 3 units.
  • a group having 1-5 units refers to a group having 1, 2, 3, 4, or 5 units, and the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种主机装置(100)的容器运行加速方法及系统,所述方法包括:当由多个容器对所共享的文件系统(11)进行操作时,将日志文件写入非易失性内存(105),其中,所述日志文件用于记录所述多个容器对所述文件系统(11)进行的操作,在所述主机装置(100)启动时,将所述非易失性内存(105)映射到该主机装置(100)的内核地址空间。

Description

主机装置的容器运行加速方法及系统 技术领域
本发明总体上涉及一种主机装置的容器运行加速方法及容器运行加速系统,具体地涉及一种主机装置的容器同时运行时进行日志文件读写的加速方法及系统。
背景技术
近年,以Docker为代表的容器技术作为轻量化的虚拟化方案,在互联网中被大量部署。容器为应用程序提供了隔离的运行空间:每个容器内都包含一个独享的完整用户环境空间,并且一个容器内的变动不会影响其他容器的运行环境。为了达到这种效果,容器技术使用了一系列的系统级别的机制,例如,利用Linux namespaces来进行空间隔离,通过文件系统的挂载点来决定容器可以访问哪些文件,通过cgroups来确定每个容器可以利用多少资源。此外,容器之间共享同一系统内核。这样,当同一个库(即,文件系统)被多个容器使用时,内存的使用效率会得到提升。
通常,单台物理机上可以有几十到几百个容器同时运行,这些容器在进行数据读写的时候会产生IO瓶颈,特别是在带有日志功能的文件系统上,情况会变的更糟,文件日志的读写成为瓶颈,导致容器间的资源竞争和容器对外服务中断(DOS)。
以常用的linux的EXT3/4文件系统为例,在现在的情况下,假设多个容器(容器1、容器2和容器3等)在同时写硬盘的时候,为了防止系统突发故障,每次文件的操作要写入日志文件中。这样,这个日志文件的读写就成为系统瓶颈,每次的文件操作,都要排队来更新日志文件内容。更糟糕的是,由于这个文件是存在于硬盘上,因此,每次都要确认文件改动内容并写入日志文件后才可以进行下一步动作,这 样,就使容器的存储IO性能变得更差。
在现有技术中,日志文件存在于硬盘上,每次文件系统更新都要把相关操作写入日志文件中,以防止系统突然掉电后文件系统的崩溃。
其缺点在于,首先,日志文件存于硬盘上,性能差且IO延时长。其次,当多个容器并行运行的时候,日志文件会成为系统瓶颈,在严重的情况下还会导致系统拒绝服务(DOS)。
发明内容
本发明的一个方面提供了一种主机装置的容器运行加速方法,包括:当由多个容器对所共享的文件系统进行操作时,将日志文件写入非易失性内存,其中,所述日志文件用于记录所述多个容器对所述文件系统进行的操作,在所述主机装置启动时,将所述非易失性内存映射到该主机装置的内核地址空间。
根据本发明的一个方面的主机装置的容器运行加速方法,所述多个容器对所共享的文件系统同时进行操作。
根据本发明的一个方面的主机装置的容器运行加速方法,所述日志文件仅被写入非易失性内存,而不被写入所述主机装置的硬盘。
根据本发明的一个方面的主机装置的容器运行加速方法,在所述主机装置正常关机时,从所述非易失性内存中读取所述日志文件,并将所读取的该日志文件写入所述主机装置的硬盘。
根据本发明的一个方面的主机装置的容器运行加速方法,所述内核地址空间是所述主机装置的操作系统的逻辑地址空间。
本发明的另一个方面提供了一种主机装置的容器运行加速系统,包括:写入模块,当由多个容器对所共享的文件系统进行操作时,将日志文件写入非易失性内存,其中,所述日志文件用于记录所述多个容器对所述文件系统进行的操作;以及映射模块,在所述主机装置启动时,将所述非易失性内存映射到该主机装置的内核地址空间。
根据本发明的另一个方面的主机装置的容器运行加速系统,所述多个容器对所共享的文件系统同时进行操作。
根据本发明的另一个方面的主机装置的容器运行加速系统,所述日志文件仅被写入非易失性内存,而不被写入所述主机装置的硬盘。
根据本发明的另一个方面的主机装置的容器运行加速系统,在所述主机装置正常关机时,从所述非易失性内存中读取所述日志文件,并将所读取的该日志文件写入所述主机装置的硬盘。
根据本发明的另一个方面的主机装置的容器运行加速系统,所述内核地址空间是所述主机装置的操作系统的逻辑地址空间。
本发明的其他另一个方面提供了一种主机装置,包括:非易失性内存;处理器;以及存储器,存储有计算机可执行指令,所述指令在被处理器执行时,使得处理器执行本发明的一个方面的所述主机装置的容器运行加速方法。
本发明的其他另一个方面提供了一种计算机可读存储介质,存储有计算机可执行指令,所述指令在被处理器执行时,使得处理器执行本发明的一个方面的所述主机装置的容器运行加速方法。
附图说明
为了更完整地理解本发明及其优势,现在将参考结合附图的以下描述,其中:
图1示意性示出了本发明的实施例的主机装置100的结构图。
图2示意性示出了本发明的实施例的主机装置100的容器运行加速方法的流程图;
图3示意性示出了本发明的实施例的主机装置100的容器运行加速方法的变形例的局部流程图;
图4示意性示出了本发明的与实施例的主机装置100的容器运行加速方法对应的容器运行加速系统500的框图;
图5示意性示出了本发明的变形例的主机装置200的结构图。
具体实施方式
为使本发明的目的、技术方案和优点更加清楚明白,以下结合具 体实施例,并参照附图,对本发明进行详细说明。
应当注意,这里描述的实施例只用于举例说明,并不用于限制本公开。在以下描述中,为了提供对本公开的透彻理解,阐述了大量特定细节。然而,对于本领域普通技术人员显而易见的是:不必采用这些特定细节来实行本公开。
在整个说明书中,对“一个实施例”、“实施例”、“一个示例”或“示例”的提及意味着:结合该实施例或示例描述的特定特征、结构或特性被包含在本公开至少一个实施例中。因此,在整个说明书的各个地方出现的短语“在一个实施例中”、“在实施例中”、“一个示例”或“示例”不一定都指同一实施例或示例。此外,可以以任何适当的组合和/或子组合将特定的特征、结构或特性组合在一个或多个实施例或示例中。此外,本领域普通技术人员应当理解,在此提供的附图都是为了说明的目的,并且附图不一定是按比例绘制的。相同的附图标记指示相同的要素。这里使用的术语“和/或”包括一个或多个相关列出的项目的任何和所有组合。术语“包括”和“含有”及其派生词意为包括而非限制;术语“或”是包含性的,意为和/或。
在本说明书中,下述用于描述本发明原理的各种实施例只是说明,不应该以任何方式解释为限制发明的范围。参照附图的下述描述用于帮助全面理解由权利要求及其等同物限定的本发明的示例性实施例。下述描述包括多种具体细节来帮助理解,但这些细节应认为仅仅是示例性的。因此,本领域普通技术人员应认识到,在不背离本发明的范围和精神的情况下,可以对本文中描述的实施例进行多种改变和修改。此外,为了清楚和简洁起见,省略了公知功能和结构的描述。此外,贯穿附图,相同参考数字用于相似功能和操作。
本发明的实施例提供了一种能够使容器的存储IO性能得到大幅提升的主机装置的容器运行加速方法及容器运行加速系统。
图1示意性示出了本发明的实施例的主机装置100的结构图。
如图1所示,本发明的主机装置100包括处理器103(例如,微处理器(μP)、数字信号处理器(DSP)等)。处理器103可以是用于执行 本文描述的流程的不同动作的单一处理单元或者是多个处理单元。主机装置100还可以包括用于从其他实体接收信号的输入单元101、以及用于向其他实体提供信号的输出单元102。输入单元101和输出单元102可以被布置为单一实体或者是分离的实体。
此外,主机装置100包括具有非易失性内存105,存储在该非易失性内存105中的数据在系统掉电后可以恢复。主机装置100还可以包括硬盘104。在该硬盘104中存储有文件系统11,当由主机装置100中的多个容器对所共享的文件系统11进行操作时,将用于记录多个容器对文件系统11进行的操作的日志文件写入非易失性内存105。其中,多个容器在主机装置100中可以是同时运行的,即:多个容器对所共享的文件系统11同时进行操作。此外,该硬盘104中还可以存储有计算机程序模块12,该计算机程序模块12包括代码/计算机可读指令,其在由主机装置100中的处理器103执行时使得主机装置100可以执行例如下面图2~3所描述的流程及其任何变形。
处理器103可以是单个CPU(中央处理单元),但也可以包括两个或更多个处理单元。例如,处理器可以包括通用微处理器、指令集处理器和/或相关芯片组和/或专用微处理器(例如,专用集成电路(ASIC))。处理器103还可以包括用于缓存用途的板载存储器。计算机程序模块可以由连接到处理器103的计算机程序产品来承载。
下面,以图2来具体描述本发明实施例的主机装置100的容器运行加速方法。
图2示意性示出了本发明的实施例的主机装置100的容器运行加速方法的流程图。
如图2所示,首先,在主机装置100启动时,通过使用非易失性内存105的APP模式,将非易失性内存105映射到该主机装置100的内核地址空间(步骤S1)。其中,上述内核地址空间是指主机装置100的操作系统的逻辑地址空间。
接着,判断主机装置100的多个容器是否对所共享的文件系统11进行了操作而要将用于记录上述多个容器对文件系统11进行的操作 的日志文件写入(步骤S2)。
然后,当上述步骤S2的判断结果为“是”,即:上述多个容器对文件系统11进行了操作而要写入上述日志文件时,将上述日志文件写入非易失性内存105(步骤S3),处理结束。当上述步骤S2的判断结果为“否”,即:上述多个容器未对文件系统11进行操作而不需要写入上述日志文件时,处理结束。
这样,根据本发明的实施例的主机装置及主机装置的容器运行加速方法,日志写入非易失性内存缓存后,可以直接返回(write back模式),并不需要等待同步到后台存储设备(硬盘)上,这样就解决了日志文件瓶颈问题。
此外,日志写入的设备是非易失性内存,相当于数据的内存拷贝,性能提升很大。对于容器的存储IO性能会有一个数量级的性能提升。
而且,由于非易失性内存的特性,缓存中的数据在系统掉电后可以恢复,所以日志文件是安全的。
下面,作为上述实施例的一种变形例,在上述实施例的将日志文件写入非易失性内存而不写入硬盘这样的技术方案的基础上,还优选在主机装置100的正常关机时,可以考虑追加如下图3所示的日志读写处理。
图3示意性示出了本发明的实施例的主机装置100的容器运行加速方法的变形例的局部流程图。
如图3所示,在上述步骤S3之后,即:将日志文件写入非易失性内存105之后,判断主机装置100是否正常关机(步骤S3-1)。
接着,在上述步骤S3-1的判断结果为“是”,即:正常关机时,从非易失性内存105中读取上述日志文件(步骤S3-2),处理进入步骤S3-3。在上述步骤S3-1的判断结果为“否”,即:非正常关机时,处理结束。
在步骤S3-3中,将由上述步骤S3-2所读取的上述日志文件写入上述硬盘104,作为最终备份,处理结束。
这样,该变形例的方法,通过在正常关机时,才最终将日志文件写入硬盘,作为最终备份,从而不仅实现了如上述实施例的方法那样的技 术效果,而且通过双重备份,进一步确保了日志文件的安全保存、和在系统故障时利用日志文件的可靠恢复。
以上的详细描述通过使用方框图、流程图和/或示例,已经阐述了主机装置的容器运行加速方法的实施例。在这种方框图、流程图和/或示例包含一个或多个功能和/或操作的情况下,本领域技术人员应理解,这种方框图、流程图或示例中的每一功能和/或操作可以通过各种硬件、软件、固件或实质上它们的任意组合来单独和/或共同实现。在一个实施例中,本公开的实施例所述主题的若干部分可以通过专用集成电路(ASIC)、现场可编程门阵列(FPGA)、数字信号处理器(DSP)、或其他集成格式来实现。然而,本领域技术人员应认识到,这里所公开的实施例的一些方面在整体上或部分地可以等同地实现在集成电路中,实现为在一台或多台计算机上运行的一个或多个计算机程序(例如,实现为在一台或多台计算机系统上运行的一个或多个程序),实现为在一个或多个处理器上运行的一个或多个程序(例如,实现为在一个或多个微处理器上运行的一个或多个程序),实现为固件,或者实质上实现为上述方式的任意组合,并且本领域技术人员根据本公开,将具备设计电路和/或写入软件和/或固件代码的能力。此外,本领域技术人员将认识到,本公开所述主题的机制能够作为多种形式的程序产品进行分发,并且无论实际用来执行分发的信号承载介质的具体类型如何,本公开所述主题的示例性实施例均适用。信号承载介质的示例包括但不限于:可记录型介质,如软盘、硬盘驱动器、紧致盘(CD)、数字通用盘(DVD)、数字磁带、计算机存储器等;以及传输型介质,如数字和/或模拟通信介质(例如,光纤光缆、波导、有线通信链路、无线通信链路等)。
下面,以图4为例,说明一种以硬件方式实现了上述主机装置的容器运行加速方法的容器运行加速系统。
图4示意性示出了本发明的与实施例的主机装置100的容器运行加速方法对应的容器运行加速系统500的框图。
如图4所示,容器运行加速系统500包括映射模块501和日志写入模块502。
在映射模块501中,在主机装置100启动时,通过使用非易失性内存105的APP模式,将非易失性内存105映射到该主机装置100的内核地址空间。其中,上述内核地址空间是指主机装置100的操作系统的逻辑地址空间。
在日志写入模块502中,判断主机装置100的多个容器是否对所共享的文件系统11进行了操作而要将用于记录上述多个容器对文件系统11进行的操作的日志文件写入。
当上述判断结果为“是”,即:上述多个容器对文件系统11进行了操作而要写入上述日志文件时,将上述日志文件写入非易失性内存105。当上述判断结果为“否”,即:上述多个容器未对文件系统11进行操作而不需要写入上述日志文件时,结束处理。
这样,根据本发明的实施例的主机装置的容器运行加速系统,日志写入非易失性内存缓存后,可以直接返回(write back模式),并不需要等待同步到后台存储设备(硬盘)上,这样就解决的日志文件瓶颈问题。
此外,日志写入的设备是非易失性内存,相当于数据的内存拷贝,性能提升很大。对于容器的存储IO性能会有一个数量级的性能提升。
而且,由于非易失性内存的特性,缓存中的数据在系统掉电后可以恢复,所以日志文件是安全的。
此外,如图4所示,优选在上述主机装置的容器运行加速系统中还包括日志读写模块503。
在日志读写模块503中,首先判断主机装置100是否正常关机。在上述判断结果为“是”,即:正常关机时,从非易失性内存105中读取上述日志文件,并将由所读取的上述日志文件写入上述硬盘104,作为最终备份。在上述判断结果为“否”,即:非正常关机时,结束处理。
这样,通过在正常关机时,才最终将日志文件写入硬盘,作为最终备份,从而通过双重备份,进一步确保了日志文件的安全保存、和在系统故障时利用日志文件的可靠恢复。
下面,作为上述实施例的主机装置100的变形例,以图5为例说 明程序模块并非保存于硬盘而保存于任意其他记录介质的结构。
图5示意性示出了本发明的变形例的主机装置200的结构图。
如图5所示,主机装置200包括具有非易失性内存205,存储在该非易失性内存205中的数据在系统掉电后可以恢复。主机装置200还可以包括硬盘204。在该硬盘204中存储有文件系统22,当由主机装置200中的多个容器对所共享的文件系统21进行操作时,将用于记录多个容器对文件系统21进行的操作的日志文件写入非易失性内存205。其中,多个容器在主机装置200中可以是同时运行的,即:多个容器对所共享的文件系统11同时进行操作。此外,主机装置200还包括记录介质206(即,计算机可读存储介质)。该记录介质206中可以存储有计算机程序模块22,该计算机程序模块22包括代码/计算机可读指令,其在由主机装置200中的处理器203执行时使得主机装置200可以执行例如上面图2~3所描述的流程及其任何变形。
此外,上述记录介质206可以是ROM、随机存取内存(RAM)、CD-ROM、磁带、软盘和光数据存储设备等,且上述计算机程序模块22在备选实施例中可以用UE内的存储器的形式被分布到不同计算机程序产品中。
这样,本发明的该变形例的主机装置200也同样可以实现上述各实施例的技术效果。
这样,根据本发明实施例的主机装置、计算机可读存储介质和主机装置的容器运行加速方法及系统,日志写入非易失性内存缓存后,可以直接返回(write back模式),并不需要等待同步到后台存储设备上,这样就解决的日志文件瓶颈问题。
此外,日志写入的设备是非易失性内存,相当于数据的内存拷贝,性能提升很大。
此外,对于NAS一类的网络文件系统,有着同样的加速效果。
而且,由于非易失性内存的特性,缓存中的数据在系统掉电后可以恢复,所以日志文件是安全的。
此外,对于容器的存储IO性能会有一个数量级的性能提升。
如本领域技术人员将会理解的,为了任何的以及所有的目的,例如在提供书面说明书的方面,本申请中所公开的所有范围也涵盖任何的以及所有的可能的子范围以及其子范围的组合。任何所列出的范围均能够被容易地识别成充分的描述以及使同样的范围能够至少被分解成同等的两部分、三部分、四部分、五部分、十部分,等等。作为非限制性的例子,本申请中所讨论的每个范围均能够被容易地分解成下三分之一、中三分之一以及上三分之一等等。如本领域技术人员还将会理解的,诸如“直到”、“至少”、“大于”、“小于”等的所有语言均包括所表述的数量并且是指能够随之被分解成如以上所讨论的子范围的范围。最后,如本领域技术人员将会理解的,范围包括各个单独的成分。所以,例如,具有1-3个单元的组是指具有1、2或者3个单元的组。类似地,具有1-5个单元的组是指具有1、2、3、4或者5个单元的组,等等。
尽管已经参照本发明的特定示例性实施例示出并描述了本发明,但是本领域技术人员应该理解,在不背离所附权利要求及其等同物限定的本发明的精神和范围的情况下,可以对本发明进行形式和细节上的多种改变。因此,本发明的范围不应该限于上述实施例,而是应该不仅由所附权利要求来进行确定,还由所附权利要求的等同物来进行限定。

Claims (10)

  1. 一种主机装置的容器运行加速方法,包括:
    当由多个容器对所共享的文件系统进行操作时,将日志文件写入非易失性内存,其中,所述日志文件用于记录所述多个容器对所述文件系统进行的操作,
    在所述主机装置启动时,将所述非易失性内存映射到该主机装置的内核地址空间。
  2. 根据权利要求1所述的容器运行加速方法,其中,所述多个容器对所共享的文件系统同时进行操作。
  3. 根据权利要求1所述的容器运行加速方法,其中,
    所述日志文件仅被写入非易失性内存,而不被写入所述主机装置的硬盘。
  4. 根据权利要求1所述的容器运行加速方法,还包括:
    在所述主机装置正常关机时,从所述非易失性内存中读取所述日志文件,并将所读取的该日志文件写入所述主机装置的硬盘。
  5. 根据权利要求1所述的容器运行加速方法,其中,
    所述内核地址空间是所述主机装置的操作系统的逻辑地址空间。
  6. 一种主机装置的容器运行加速系统,包括:
    写入模块,当由多个容器对所共享的文件系统进行操作时,将日志文件写入非易失性内存,其中,所述日志文件用于记录所述多个容器对所述文件系统进行的操作;以及
    映射模块,在所述主机装置启动时,将所述非易失性内存映射到该主机装置的内核地址空间。
  7. 根据权利要求6所述的容器运行加速系统,其中,所述多个容器对所共享的文件系统同时进行操作。
  8. 根据权利要求6所述的容器运行加速系统,其中,所述日志文件仅被写入非易失性内存,而不被写入所述主机装置的硬盘。
  9. 根据权利要求6所述的容器运行加速系统,还包括:
    读写模块,在所述主机装置正常关机时,从所述非易失性内存中读取所述日志文件,并将所读取的该日志文件写入所述主机装置的硬盘。
  10. 根据权利要求6所述的容器运行加速系统,其中,
    所述内核地址空间是所述主机装置的操作系统的逻辑地址空间。
PCT/CN2017/103664 2017-02-09 2017-09-27 主机装置的容器运行加速方法及系统 Ceased WO2018145473A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710072321.6 2017-02-09
CN201710072321.6A CN106874068B (zh) 2017-02-09 2017-02-09 主机装置的容器运行加速方法及系统

Publications (1)

Publication Number Publication Date
WO2018145473A1 true WO2018145473A1 (zh) 2018-08-16

Family

ID=59165960

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/103664 Ceased WO2018145473A1 (zh) 2017-02-09 2017-09-27 主机装置的容器运行加速方法及系统

Country Status (2)

Country Link
CN (1) CN106874068B (zh)
WO (1) WO2018145473A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106874068B (zh) * 2017-02-09 2020-02-21 联想(北京)有限公司 主机装置的容器运行加速方法及系统
CN110502460B (zh) * 2018-05-16 2021-03-23 华为技术有限公司 数据处理的方法和节点
CN109491837B (zh) * 2018-11-01 2020-09-25 苏州浪潮智能科技有限公司 一种非易失性内存储器的日志容错处理方法与装置

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080208924A1 (en) * 2007-02-28 2008-08-28 Microsoft Corporation Security model for common multiplexed transactional logs
CN101593136A (zh) * 2008-05-30 2009-12-02 国际商业机器公司 使得计算机具有高可用性的方法和计算机系统
US20150254240A1 (en) * 2014-03-10 2015-09-10 Oracle International Corporation Instantaneous Unplug of Pluggable Database From One Container Database and Plug Into Another Container Database
CN106383852A (zh) * 2016-08-30 2017-02-08 中国民生银行股份有限公司 基于Docker容器的日志获取方法和装置
CN106874068A (zh) * 2017-02-09 2017-06-20 联想(北京)有限公司 主机装置的容器运行加速方法及系统

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8140554B2 (en) * 2008-12-19 2012-03-20 Microsoft Corporation Shared value resolution with multiple runtime containers
US8495338B2 (en) * 2010-12-03 2013-07-23 Micron Technology, Inc. Transaction log recovery
CN103729300B (zh) * 2013-12-25 2017-11-28 华为技术有限公司 非易失内存的管理方法和相关装置
CN104951360A (zh) * 2015-06-30 2015-09-30 北京奇虎科技有限公司 基于Docker的配置管理方式及装置
CN105159818B (zh) * 2015-08-28 2018-01-02 东北大学 内存数据管理中日志恢复方法及其仿真系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080208924A1 (en) * 2007-02-28 2008-08-28 Microsoft Corporation Security model for common multiplexed transactional logs
CN101593136A (zh) * 2008-05-30 2009-12-02 国际商业机器公司 使得计算机具有高可用性的方法和计算机系统
US20150254240A1 (en) * 2014-03-10 2015-09-10 Oracle International Corporation Instantaneous Unplug of Pluggable Database From One Container Database and Plug Into Another Container Database
CN106383852A (zh) * 2016-08-30 2017-02-08 中国民生银行股份有限公司 基于Docker容器的日志获取方法和装置
CN106874068A (zh) * 2017-02-09 2017-06-20 联想(北京)有限公司 主机装置的容器运行加速方法及系统

Also Published As

Publication number Publication date
CN106874068B (zh) 2020-02-21
CN106874068A (zh) 2017-06-20

Similar Documents

Publication Publication Date Title
US7840839B2 (en) Storage handling for fault tolerance in virtual machines
JP6338208B2 (ja) 仮想マシンのデータへアクセスするための方法および装置
US9201875B2 (en) Partition file system for virtual machine memory management
US9053065B2 (en) Method for restoring virtual machine state from a checkpoint file
KR102879385B1 (ko) 메모리 애퍼처 플러쉬 순서를 사용한 데이터 보존 기법
US8578214B2 (en) Error handling in a virtualized operating system
US20120089861A1 (en) Inter-processor failure detection and recovery
US20090249357A1 (en) Systems and methods for inter process communication based on queues
US9053064B2 (en) Method for saving virtual machine state to a checkpoint file
US11169870B2 (en) Managing the migration of virtual machines in the presence of uncorrectable memory errors
TWI735542B (zh) 一種虛擬機器的資料儲存方法和裝置
US11112977B2 (en) Filesystem enhancements for unified file and object access in an object storage cloud
BRPI0809078A2 (pt) Memória transacional que utiliza gravações armazenadas em buffer e ordem de serialização reforçada
US20200174893A1 (en) System and method for data packing into blobs for efficient storage
US11210024B2 (en) Optimizing read-modify-write operations to a storage device by writing a copy of the write data to a shadow block
WO2018145473A1 (zh) 主机装置的容器运行加速方法及系统
US10515682B2 (en) System and method for memory fault resiliency in a server using multi-channel dynamic random access memory
US20140244951A1 (en) Live snapshotting of multiple virtual disks in networked systems
US10606802B2 (en) Catalog backup and recovery using logical mirroring
US9122505B1 (en) System and method for handling I/O timeout deadlines in virtualized systems
US12248797B2 (en) Aggregating block mapping metadata to improve linked clone read performance
US9959180B1 (en) Systems and methods for shipping an I/O operation to prevent replication failure
JP6123931B1 (ja) 情報処理装置、情報処理方法、およびプログラム
Li et al. A novel integrity measurement method based on copy-on-write for region in virtual machine
US11853209B2 (en) Shared memory workloads using existing network fabrics

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17896018

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 10.12.2019)

122 Ep: pct application non-entry in european phase

Ref document number: 17896018

Country of ref document: EP

Kind code of ref document: A1