Container expansion methods, container expansion systems, container expansion devices, and storage media

By combining the initialization time and resource utilization rate of containerized applications, the startup time of new container instances is dynamically predicted, solving the problem of insufficient load balancing capacity during container initialization. This enables dynamic scaling and load balancing of containers, preventing resources from exceeding thresholds.

CN113535327BActive Publication Date: 2025-10-28CHINA TELECOM CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110812527.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-19
Publication Date
2025-10-28
Estimated Expiration
2041-07-19

AI Technical Summary

Technical Problem

In existing technologies, containers cannot provide load balancing capabilities in a timely manner during initialization, resulting in resource utilization exceeding the threshold and an inability to cope with the increasing business load pressure.

Method used

By setting a resource utilization threshold, combined with the initialization time of containerized applications and the rate of increase in resource utilization, the startup time of new container instances can be dynamically predicted, and the creation of new container instances can be automatically triggered to ensure that load balancing capabilities are provided in a timely manner when resource utilization reaches the threshold.

Benefits of technology

It enables containerized applications to provide business load balancing capabilities in real time when resource utilization reaches a threshold, avoiding the problem of resources exceeding the threshold, and is easy to use without manual operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113535327B_ABST
    Figure CN113535327B_ABST
Patent Text Reader

Abstract

This invention provides a container expansion method, a container expansion system, a container expansion device, and a storage medium. The container expansion method includes: setting a resource utilization threshold for container expansion; calculating the initialization time of the current containerized application in the current container; collecting the current resource utilization of the current container and calculating the rate of increase of the resource utilization; and creating a new container instance when the predicted resource utilization value obtained by adding the product of the initialization time and the rate of increase to the current resource utilization is greater than or equal to the resource utilization threshold.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to container technology, and particularly to container expansion methods, container expansion systems, container expansion devices, and storage media. Background Technology

[0002] The process of integrating and running an application into a container is called "containerization," and the application running in a container is called a "containerized application." Containerized applications have different workloads at different times and in different business scenarios, and have different requirements for resources such as CPU or memory. In order to make full use of host resources, instead of creating multiple container instances in a fixed way, it is necessary to scale up the containers according to the workload.

[0003] As an existing container scaling technology, a fixed threshold for container resource utilization (CPU or memory) is pre-set. When the current resource utilization of a container reaches or exceeds the preset threshold, a new container instance is created. However, because the initialization of containerized applications (such as preloading user data) takes a considerable amount of time, containers cannot immediately provide load-sharing capabilities at the beginning of their creation. Instead, they must wait until initialization is complete before providing load capacity. This results in the resource utilization of the original container potentially far exceeding the threshold during the initialization of the new container, making it unable to cope with the increased business load pressure. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a container expansion method, a container expansion system, a container expansion device, and a storage medium, which can realize the dynamic expansion of containers so that containerized applications can provide business load sharing capabilities in real time.

[0005] According to one aspect of the present invention, a container expansion method is provided, comprising:

[0006] Set the resource utilization threshold for container scaling;

[0007] Calculate the initialization time of the current containerized application in the current container;

[0008] Collect the current resource utilization of the current container and calculate the rate at which the resource utilization increases;

[0009] When the predicted resource utilization value obtained by adding the product of the initialization time and the increase rate to the current resource utilization rate is greater than or equal to the resource utilization threshold, a new container instance is created.

[0010] According to another aspect of the present invention, a container expansion system is provided, comprising:

[0011] The resource threshold module sets the resource utilization threshold for container expansion;

[0012] The initialization time acquisition module calculates the initialization time of the current containerized application in the current container.

[0013] The resource monitoring module collects the current resource utilization of the current container and calculates the rate at which the resource utilization increases.

[0014] The resource prediction module triggers a new container instance creation request when the predicted resource utilization value (the product of the initialization time and the increase rate) is greater than or equal to the resource utilization threshold; and

[0015] The container expansion control module creates new container instances based on the new container creation request from the prediction module.

[0016] According to another aspect of the present invention, a container expansion device is provided, comprising:

[0017] A memory, on which instructions are stored; and

[0018] The processor is configured to execute instructions stored in the memory to perform the steps of the container expansion method described above.

[0019] According to another aspect of the present invention, a storage medium is provided, including computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the container expansion method described above.

[0020] The container expansion method, system, and device of this invention can accurately predict the reasonable startup time of new container instances by combining the rate of increase in resource utilization with the initialization time of containerized applications. This enables containerized applications to provide load balancing capabilities in real time when resource utilization reaches a threshold, avoiding the problem of containers exceeding resource thresholds and achieving more accurate dynamic container expansion. Moreover, the prediction of containerized application initialization time and resource utilization is completed automatically by the system, requiring no additional manual operation, thus making it convenient to use. Attached Figure Description

[0021] Figure 1 A flowchart illustrating a container expansion method according to an embodiment of the present invention is shown.

[0022] Figure 2 A structural diagram of a container expansion system according to an embodiment of the present invention is shown.

[0023] Figure 3 An exemplary configuration diagram of a computing device according to an embodiment of the present invention is shown. Detailed Implementation

[0024] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0025] In this embodiment of the invention, by combining the initialization time of containerized applications and the growth rate of resource utilization, a more reasonable new container expansion time is accurately calculated, so that when the actual resource utilization reaches a fixed threshold, the newly expanded container can provide business load sharing capability in an instant, thereby realizing dynamic expansion of containers.

[0026] Figure 1 A flowchart illustrating a container expansion method according to an embodiment of the present invention is shown, as follows: Figure 1 As shown, the container expansion method of this invention includes the following steps:

[0027] Step S01: Set the resource utilization threshold A for container expansion. In this embodiment, CPU utilization or memory utilization can be used as the resource utilization.

[0028] Step S02: Calculate the initialization time T of the current containerized application within the current container. Specifically, the initialization time T can be calculated by calculating the time difference between the container startup time and the containerized application initialization completion time. In this embodiment, the container startup start time and containerized application initialization completion time can be collected from the containerized application startup log, and the initialization time T of the containerized application can be obtained by calculating the time difference between the container startup start time and the containerized application initialization completion time.

[0029] Step S03: Collect the current resource utilization rate B of the current container and calculate the rate of increase R of the resource utilization rate. As a method for calculating the rate of increase R of the resource utilization rate, the resource utilization rate can be collected at two time points, and the change in resource utilization rate at the two time points can be divided by the time difference between the two time points to calculate the rate of increase of the resource utilization rate. In this embodiment, for example, the current CPU utilization rate or the current memory utilization rate is collected as the current resource utilization rate B, and the rate of increase of the current CPU utilization rate or the current memory utilization rate is calculated as the rate of increase R of the resource utilization rate.

[0030] Step S04: Determine whether the predicted resource utilization rate is greater than or equal to the resource utilization rate threshold A. If yes, proceed to step S05; otherwise, return to step S03. The predicted resource utilization rate is obtained by adding the product of the initialization time T and the increase rate R to the current resource utilization rate B. That is, the predicted resource utilization rate is expressed by the following formula:

[0031] Resource utilization rate forecast = B + T × R

[0032] Step S05: Create a new container instance. In this embodiment of the invention, a request to create a new container instance can be triggered, and a new container instance is created by allocating resources based on the request.

[0033] Figure 2 A structural diagram of a container expansion system according to an embodiment of the present invention is shown. Figure 2 As shown, the container expansion system of this invention includes: a resource threshold configuration module 101, an initialization time acquisition module 102, a resource monitoring module 103, a resource prediction module 104, and a container expansion control module 105.

[0034] The resource threshold configuration module 101 sets a resource utilization threshold A for container expansion. In this embodiment, CPU utilization or memory utilization can be used as the resource utilization rate.

[0035] The initialization time acquisition module 102 calculates the initialization time T of the current containerized application in the current container. Specifically, the initialization time acquisition module 102 can collect the container startup start time and the containerized application initialization completion time from the containerized application startup log, and obtain the initialization time T of the containerized application by calculating the time difference between the container startup start time and the containerized application initialization completion time.

[0036] The resource monitoring module 103 collects the current resource utilization rate B of the current container and calculates the rate of increase R of the resource utilization rate. Specifically, the resource monitoring module 103 collects the current CPU utilization rate or the current memory utilization rate as the current resource utilization rate B, and calculates the rate of increase R of the current CPU utilization rate or the current memory utilization rate. In this embodiment, the rate of increase R of the resource utilization rate is calculated by collecting the resource utilization rate at two time points and dividing the change in the resource utilization rate at the two time points by the time difference between the two time points.

[0037] The resource prediction module 104 obtains the initialization time T of the containerized application from the initialization time acquisition module 102, the current resource utilization rate B and the rate of increase R of the resource utilization rate from the resource monitoring module 103, and the resource utilization rate threshold A from the resource threshold configuration module 101. When the predicted resource utilization rate is greater than or equal to the resource utilization rate threshold A, a new container instance creation request is triggered. The predicted resource utilization rate is obtained by adding the product of the initialization time T of the containerized application and the rate of increase R of the resource utilization rate to the current resource utilization rate B. That is, the predicted resource utilization rate is expressed by the following formula:

[0038] Resource utilization rate forecast = B + T × R

[0039] The container scaling control module 105 receives a container instance creation request from the resource prediction module 104 and creates a new container instance by allocating resources.

[0040] The container scaling method and system described in this invention can accurately predict the reasonable startup time of new container instances by combining the rate of increase in resource utilization with the initialization time of containerized applications. This enables containerized applications to provide load balancing capabilities in a timely manner when resource utilization reaches a threshold, avoiding the problem of containers exceeding resource thresholds and achieving more accurate dynamic container scaling. Moreover, the prediction of containerized application initialization time and resource utilization is completed automatically by the system, requiring no additional manual operation, thus making it convenient to use.

[0041] The container expansion method of this invention can be implemented by a container expansion device, which can be implemented by... Figure 3 The computing device 300 shown is implemented.

[0042] Computing device 300 is an example of a hardware device capable of applying the container expansion method of the present invention. Computing device 300 can be any machine configured to perform processing and / or computation. Computing device 300 can be, but is not limited to, a workstation, server, desktop computer, laptop computer, tablet computer, personal data assistant (PDA), smartphone, in-vehicle computer, or a combination thereof.

[0043] like Figure 3 As shown, computing device 300 may include one or more components that can be connected to or communicate with bus 302 via one or more interfaces. Bus 302 may include, but is not limited to, Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MCA) bus, Enhanced ISA (EISA) bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus. Computing device 300 may include, for example, one or more processors 304, one or more input devices 306, and one or more output devices 308. The one or more processors 304 may be any type of processor and may include, but is not limited to, one or more general-purpose processors or special-purpose processors (such as special-purpose processing chips). Processor 304 may, for example, execute... Figure 1 The steps in are configured to implement Figure 1The steps in the process are functional. Input device 306 can be any type of input device capable of inputting information to the computing device, and may include, but is not limited to, a mouse, keyboard, touchscreen, microphone, and / or remote controller. Output device 308 can be any type of device capable of presenting information, and may include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer.

[0044] The computing device 300 may also include or be connected to a non-transitory storage device 314, which may be any non-transitory storage device capable of storing data, and may include, but is not limited to, disk drives, optical storage devices, solid-state storage, floppy disks, flexible disks, hard disks, magnetic tapes or any other magnetic media, compressed disks or any other optical media, cache memory and / or any other storage chip or module, and / or any other medium from which a computer may read data, instructions and / or code. The computing device 300 may also include random access memory (RAM) 310 and read-only memory (ROM) 312. ROM 312 may store executable programs, utilities, or processes in a non-volatile manner. RAM 310 provides volatile data storage and stores instructions related to the operation of the computing device 300. The computing device 300 may also include a network / bus interface 316 coupled to a data link 318. The network / bus interface 316 can be any kind of device or system capable of enabling communication with external devices and / or networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication devices and / or chipsets (such as Bluetooth™ devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication facilities, etc.).

[0045] This invention can be implemented as any combination of apparatus, system, integrated circuit, and computer program on a non-transitory computer-readable medium. One or more processors can be implemented as integrated circuits (ICs), application-specific integrated circuits (ASICs), or large-scale integrated circuits (LSIs), system LSIs, super LSIs, or super LSI components that perform some or all of the functions described in this disclosure.

[0046] This invention includes the use of software, application programs, computer programs, or algorithms. Software, application programs, computer programs, or algorithms can be stored on a non-transitory computer-readable medium to cause a computer, such as one or more processors, to perform the steps described above and in the accompanying drawings. For example, one or more memories store the software or algorithm in executable instructions, and one or more processors can associate and execute a set of instructions of the software or algorithm to provide various functionalities according to embodiments described in this invention.

[0047] Software and computer programs (also referred to as programs, software applications, applications, components, or code) include machine instructions for programmable processors and can be implemented in high-level procedural languages, object-oriented programming languages, functional programming languages, logic programming languages, assembly languages, or machine languages. The term "computer-readable medium" means any computer program product, apparatus, or device used to provide machine instructions or data to a programmable data processor, such as magnetic disks, optical disks, solid-state storage devices, memories, and programmable logic devices (PLDs), including computer-readable media that receive machine instructions as computer-readable signals.

[0048] For example, computer-readable media may include dynamic random access memory (DRAM), random access memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), compact disc read-only memory (CD-ROM) or other optical disc storage devices, magnetic disk storage devices or other magnetic storage devices, or any other medium that can be used to carry or store required computer-readable program code in the form of instructions or data structures, and that can be accessed by a general-purpose or special-purpose computer or a general-purpose or special-purpose processor. As used herein, a disk or disc includes compact discs (CD), laser discs, optical discs, digital versatile discs (DVD), floppy disks, and Blu-ray discs, wherein a disk typically copies data magnetically, while a disc copies data optically using a laser. Combinations of the above are also included within the scope of computer-readable media.

[0049] The subject matter of this invention is provided as examples of apparatus, systems, methods, and procedures for performing the features described in this disclosure. However, other features or variations are contemplated in addition to the features described above. It is anticipated that components and functions of the invention can be implemented using any emerging techniques that may replace any of the above-described implementations.

[0050] Furthermore, the above description provides examples and does not limit the scope, applicability, or configuration set forth in the claims. Changes may be made to the function and arrangement of the elements discussed without departing from the spirit and scope of the invention. Various processes or components may be appropriately omitted, substituted, or added in various embodiments. For example, features described with respect to certain embodiments may be combined in other embodiments.

[0051] Similarly, although the operations are depicted in a specific order in the accompanying drawings, this should not be construed as requiring the operations to be performed in the specific order shown or in sequential order, or requiring the execution of all illustrated operations to achieve the desired result. In some cases, multitasking and parallel processing can be advantageous.

[0052] The various embodiments of the present invention have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical applications, or technical improvements to market technology of the embodiments, or to enable others skilled in the art to understand the embodiments disclosed herein.

Claims

1. A method for expanding the capacity of a container, comprising: Set the resource utilization threshold for container scaling; The initialization time of the current containerized application in the current container is calculated by calculating the time difference from the start time of container startup to the completion time of containerized application initialization. The start time of container startup and the completion time of containerized application initialization are collected from the containerized application startup log. Collect the current resource utilization rate of the current container and calculate the rate of increase of the resource utilization rate. The rate of increase of the resource utilization rate is calculated by collecting the resource utilization rate at two time points and dividing the change in the resource utilization rate at the two time points by the time difference between the two time points. When the predicted resource utilization value obtained by adding the product of the initialization time and the increase rate to the current resource utilization rate is greater than or equal to the resource utilization threshold, a new container instance is created.

2. The container expansion method according to claim 1, wherein, The resource utilization rate refers to either CPU utilization or memory utilization.

3. The container expansion method according to any one of claims 1 to 2, wherein, A new container instance is created by triggering a request to create the new container instance and allocating resources.

4. A container expansion system, comprising: The resource threshold module sets the resource utilization threshold for container expansion; The initialization time acquisition module calculates the initialization time of the current containerized application in the current container. The initialization time is calculated by calculating the time difference from the start time of container startup to the completion time of containerized application initialization. The start time of container startup and the completion time of containerized application initialization are collected from the containerized application startup log. The resource monitoring module collects the current resource utilization rate of the current container and calculates the rate of increase of the resource utilization rate. The rate of increase of the resource utilization rate is calculated by collecting the resource utilization rate at two time points and dividing the change in the resource utilization rate at the two time points by the time difference between the two time points. The resource prediction module triggers a new container instance creation request when the predicted resource utilization value (the product of the initialization time and the increase rate) is greater than or equal to the resource utilization threshold; and The container expansion control module creates new container instances based on the new container creation request from the prediction module.

5. A container expansion device, comprising: A memory that stores instructions; as well as The processor is configured to execute instructions stored in the memory to perform the method according to any one of claims 1 to 3.

6. A storage medium comprising computer-executable instructions, which, when executed by one or more processors, cause the one or more processors to perform the method according to any one of claims 1 to 3.