WO2024021475A1 - Container scheduling method and apparatus - Google Patents

Container scheduling method and apparatus Download PDF

Info

Publication number
WO2024021475A1
WO2024021475A1 PCT/CN2022/141481 CN2022141481W WO2024021475A1 WO 2024021475 A1 WO2024021475 A1 WO 2024021475A1 CN 2022141481 W CN2022141481 W CN 2022141481W WO 2024021475 A1 WO2024021475 A1 WO 2024021475A1
Authority
WO
WIPO (PCT)
Prior art keywords
container
migrated
physical host
containers
load
Prior art date
Application number
PCT/CN2022/141481
Other languages
French (fr)
Chinese (zh)
Inventor
刘阳
李旭
方文
景广豫
Original Assignee
天翼云科技有限公司
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 天翼云科技有限公司 filed Critical 天翼云科技有限公司
Publication of WO2024021475A1 publication Critical patent/WO2024021475A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5083Techniques for rebalancing the load in a distributed system
    • G06F9/5088Techniques for rebalancing the load in a distributed system involving task migration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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/4557Distribution of virtual machine instances; Migration and load balancing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • Embodiments of the present invention relate to the field of computing technology, and in particular, to a container scheduling method and device.
  • Embodiments of the present invention provide a container scheduling method and device for reducing energy consumption of physical machines.
  • embodiments of the present invention provide a container scheduling method, including:
  • the load indicators of the first physical host include:
  • CPU utilization of the first physical host CPU utilization of the first physical host; memory utilization of the first physical host.
  • One possible implementation method is to determine the load indicator of the first physical host and determine the overload of the first physical host based on the load indicator, including:
  • the first physical host is determined to be overloaded.
  • One possible implementation method is to determine X containers to be migrated from all containers included in the first physical host, including:
  • the container For a container that does not have a container copy in the first physical host, if the load correlation between the container and the first physical host is less than the preset threshold, the container is determined to be a container to be migrated; for a container that has a container copy in the first physical host, Determine the container as a container to be reduced or a container to be expanded, and determine the container as a container to be migrated.
  • a possible implementation method for containers to be reduced and containers to be expanded also includes:
  • the container whose load similarity with the first physical host is less than the preset threshold is determined to be the container to be migrated, which reduces the impact on the physical host.
  • the container and the corresponding container copy are determined to be the container to be migrated, taking into account the reliability of the system. operability.
  • a possible implementation method of migrating at least one container to be migrated and a container copy of at least one container to be migrated among the X containers to be migrated to a second physical host includes:
  • a container scheduling device including:
  • the acquisition unit is used to determine the load indicator of the first physical host, and determine the overload of the first physical host according to the load indicator;
  • a processing unit configured to determine X containers to be migrated from all containers included in the first physical host, where The replica is migrated to the second physical host.
  • the processing unit is specifically used to:
  • the container For a container that does not have a container copy in the first physical host, if the load correlation between the container and the first physical host is less than the preset threshold, the container is determined to be a container to be migrated; for a container that has a container copy in the first physical host, Determine the container as a container to be reduced or a container to be expanded, and determine the container as a container to be migrated.
  • the processing unit is specifically used to:
  • the processing unit is specifically used to:
  • embodiments of the present invention provide a computer-readable non-volatile storage medium that includes computer-readable instructions.
  • the computer reads and executes the computer-readable instructions, it causes the computer to execute the above container scheduling method.
  • embodiments of the present invention provide a computer-readable storage medium.
  • the storage medium stores computer instructions.
  • the computer instructions are run by a processor, the method provided in the first aspect is executed.
  • embodiments of the present invention further provide a computer program product, which includes computer-executable instructions.
  • the computer-executable instructions are used to cause a computer to execute the method provided in the first aspect.
  • the embodiments of the present invention at least have the following technical effects:
  • load prediction is performed on containers and physical hosts to accurately realize the scheduling of high-load containers.
  • the embodiments of the present invention take into account the operability of the entire system, and at the same time, the embodiments of the present invention integrate the maximum container load strategy, so that the embodiments of the present invention can realize energy consumption optimization as soon as possible.
  • Figure 1 is a schematic diagram of a network architecture provided by an embodiment of the present invention.
  • Figure 2 is a schematic flowchart of a container scheduling method provided by an embodiment of the present invention.
  • Figure 3 is a schematic model diagram of a load prediction method provided by an embodiment of the present invention.
  • Figure 4 is a schematic structural diagram of a container scheduling device provided by an embodiment of the present invention.
  • Figure 5 is a schematic structural diagram of a computer device provided by an embodiment of the present invention.
  • Container technology also known as container virtualization technology or container technology virtualization technology
  • container technology virtualization technology is a virtual technology that improves resource usage and can improve work efficiency.
  • container technology can be deployed anywhere and flexibly migrated, improving development efficiency and reducing deployment workload. Since the development of container technology, it has been used in most enterprises, and container technology has become an important player in the field of virtualization.
  • embodiments of the present invention propose a container scheduling method and device, which can achieve accurate scheduling of high-load containers, while taking into account the operability of the entire system and container copy processing, and reducing energy consumption.
  • a container provides services for an application (Application, APP), such as storage and computing resources.
  • APP Application
  • an APP can also be configured with multiple container copies corresponding to a container.
  • FIG. 2 is a flowchart of a container scheduling method provided by an embodiment of the present invention. This flowchart can be executed by a container scheduling device.
  • the process specifically includes:
  • Step 201 Determine the load index of the first physical host, and determine that the first physical host is overloaded based on the load index.
  • the load indicators of the first physical host may include but are not limited to: central processing unit (Central Processing Unit, CPU) utilization; memory utilization.
  • CPU Central Processing Unit
  • the specific method of determining the load indicator of the first physical host is not limited by the embodiment of the present invention.
  • a detection system can be installed on the physical host.
  • the main indicators for detection are: CPU utilization, memory utilization, disk utilization, and network inflow. , network outflow, etc.
  • the observed CPU utilization of the first physical host is greater than or equal to the first threshold, and/or the observed memory utilization of the first physical host is greater than or equal to the second threshold, it is determined that the first physical host is overloaded.
  • a load prediction method based on an attention mechanism is used to predict the CPU utilization of the first physical host and the memory utilization of the first physical host. If the predicted CPU utilization of the first physical host is greater than or equal to the first threshold, and/or the predicted memory utilization of the first physical host is greater than or equal to the second threshold, the first physical host is determined to be overloaded.
  • the first threshold and the second threshold can be set, for example, the first threshold and the second threshold are both set to 0.7.
  • Step 202 Determine X containers to be migrated from all containers included in the first physical host, where X is an integer greater than 0.
  • a container there may be multiple ways to determine how to determine that the container is a container to be migrated.
  • the container is determined to be a container to be migrated.
  • the container whose load correlation with the first physical host is less than the preset threshold is given priority as the container to be migrated.
  • the container CPU utilization and memory utilization need to be detected in real time on the container. , disk utilization and other data, the calculation formula of load correlation can be expressed as follows:
  • Formula (1) is used to calculate the CPU load correlation between the container and the physical host
  • Formula (2) is used to calculate the memory load correlation between the container and the physical host.
  • mem represents memory
  • formula (3) is used to calculate the total load correlation Cor(c a , pm a ) between the container and the physical host.
  • the total load correlation Cor(c a , pm a ) size of the container with the physical host lies between 0 and 2.
  • a preset threshold can be set, for example, the preset threshold is set to 0.55. When the total load correlation between the container and the physical machine is less than the preset threshold, it can be considered that the load correlation between the container and the first physical host is small. , the container can be determined as the container to be migrated.
  • a container to be reduced and a container to be expanded are determined, and the container to be reduced and the container to be expanded are determined to be containers to be migrated.
  • a container When determining whether a container to be reduced or a container to be expanded is a container to be migrated, a container can be determined to be a container to be reduced or a container to be migrated based on the comparison between the predicted CPU utilization and memory utilization of the container and the current CPU utilization and memory utilization. Expand the container.
  • Perform load prediction on the containers on the first physical host for example, use a load prediction model based on the attention mechanism to perform load prediction, and obtain two load indicator prediction values for each container.
  • the two load indicators are the CPU utilization of the container and Memory utilization.
  • this container can be determined as a container to be reduced.
  • both the containers to be expanded and the containers to be reduced can be used as containers to be migrated.
  • the first number of replicas of the container's container replicas after scaling down is determined, and the first number of replicas of the container after scaling down are determined as the containers to be migrated.
  • the first copy number when shrinking the number of copies of the container to be reduced, is related to the expected number of copies for shrinking.
  • the first copy number is the expected number of copies for shrinking, rounded down.
  • the calculation formula for the expected number of copies for shrinking is It can be shown as formula (4), formula (5), and formula (6).
  • cpu represents the central processing unit and mem represents memory.
  • n cd Indicates the expected number of copies for scaling down calculated from CPU utilization
  • n cd Indicates the expected number of copies for scaling down calculated from CPU utilization
  • n cd Indicates the expected number of copies for shrinking calculated from memory utilization
  • n cd Indicates the number of existing copies
  • n cd Indicates the current value of memory utilization of the container copy
  • the expected number of replicas for scaling is calculated by formula (6) Expected number of replicas for scaling down Pick and small value in between.
  • For the container to be expanded determine the second number of copies of the container's container copy after expansion, and determine the second number of container copies after expansion as the container to be migrated.
  • the second copy number is related to the expected number of copies for expansion.
  • the second copy number is the expected number of copies for expansion, rounded up.
  • the calculation formula for the expected number of copies for expansion can be as follows: formula (7), formula ( 8), as shown in formula (9).
  • cpu represents the central processing unit and mem represents the memory.
  • formula (7) Represents the expected number of copies for expansion calculated from CPU utilization, refers to the predicted CPU utilization value of the container copy, n cd refers to the number of existing copies, Refers to the current value of the CPU utilization of the container replica.
  • formula (8) Represents the expected number of copies for expansion calculated from memory utilization, refers to the predicted memory utilization value of the container copy, n cd refers to the number of existing copies, Refers to the current value of the memory utilization of the container replica.
  • the expected number of replicas for expansion is calculated by formula (9) Expected number of replicas for expansion Pick and the maximum value between.
  • Step 203 Migrate at least one container to be migrated and a container copy of at least one container to be migrated among the X containers to be migrated to the second physical host.
  • the maximum container load placement strategy is adopted for the X containers to be migrated. According to the load of each container to be migrated in descending order, at least one container to be migrated with the largest load among the X containers to be migrated and at least A container copy of the container to be migrated is migrated to the second physical host. Repeat selecting the container to be migrated and placing the container until the first physical host is no longer overloaded.
  • overloaded physical hosts can no longer be overloaded and energy consumption can be reduced.
  • Embodiments of the present invention also provide a container scheduling method to further reduce energy consumption.
  • Y underloaded third physical hosts are determined from multiple physical hosts, Y is an integer greater than 0; containers and container copies on Y underloaded third physical hosts are migrated to the fourth physical host,
  • the fourth physical host is a physical host other than the first physical host among the plurality of physical hosts.
  • the load prediction method based on the attention mechanism is used to predict the load of the underloaded third physical host.
  • the third physical hosts are arranged in ascending order according to the load prediction results, and the third physical hosts with smaller load prediction results are ranked All containers on the host are migrated out.
  • the migrated containers are allocated to the fourth physical host according to the placement strategy from large to small based on the container load. When the containers on the underloaded third physical host are all allocated, the underloaded third physical host is closed. Three physical hosts.
  • Energy consumption can be further reduced by scheduling containers on an underloaded third physical host.
  • All the above load predictions use load prediction methods based on attention mechanisms. Start another container on the physical host and deploy a prediction model with an attention mechanism to predict the container load and physical host load.
  • Figure 3 is a model based on a load prediction method with an attention mechanism provided by an embodiment of the present invention.
  • the model specifically includes:
  • preprocessing preprocessing CPU utilization and memory utilization
  • Input layer input preprocessed CPU utilization and memory utilization
  • the CNN module mainly includes a one-dimensional convolutional neural network and a pooling layer. Through a one-dimensional convolutional neural network, the features of the data are obtained, and then through the pooling layer, the features obtained after the convolutional layer are integrated into new features;
  • the feature vector (u1, u2,..., un-1, un) is obtained from the output of the CNN module.
  • This module mainly includes the LSTM layer and the biLSTM layer, which predicts the feature vectors (u1, u2,..., un-1, un);
  • Attention Mechanism Module (Attention Layer): In this module, the result output by the LSTM module is used as input; the Permute function is used to exchange the input dimensions; the fully connected neural network is used for connection, and the activation function is the softmax function; Permute is used The function once again swaps the dimensions to obtain the vector (h1, h2,..., hn-1, hn); convert the vector (h1, h2,..., hn-1, hn) The weight coefficients ⁇ 1, ⁇ 2... ⁇ n-1, ⁇ n are multiplied together. The values of the weight coefficients are preset and can also be determined in other ways. This is not limited in the embodiment of the present invention. In the attention mechanism module, an attention mechanism is added based on time steps.
  • Output layer Output the results of the attention mechanism module to obtain the load prediction value.
  • embodiments of the present invention accurately schedule high-load containers while taking into account the operability of the entire system and the processing of container copies, thereby reducing energy consumption.
  • an embodiment of the present invention provides a container scheduling device.
  • the device 400 includes: an acquisition unit 401 and a processing unit 402.
  • the device can execute any method process shown in Figure 2 to Figure 3.
  • the division of modules in the embodiment of this application is schematic and is only a logical function division. There may be other division methods in actual implementation.
  • each functional module in various embodiments of the present application can be integrated into a processor, or can exist physically alone, or two or more modules can be integrated into one module.
  • the above integrated modules can be implemented in the form of hardware or software function modules.
  • the acquisition unit is used to determine the load indicator of the first physical host, and determine the overload of the first physical host according to the load indicator;
  • a processing unit configured to determine X containers to be migrated from all containers included in the first physical host, where The replica is migrated to the second physical host.
  • an embodiment of the present invention provides a computer device.
  • the computer device may be a terminal or a server.
  • the device 500 includes at least one processor 501 and a memory connected to the at least one processor. 502.
  • the embodiment of the present invention does not limit the specific connection medium between the processor 501 and the memory 502.
  • the processor 501 and the memory 502 are connected through a bus as an example.
  • the bus can be divided into address bus, data bus, control bus, etc.
  • the computer device can execute any method process shown in Figure 2 to Figure 3.
  • the memory 502 stores instructions that can be executed by at least one processor 501. By executing the instructions stored in the memory 502, at least one processor 501 can perform the steps included in the method shown in Figure 5.
  • the processor 501 is the control center of the computer equipment, and can use various interfaces and lines to connect various parts of the computer equipment, by running or executing instructions stored in the memory 502 and calling data stored in the memory 502.
  • the processor 501 may include one or more processing units.
  • the processor 501 may integrate an application processor and a modem processor.
  • the application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor
  • the debug processor mainly handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 501.
  • the processor 501 and the memory 502 can be implemented on the same chip, and in some embodiments, they can also be implemented on separate chips.
  • the processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps and logical block diagrams disclosed in the embodiments of the present invention.
  • a general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in conjunction with the embodiments of the present invention can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the memory 502 can be used to store non-volatile software programs, non-volatile computer executable programs and modules.
  • the memory 502 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Memory, Disk , CD, etc.
  • Memory 502 is, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
  • the memory 502 in the embodiment of the present invention can also be a circuit or any other device capable of realizing a storage function, used to store program instructions and/or data.
  • embodiments of the present invention provide a computer-readable storage medium that stores a computer program that can be executed by a computer device.
  • the program is run on the computer device, the computer device is caused to perform the above case activity detection method. step.
  • embodiments of the present invention may be provided as methods, systems, or computer program products.
  • the invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects.
  • the invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
  • These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data transmission device to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions
  • the device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
  • These computer program instructions may also be loaded onto a computer or other programmable data transmission device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device.
  • Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.

Landscapes

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

Abstract

The present application provides a container scheduling method and apparatus. The method comprises: determining a load index of a first physical host, and according to the load index, determining that the first physical host is overloaded; from all containers included in the first physical host, determining a number X of containers to be migrated, X being an integer greater than 0; and migrating at least one container to be migrated among the X containers to be migrated, and a container copy of the at least one container to be migrated to a second physical host. By means of scheduling the container on the overloaded host, and on the basis of a load prediction method, scheduling of a high-load container can be implemented more accurately; in addition, a container copy of the container to be migrated can be migrated, so that energy consumption of the physical machine can be effectively reduced.

Description

一种容器调度方法及装置A container scheduling method and device 技术领域Technical field
本发明实施例涉及计算技术领域,尤其涉及一种容器调度方法及装置。Embodiments of the present invention relate to the field of computing technology, and in particular, to a container scheduling method and device.
背景技术Background technique
容器技术发展至今,已经在大多数企业得到运用,容器技术已经成为了虚拟化领域的重要参与者。Since the development of container technology, it has been used in most enterprises, and container technology has become an important player in the field of virtualization.
技术问题technical problem
但是当云计算服务器上的容器较多时,会产生高能耗问题,如何降低物理机的能耗是一个亟待解决的问题。However, when there are many containers on a cloud computing server, high energy consumption will occur. How to reduce the energy consumption of physical machines is an urgent problem that needs to be solved.
技术解决方案Technical solutions
本发明实施例提供了一种容器调度方法及装置,用于降低物理机的能耗。Embodiments of the present invention provide a container scheduling method and device for reducing energy consumption of physical machines.
第一方面,本发明实施例提供了一种容器调度方法,包括:In a first aspect, embodiments of the present invention provide a container scheduling method, including:
确定第一物理主机的负载指标,根据负载指标确定第一物理主机过载;Determine the load indicator of the first physical host, and determine that the first physical host is overloaded based on the load indicator;
从第一物理主机包括的所有容器中确定X个待迁移容器,X为大于0的整数;Determine X containers to be migrated from all containers included in the first physical host, where X is an integer greater than 0;
将X个待迁移容器中的至少一个待迁移容器以及至少一个待迁移容器的容器副本迁移至第二物理主机。Migrate at least one container to be migrated among the X containers to be migrated and a container copy of the at least one container to be migrated to the second physical host.
上述技术方案中,通过对过载主机上的容器进行调度,能够较为精准的实现高负载容器的调度,同时对待迁移容器的容器副本进行迁移,进一步有效降低物理机的能耗。In the above technical solution, by scheduling containers on overloaded hosts, high-load containers can be scheduled more accurately, and at the same time, container copies of the containers to be migrated can be migrated, further effectively reducing the energy consumption of physical machines.
一种可能的实现方式,第一物理主机的负载指标,包括:One possible implementation method, the load indicators of the first physical host include:
第一物理主机的中央处理器利用率;第一物理主机的内存利用率。CPU utilization of the first physical host; memory utilization of the first physical host.
一种可能的实现方式,确定第一物理主机的负载指标,根据负载指标确定第一物理主机过载,包括:One possible implementation method is to determine the load indicator of the first physical host and determine the overload of the first physical host based on the load indicator, including:
如果第一物理主机的中央处理器利用率大于或等于第一阈值,或第一物理主机的内存利用率大于或等于第二阈值,则确定第一物理主机过载。If the CPU utilization of the first physical host is greater than or equal to the first threshold, or the memory utilization of the first physical host is greater than or equal to the second threshold, the first physical host is determined to be overloaded.
一种可能的实现方式,从第一物理主机包括的所有容器中确定X个待迁移容器,包括:One possible implementation method is to determine X containers to be migrated from all containers included in the first physical host, including:
对于第一物理主机中不存在容器副本的容器,如果容器与第一物理主机的负载相关性小于预设阈值,则将容器确定为待迁移容器;对于第一物理主机中存在容器副本的容器,确定容器为待缩容的容器或待扩容的容器,将容器确定为待迁移容器。For a container that does not have a container copy in the first physical host, if the load correlation between the container and the first physical host is less than the preset threshold, the container is determined to be a container to be migrated; for a container that has a container copy in the first physical host, Determine the container as a container to be reduced or a container to be expanded, and determine the container as a container to be migrated.
一种可能的实现方式,对于待缩容的容器和待扩容的容器,方法还包括:A possible implementation method for containers to be reduced and containers to be expanded also includes:
对于待缩容的容器,确定容器的容器副本缩容后的第一副本数量,将缩容后第一副本数量的容器副本确定为待迁移容器;对于待扩容的容器,确定容器的容器副本扩容后的第二副本数量,将扩容后第二副本数量的容器副本确定为待迁移容器。For the container to be scaled down, determine the first number of copies of the container copy after shrinking, and determine the container copy with the first number of copies after shrinking as the container to be migrated; for the container to be expanded, determine the expansion of the container copy of the container The second number of copies after expansion is determined as the container to be migrated.
通过上述方法,确定与第一物理主机负载相似性小于预设阈值的容器为待迁移容器,减少对物理主机的影响,同时,确定容器和相应的容器副本为待迁移容器,兼顾了系统的可运转性。Through the above method, the container whose load similarity with the first physical host is less than the preset threshold is determined to be the container to be migrated, which reduces the impact on the physical host. At the same time, the container and the corresponding container copy are determined to be the container to be migrated, taking into account the reliability of the system. operability.
一种可能的实现方式,将X个待迁移容器中的至少一个待迁移容器以及至少一个待迁移容器的容器副本迁移至第二物理主机,包括:A possible implementation method of migrating at least one container to be migrated and a container copy of at least one container to be migrated among the X containers to be migrated to a second physical host includes:
对X个待迁移容器,根据每个待迁移容器的负载按照从大到小的顺序,将X个待迁移容器中,负载最大的至少一个待迁移容器以及至少一个待迁移容器的容器副本迁移至第二物理主机。For X containers to be migrated, according to the load of each container to be migrated, in descending order, at least one container to be migrated with the largest load among the Second physical host.
通过上述方法,采用最大容器负载放置策略,从大到小放置待迁移容器,能够尽快降低物理主机的能耗,提升降低能耗的效率。Through the above method, using the maximum container load placement strategy and placing the containers to be migrated from large to small can reduce the energy consumption of the physical host as soon as possible and improve the efficiency of reducing energy consumption.
第二方面,本发明实施例提供了一种容器调度装置,包括:In a second aspect, embodiments of the present invention provide a container scheduling device, including:
获取单元,用于确定第一物理主机的负载指标,根据负载指标确定第一物理主机过载;The acquisition unit is used to determine the load indicator of the first physical host, and determine the overload of the first physical host according to the load indicator;
处理单元,用于从第一物理主机包括的所有容器中确定X个待迁移容器,X为大于0的整数;将X个待迁移容器中的至少一个待迁移容器以及至少一个待迁移容器的容器副本迁移至第二物理主机。A processing unit configured to determine X containers to be migrated from all containers included in the first physical host, where The replica is migrated to the second physical host.
一种可能的实现方式,处理单元具体用于:As a possible implementation, the processing unit is specifically used to:
对于第一物理主机中不存在容器副本的容器,如果容器与第一物理主机的负载相关性小于预设阈值,则将容器确定为待迁移容器;对于第一物理主机中存在容器副本的容器,确定容器为待缩容的容器或待扩容的容器,将容器确定为待迁移容器。For a container that does not have a container copy in the first physical host, if the load correlation between the container and the first physical host is less than the preset threshold, the container is determined to be a container to be migrated; for a container that has a container copy in the first physical host, Determine the container as a container to be reduced or a container to be expanded, and determine the container as a container to be migrated.
一种可能的实现方式,处理单元具体用于:As a possible implementation, the processing unit is specifically used to:
对于待缩容的容器,确定容器的容器副本缩容后的第一副本数量,将缩容后第一副本数量的容器副本确定为待迁移容器;对于待扩容的容器,确定容器的容器副本扩容后的第二副本数量,将扩容后第二副本数量的容器副本确定为待迁移容器。For the container to be scaled down, determine the first number of copies of the container copy after shrinking, and determine the container copy with the first number of copies after shrinking as the container to be migrated; for the container to be expanded, determine the expansion of the container copy of the container The second number of copies after expansion is determined as the container to be migrated.
一种可能的实现方式,处理单元具体用于:As a possible implementation, the processing unit is specifically used to:
对X个待迁移容器,根据每个待迁移容器的负载按照从大到小的顺序,将X个待迁移容器中,负载最大的至少一个待迁移容器以及至少一个待迁移容器的容器副本迁移至第二物理主机。For X containers to be migrated, according to the load of each container to be migrated, in descending order, at least one container to be migrated with the largest load among the Second physical host.
第三方面,本发明实施例提供了一种计算机可读非易失性存储介质,包括计算机可读指令,当计算机读取并执行计算机可读指令时,使得计算机执行上述容器调度方法。In a third aspect, embodiments of the present invention provide a computer-readable non-volatile storage medium that includes computer-readable instructions. When the computer reads and executes the computer-readable instructions, it causes the computer to execute the above container scheduling method.
第四方面,本发明实施例提供了一种计算机可读存储介质,存储介质存储有计算机指令,计算机指令被处理器运行时,执行上述第一方面提供的方法。In a fourth aspect, embodiments of the present invention provide a computer-readable storage medium. The storage medium stores computer instructions. When the computer instructions are run by a processor, the method provided in the first aspect is executed.
第五方面,本发明实施例还提供一种计算机程序产品,包含有计算机可执行指令,计算机可执行指令用于使计算机执行如第一方面提供的方法。In a fifth aspect, embodiments of the present invention further provide a computer program product, which includes computer-executable instructions. The computer-executable instructions are used to cause a computer to execute the method provided in the first aspect.
通过本发明实施例的上述一个或多个实施例中的技术方案,本发明实施例至少具有如下技术效果:Through the technical solutions in the above one or more embodiments of the embodiments of the present invention, the embodiments of the present invention at least have the following technical effects:
在本发明提供的实施例中,对容器及物理主机进行负载预测,能够精准实现高负载容器的调度。此外,本发明实施例兼顾整个系统的可运转性,同时本发明实施例综合最大容器负载策略,使本发明实施例能够尽快实现能耗优化。In the embodiments provided by the present invention, load prediction is performed on containers and physical hosts to accurately realize the scheduling of high-load containers. In addition, the embodiments of the present invention take into account the operability of the entire system, and at the same time, the embodiments of the present invention integrate the maximum container load strategy, so that the embodiments of the present invention can realize energy consumption optimization as soon as possible.
附图说明Description of drawings
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings needed to describe the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. Those of ordinary skill in the art can also obtain other drawings based on these drawings without exerting any creative effort.
图1为本发明实施例提供的一种网络架构示意图;Figure 1 is a schematic diagram of a network architecture provided by an embodiment of the present invention;
图2为本发明实施例提供的一种容器调度方法的流程示意图;Figure 2 is a schematic flowchart of a container scheduling method provided by an embodiment of the present invention;
图3为本发明实施例提供的一种负载预测方法的模型示意图;Figure 3 is a schematic model diagram of a load prediction method provided by an embodiment of the present invention;
图4为本发明实施例提供的一种容器调度装置的结构示意图;Figure 4 is a schematic structural diagram of a container scheduling device provided by an embodiment of the present invention;
图5为本发明实施例提供的一种计算机设备的结构示意图。Figure 5 is a schematic structural diagram of a computer device provided by an embodiment of the present invention.
本发明的实施方式Embodiments of the invention
为了使本发明的目的、技术方案及有益效果更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。In order to make the purpose, technical solutions and beneficial effects of the present invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described here are only used to explain the present invention and are not intended to limit the present invention.
容器技术,又称容器虚拟化技术或容器技术虚拟化技术,是一种提升资源使用的虚拟技术,能够提升工作效率。相比传统的虚拟化技术,容器技术可以随处部署、灵活迁移,提高开发效率和减少部署的工作量。容器技术发展至今,已经在大多数企业得到运用,容器技术已经成为了虚拟化领域的重要参与者。Container technology, also known as container virtualization technology or container technology virtualization technology, is a virtual technology that improves resource usage and can improve work efficiency. Compared with traditional virtualization technology, container technology can be deployed anywhere and flexibly migrated, improving development efficiency and reducing deployment workload. Since the development of container technology, it has been used in most enterprises, and container technology has become an important player in the field of virtualization.
容器技术的快速发展,使得云计算的规模不断扩大,能耗高的问题也日益凸显。当云计 算服务器上的容器较多时,会产生高能耗问题,此时需要进行能耗优化。为此,本发明实施例提出了一种容器调度方法及装置,能够实现对高负载容器的精准调度,同时兼顾整个系统的可运转性和容器副本处理,降低能耗。The rapid development of container technology has caused the scale of cloud computing to continue to expand, and the problem of high energy consumption has become increasingly prominent. When there are many containers on a cloud computing server, high energy consumption will occur, and energy consumption optimization needs to be performed. To this end, embodiments of the present invention propose a container scheduling method and device, which can achieve accurate scheduling of high-load containers, while taking into account the operability of the entire system and container copy processing, and reducing energy consumption.
如图1所示,在容器云环境下,存在多个物理主机,一个物理主机上放置有多个容器和容器副本。一个容器为一个应用程序(Application,APP)提供服务,例如提供存储和计算资源,当一个APP需要的资源量较大时,还可以将一个APP配置一个容器对应的多个容器副本。As shown in Figure 1, in a container cloud environment, there are multiple physical hosts, and multiple containers and container copies are placed on one physical host. A container provides services for an application (Application, APP), such as storage and computing resources. When an APP requires a large amount of resources, an APP can also be configured with multiple container copies corresponding to a container.
图2为本发明实施例提供的一种容器调度方法的流程,该流程可以由容器调度装置执行。Figure 2 is a flowchart of a container scheduling method provided by an embodiment of the present invention. This flowchart can be executed by a container scheduling device.
如图2所示,该流程具体包括:As shown in Figure 2, the process specifically includes:
步骤201,确定第一物理主机的负载指标,根据负载指标确定第一物理主机过载。Step 201: Determine the load index of the first physical host, and determine that the first physical host is overloaded based on the load index.
本发明实施例中,第一物理主机的负载指标可以包括但不限于:中央处理器(Central Processing Unit,CPU)利用率;内存利用率。具体如何确定第一物理主机的负载指标,本发明实施例并不限定,例如,可以在物理主机上安装检测系统,检测主要指标为:CPU利用率、内存利用率、磁盘利用率、网络流入量、网络流出量等。In this embodiment of the present invention, the load indicators of the first physical host may include but are not limited to: central processing unit (Central Processing Unit, CPU) utilization; memory utilization. The specific method of determining the load indicator of the first physical host is not limited by the embodiment of the present invention. For example, a detection system can be installed on the physical host. The main indicators for detection are: CPU utilization, memory utilization, disk utilization, and network inflow. , network outflow, etc.
本发明实施例中,如何根据负载指标确定第一物理主机过载,并不限定。In the embodiment of the present invention, there is no limitation on how to determine the overload of the first physical host based on the load indicator.
一种实现方式中,如果观测的第一物理主机CPU利用率大于或等于第一阈值,和/或观测的第一物理主机内存利用率大于或等于第二阈值,则确定第一物理主机过载。In one implementation, if the observed CPU utilization of the first physical host is greater than or equal to the first threshold, and/or the observed memory utilization of the first physical host is greater than or equal to the second threshold, it is determined that the first physical host is overloaded.
一种实现方式中,采用基于带注意力机制的负载预测方法预测第一物理主机的CPU利用率和第一物理主机的内存利用率。如果预测的第一物理主机CPU利用率大于或等于第一阈值,和/或预测的第一物理主机内存利用率大于或等于第二阈值,则确定第一物理主机过载。其中,可以设定第一阈值和第二阈值,例如设定第一阈值和第二阈值均为0.7。In one implementation, a load prediction method based on an attention mechanism is used to predict the CPU utilization of the first physical host and the memory utilization of the first physical host. If the predicted CPU utilization of the first physical host is greater than or equal to the first threshold, and/or the predicted memory utilization of the first physical host is greater than or equal to the second threshold, the first physical host is determined to be overloaded. Wherein, the first threshold and the second threshold can be set, for example, the first threshold and the second threshold are both set to 0.7.
步骤202,从第一物理主机包括的所有容器中确定X个待迁移容器,X为大于0的整数。Step 202: Determine X containers to be migrated from all containers included in the first physical host, where X is an integer greater than 0.
对于一个容器,如何确定该容器为待迁移容器,可能存在多种实现方式。For a container, there may be multiple ways to determine how to determine that the container is a container to be migrated.
一种实现方式中,对于第一物理主机中不存在容器副本的容器,如果该容器与第一物理主机的负载相关性小于预设阈值,则将容器确定为待迁移容器。In one implementation, for a container that does not have a container copy in the first physical host, if the load correlation between the container and the first physical host is less than a preset threshold, the container is determined to be a container to be migrated.
其中,在选择不存在容器副本的容器为待迁移容器时,优先选择与第一物理主机负载相关性小于预设阈值的容器为待迁移容器,容器上需要实时检测容器CPU利用率、内存利用率、磁盘利用率等数据,负载相关性的计算公式可以表示如下:Among them, when selecting a container that does not have a container copy as the container to be migrated, the container whose load correlation with the first physical host is less than the preset threshold is given priority as the container to be migrated. The container CPU utilization and memory utilization need to be detected in real time on the container. , disk utilization and other data, the calculation formula of load correlation can be expressed as follows:
Figure PCTCN2022141481-appb-000001
Figure PCTCN2022141481-appb-000001
Figure PCTCN2022141481-appb-000002
Figure PCTCN2022141481-appb-000002
Figure PCTCN2022141481-appb-000003
Figure PCTCN2022141481-appb-000003
公式(1)用于计算容器与物理主机之间的CPU负载相关性
Figure PCTCN2022141481-appb-000004
公式(2)用于计算容器与物理主机的内存负载相关性
Figure PCTCN2022141481-appb-000005
mem表示内存,公式(3)用于计算容器与物理主机的总负载相关性Cor(c a,pm a)。在公式(1)中,
Figure PCTCN2022141481-appb-000006
表示容器c a的CPU利用率历史记录,
Figure PCTCN2022141481-appb-000007
表示容器c a的CPU利用率平均值,
Figure PCTCN2022141481-appb-000008
表示物理主机pm a的CPU利用率历史记录,
Figure PCTCN2022141481-appb-000009
表示物理主机pm a的CPU利用率平均值。在公式(2)中,
Figure PCTCN2022141481-appb-000010
表示容器c a的内存利用率历史记录,
Figure PCTCN2022141481-appb-000011
表示容器c a的内存利用率平均值,
Figure PCTCN2022141481-appb-000012
表示物理主机pm a的内存利用率历史记录,
Figure PCTCN2022141481-appb-000013
表示物理主机pm a的内存利用率平均值。容器与物理主机的总负载相关性Cor(c a,pm a)大小位于0到2之间。本发明实施例中,可以设定预设阈值,例如设定预设阈值为0.55,当容器与物理机总的负载相关性小于预设阈值时,可以认为容器与第一物理主机负载相关性小,该容器可以被确定为待迁移容器。
Formula (1) is used to calculate the CPU load correlation between the container and the physical host
Figure PCTCN2022141481-appb-000004
Formula (2) is used to calculate the memory load correlation between the container and the physical host.
Figure PCTCN2022141481-appb-000005
mem represents memory, and formula (3) is used to calculate the total load correlation Cor(c a , pm a ) between the container and the physical host. In formula (1),
Figure PCTCN2022141481-appb-000006
Represents the CPU utilization history of container c a ,
Figure PCTCN2022141481-appb-000007
Represents the average CPU utilization of container c a ,
Figure PCTCN2022141481-appb-000008
Represents the CPU utilization history of physical host pm a ,
Figure PCTCN2022141481-appb-000009
Indicates the average CPU utilization of the physical host pm a . In formula (2),
Figure PCTCN2022141481-appb-000010
Represents the memory utilization history of container c a ,
Figure PCTCN2022141481-appb-000011
Represents the average memory utilization of container c a ,
Figure PCTCN2022141481-appb-000012
Represents the memory utilization history of physical host pm a ,
Figure PCTCN2022141481-appb-000013
Indicates the average memory utilization of the physical host pm a . The total load correlation Cor(c a , pm a ) size of the container with the physical host lies between 0 and 2. In the embodiment of the present invention, a preset threshold can be set, for example, the preset threshold is set to 0.55. When the total load correlation between the container and the physical machine is less than the preset threshold, it can be considered that the load correlation between the container and the first physical host is small. , the container can be determined as the container to be migrated.
另一种实现方式中,对于第一物理主机中存在容器副本的容器,确定待缩容容器和待扩容容器,将待缩容容器和待扩容容器确定为待迁移容器。In another implementation, for a container with a container copy in the first physical host, a container to be reduced and a container to be expanded are determined, and the container to be reduced and the container to be expanded are determined to be containers to be migrated.
在确定待缩容容器和待扩容容器为待迁移容器时,可以根据容器的CPU利用率、内存利用率预测值与当前CPU利用率、内存利用率进行比较确定一个容器是待缩容容器还是待扩容容器。When determining whether a container to be reduced or a container to be expanded is a container to be migrated, a container can be determined to be a container to be reduced or a container to be migrated based on the comparison between the predicted CPU utilization and memory utilization of the container and the current CPU utilization and memory utilization. Expand the container.
对第一物理主机上的容器进行负载预测,例如采用基于带注意力机制的负载预测模型进行负载预测,获取每个容器的两个负载指标预测值,两个负载指标为容器的CPU利用率和内存利用率。当预测的容器的CPU利用率大于该容器当前的CPU利用率,预测的容器的内存利用率预测值大于该容器当前的内存利用率时,即当容器的CPU利用率预测值
Figure PCTCN2022141481-appb-000014
大于CPU利用率当前值
Figure PCTCN2022141481-appb-000015
且内存利用率预测值
Figure PCTCN2022141481-appb-000016
大于内存利用率当前值
Figure PCTCN2022141481-appb-000017
时,这个容器可以确定为待扩容容器。
Perform load prediction on the containers on the first physical host, for example, use a load prediction model based on the attention mechanism to perform load prediction, and obtain two load indicator prediction values for each container. The two load indicators are the CPU utilization of the container and Memory utilization. When the predicted CPU utilization of the container is greater than the current CPU utilization of the container, and the predicted memory utilization value of the predicted container is greater than the current memory utilization of the container, that is, when the predicted CPU utilization value of the container
Figure PCTCN2022141481-appb-000014
Greater than the current value of CPU utilization
Figure PCTCN2022141481-appb-000015
And the predicted value of memory utilization
Figure PCTCN2022141481-appb-000016
Greater than the current value of memory utilization
Figure PCTCN2022141481-appb-000017
, this container can be determined as a container to be expanded.
当预测的容器的CPU利用率小于该容器当前的CPU利用率,预测的容器的内存利用率预测值小于该容器当前的内存利用率时,即当容器的CPU利用率预测值
Figure PCTCN2022141481-appb-000018
小于CPU利用率当前值
Figure PCTCN2022141481-appb-000019
且内存利用率预测值
Figure PCTCN2022141481-appb-000020
小于内存利用率当前值
Figure PCTCN2022141481-appb-000021
时,这个容器可以确定为待缩容容器。
When the predicted CPU utilization of the container is less than the current CPU utilization of the container, and the predicted memory utilization value of the predicted container is less than the current memory utilization of the container, that is, when the predicted CPU utilization value of the container
Figure PCTCN2022141481-appb-000018
Less than the current value of CPU utilization
Figure PCTCN2022141481-appb-000019
And the predicted value of memory utilization
Figure PCTCN2022141481-appb-000020
Less than the current value of memory utilization
Figure PCTCN2022141481-appb-000021
, this container can be determined as a container to be reduced.
本发明实施例中,对于待扩容容器和待缩容容器,都可以作为待迁移容器。In this embodiment of the present invention, both the containers to be expanded and the containers to be reduced can be used as containers to be migrated.
对于待缩容的容器,确定容器的容器副本缩容后的第一副本数量,将缩容后第一副本数量的容器副本确定为待迁移容器。For the container to be scaled down, the first number of replicas of the container's container replicas after scaling down is determined, and the first number of replicas of the container after scaling down are determined as the containers to be migrated.
其中,在对待缩容容器的副本数量进行缩容时,第一副本数量与缩容预期副本数相关,第一副本数量为缩容预期副本数向下取整,缩容预期副本数的计算公式可以如公式(4)、公式(5)、公式(6)所示。Among them, when shrinking the number of copies of the container to be reduced, the first copy number is related to the expected number of copies for shrinking. The first copy number is the expected number of copies for shrinking, rounded down. The calculation formula for the expected number of copies for shrinking is It can be shown as formula (4), formula (5), and formula (6).
Figure PCTCN2022141481-appb-000022
Figure PCTCN2022141481-appb-000022
Figure PCTCN2022141481-appb-000023
Figure PCTCN2022141481-appb-000023
Figure PCTCN2022141481-appb-000024
Figure PCTCN2022141481-appb-000024
其中,cpu表示中央处理器,mem表示内存,在公式(4)中,
Figure PCTCN2022141481-appb-000025
表示由CPU利用率计算出的缩容预期副本数,n cd指现有副本数,
Figure PCTCN2022141481-appb-000026
指容器副本的CPU利用率现有值,
Figure PCTCN2022141481-appb-000027
指容器副本的CPU利用率预测值。在公式(5)中,
Figure PCTCN2022141481-appb-000028
表示由内存利用率计算出的缩容预期副本数,n cd指现有副本数,
Figure PCTCN2022141481-appb-000029
指容器副本的内存利用率现有值,
Figure PCTCN2022141481-appb-000030
指容器副本的内存利用率预测值。由公式(6)计算得到缩容预期副本数
Figure PCTCN2022141481-appb-000031
缩容预期副本数
Figure PCTCN2022141481-appb-000032
Figure PCTCN2022141481-appb-000033
Figure PCTCN2022141481-appb-000034
之间的小值。
Among them, cpu represents the central processing unit and mem represents memory. In formula (4),
Figure PCTCN2022141481-appb-000025
Indicates the expected number of copies for scaling down calculated from CPU utilization, n cd refers to the number of existing copies,
Figure PCTCN2022141481-appb-000026
Refers to the current value of CPU utilization of the container copy,
Figure PCTCN2022141481-appb-000027
Refers to the predicted CPU utilization value of the container copy. In formula (5),
Figure PCTCN2022141481-appb-000028
Indicates the expected number of copies for shrinking calculated from memory utilization, n cd refers to the number of existing copies,
Figure PCTCN2022141481-appb-000029
Refers to the current value of memory utilization of the container copy,
Figure PCTCN2022141481-appb-000030
Refers to the predicted memory utilization value of the container copy. The expected number of replicas for scaling is calculated by formula (6)
Figure PCTCN2022141481-appb-000031
Expected number of replicas for scaling down
Figure PCTCN2022141481-appb-000032
Pick
Figure PCTCN2022141481-appb-000033
and
Figure PCTCN2022141481-appb-000034
small value in between.
对于待扩容的容器,确定容器的容器副本扩容后的第二副本数量,将扩容后第二副本数量的容器副本确定为待迁移容器。For the container to be expanded, determine the second number of copies of the container's container copy after expansion, and determine the second number of container copies after expansion as the container to be migrated.
在对需要扩容的容器副本执行扩容时,第二副本数量与扩容预期副本数相关,第二副本数量为扩容预期副本数向上取整,扩容预期副本数计算公式可以如公式(7)、公式(8)、公式(9)所示。When performing expansion on a container copy that needs to be expanded, the second copy number is related to the expected number of copies for expansion. The second copy number is the expected number of copies for expansion, rounded up. The calculation formula for the expected number of copies for expansion can be as follows: formula (7), formula ( 8), as shown in formula (9).
Figure PCTCN2022141481-appb-000035
Figure PCTCN2022141481-appb-000035
Figure PCTCN2022141481-appb-000036
Figure PCTCN2022141481-appb-000036
Figure PCTCN2022141481-appb-000037
Figure PCTCN2022141481-appb-000037
其中,cpu表示中央处理器,mem表示内存,在公式(7)中,
Figure PCTCN2022141481-appb-000038
表示由CPU利用率计算出的扩容预期副本数,
Figure PCTCN2022141481-appb-000039
指容器副本的CPU利用率预测值,n cd指现有副本数,
Figure PCTCN2022141481-appb-000040
指容器副本的CPU利用率现有值。在公式(8)中,
Figure PCTCN2022141481-appb-000041
表示由内存利用率计算出的扩容预期副本数,
Figure PCTCN2022141481-appb-000042
指容器副本的内存利用率预测值,n cd指现有副本数,
Figure PCTCN2022141481-appb-000043
指容器副本的内存利用率现有值。由公式(9)计算得到扩容预期副本数
Figure PCTCN2022141481-appb-000044
扩容预期副本数
Figure PCTCN2022141481-appb-000045
Figure PCTCN2022141481-appb-000046
Figure PCTCN2022141481-appb-000047
之间的大值。
Among them, cpu represents the central processing unit and mem represents the memory. In formula (7),
Figure PCTCN2022141481-appb-000038
Represents the expected number of copies for expansion calculated from CPU utilization,
Figure PCTCN2022141481-appb-000039
refers to the predicted CPU utilization value of the container copy, n cd refers to the number of existing copies,
Figure PCTCN2022141481-appb-000040
Refers to the current value of the CPU utilization of the container replica. In formula (8),
Figure PCTCN2022141481-appb-000041
Represents the expected number of copies for expansion calculated from memory utilization,
Figure PCTCN2022141481-appb-000042
refers to the predicted memory utilization value of the container copy, n cd refers to the number of existing copies,
Figure PCTCN2022141481-appb-000043
Refers to the current value of the memory utilization of the container replica. The expected number of replicas for expansion is calculated by formula (9)
Figure PCTCN2022141481-appb-000044
Expected number of replicas for expansion
Figure PCTCN2022141481-appb-000045
Pick
Figure PCTCN2022141481-appb-000046
and
Figure PCTCN2022141481-appb-000047
the maximum value between.
步骤203,将X个待迁移容器中的至少一个待迁移容器以及至少一个待迁移容器的容器副本迁移至第二物理主机。Step 203: Migrate at least one container to be migrated and a container copy of at least one container to be migrated among the X containers to be migrated to the second physical host.
具体的,对X个待迁移容器,采用最大容器负载放置策略,根据每个待迁移容器的负载按照从大到小的顺序,将X个待迁移容器中负载最大的至少一个待迁移容器以及至少一个待迁移容器的容器副本迁移至第二物理主机。重复执行选择待迁移容器和放置容器,直至第一物理主机不再过载。Specifically, for the X containers to be migrated, the maximum container load placement strategy is adopted. According to the load of each container to be migrated in descending order, at least one container to be migrated with the largest load among the X containers to be migrated and at least A container copy of the container to be migrated is migrated to the second physical host. Repeat selecting the container to be migrated and placing the container until the first physical host is no longer overloaded.
通过实施上面的方法,通过对容器的有效调度,可以使得过载物理主机不再过载,降低能耗。By implementing the above method and effectively scheduling containers, overloaded physical hosts can no longer be overloaded and energy consumption can be reduced.
本发明实施例还提供了一种容器调度方法,用于进一步降低能耗。Embodiments of the present invention also provide a container scheduling method to further reduce energy consumption.
具体的,从多个物理主机中确定Y个欠载的第三物理主机,Y为大于0的整数;将Y个欠载的第三物理主机上的容器以及容器副本迁移到第四物理主机,第四物理主机为多个物理主机中除了第一物理主机之外的物理主机。Specifically, Y underloaded third physical hosts are determined from multiple physical hosts, Y is an integer greater than 0; containers and container copies on Y underloaded third physical hosts are migrated to the fourth physical host, The fourth physical host is a physical host other than the first physical host among the plurality of physical hosts.
在将Y个欠载的第三物理主机上的容器以及容器副本迁移到第四物理主机时,首先确定第三物理主机为多个物理主机中除了第一物理主机和第二物理主机之外的物理主机,对欠载的第三物理主机采用基于带注意力机制的负载预测方法进行负载预测,将第三物理主机按照负载预测结果从小到大排列,把负载预测结果较小的第三物理主机上的所有容器迁移出,迁移出的容器按照基于容器负载从大到小的放置策略分配到第四物理主机,当欠载的第三物理主机上的容器都分配完后,关闭欠载的第三物理主机。When migrating the containers and container replicas on Y underloaded third physical hosts to the fourth physical host, first determine that the third physical host is one of the multiple physical hosts other than the first physical host and the second physical host. For the physical host, the load prediction method based on the attention mechanism is used to predict the load of the underloaded third physical host. The third physical hosts are arranged in ascending order according to the load prediction results, and the third physical hosts with smaller load prediction results are ranked All containers on the host are migrated out. The migrated containers are allocated to the fourth physical host according to the placement strategy from large to small based on the container load. When the containers on the underloaded third physical host are all allocated, the underloaded third physical host is closed. Three physical hosts.
通过调度欠载的第三物理主机上的容器,可以进一步降低能耗。Energy consumption can be further reduced by scheduling containers on an underloaded third physical host.
上述所有的负载预测都采用基于带注意力机制的负载预测方法。物理主机上另起一个容器部署带注意力机制的预测模型,用于对容器负载和物理主机负载进行预测。All the above load predictions use load prediction methods based on attention mechanisms. Start another container on the physical host and deploy a prediction model with an attention mechanism to predict the container load and physical host load.
图3为本发明实施例提供的一种基于带注意力机制的负载预测方法的模型。Figure 3 is a model based on a load prediction method with an attention mechanism provided by an embodiment of the present invention.
如图3所示,该模型具体包括:As shown in Figure 3, the model specifically includes:
301预处理:对CPU利用率和内存利用率进行预处理;301 preprocessing: preprocessing CPU utilization and memory utilization;
302输入层:输入预处理后的CPU利用率和内存利用率;302 Input layer: input preprocessed CPU utilization and memory utilization;
303卷积神经网络(Convolutional Neural Network,CNN)模块:CNN模块主要包括一维卷积神经网络,一个池化层。通过一维卷积神经网络,获取数据的特征,然后通过池化层,将卷积层后得到的特征整合成新的特征;303 Convolutional Neural Network (CNN) module: The CNN module mainly includes a one-dimensional convolutional neural network and a pooling layer. Through a one-dimensional convolutional neural network, the features of the data are obtained, and then through the pooling layer, the features obtained after the convolutional layer are integrated into new features;
304特征向量:由CNN模块输出得到特征向量(u1,u2,......,un-1,un)。304 Feature vector: The feature vector (u1, u2,..., un-1, un) is obtained from the output of the CNN module.
305长短期记忆网络(Long Short-Term Memory,LSTM)模块:该模块主要包括LSTM层和biLSTM层,对特征向量(u1,u2,......,un-1,un)进行预测;305 Long Short-Term Memory Network (Long Short-Term Memory, LSTM) module: This module mainly includes the LSTM layer and the biLSTM layer, which predicts the feature vectors (u1, u2,..., un-1, un);
306注意力机制模块(Attention Layer):在该模块中,由LSTM模块输出的结果当做输入;运用Permute函数将输入的维度进行调换;利用全连接神经网络进行连接,激活函数为softmax函数;运用Permute函数再一次将维度进行调换,得到向量(h1,h2,......,hn-1,hn);将向量(h1,h2,......,hn-1,hn)的权重系数ω1、ω2......ωn-1、ωn进行相乘,权重系数的取值是预设的,也可以通过其他方式确定,本发明实施例对此并不限定。在注意力机制模块,基于时间步长添加注意力机制。306 Attention Mechanism Module (Attention Layer): In this module, the result output by the LSTM module is used as input; the Permute function is used to exchange the input dimensions; the fully connected neural network is used for connection, and the activation function is the softmax function; Permute is used The function once again swaps the dimensions to obtain the vector (h1, h2,..., hn-1, hn); convert the vector (h1, h2,..., hn-1, hn) The weight coefficients ω1, ω2...ωn-1, ωn are multiplied together. The values of the weight coefficients are preset and can also be determined in other ways. This is not limited in the embodiment of the present invention. In the attention mechanism module, an attention mechanism is added based on time steps.
307输出层:将注意力机制模块的结果进行输出,得到负载预测值。307 Output layer: Output the results of the attention mechanism module to obtain the load prediction value.
相对于现有的能耗优化方案,本发明实施例对高负载容器进行精准调度的同时,兼顾整个系统的可运转性和容器副本的处理,降低能耗。Compared with existing energy consumption optimization solutions, embodiments of the present invention accurately schedule high-load containers while taking into account the operability of the entire system and the processing of container copies, thereby reducing energy consumption.
本文中描述的各个实施例可以为独立的方案,也可以根据内在逻辑进行组合,这些方案都落入本申请的保护范围中。Each embodiment described in this article can be an independent solution or can be combined according to the internal logic. These solutions all fall within the protection scope of this application.
基于相同的技术构思,本发明实施例提供了一种容器调度装置,如图4所示,该装置400包括:获取单元401和处理单元402。该装置可以执行图2至图3任一方法流程,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。另外,在本申请各个实施例中的各功能模块可以集成在一个处理器中,也可以是单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。Based on the same technical concept, an embodiment of the present invention provides a container scheduling device. As shown in Figure 4, the device 400 includes: an acquisition unit 401 and a processing unit 402. The device can execute any method process shown in Figure 2 to Figure 3. The division of modules in the embodiment of this application is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in various embodiments of the present application can be integrated into a processor, or can exist physically alone, or two or more modules can be integrated into one module. The above integrated modules can be implemented in the form of hardware or software function modules.
获取单元,用于确定第一物理主机的负载指标,根据负载指标确定第一物理主机过载;The acquisition unit is used to determine the load indicator of the first physical host, and determine the overload of the first physical host according to the load indicator;
处理单元,用于从第一物理主机包括的所有容器中确定X个待迁移容器,X为大于0的整数;将X个待迁移容器中的至少一个待迁移容器以及至少一个待迁移容器的容器副本迁移至第二物理主机。A processing unit configured to determine X containers to be migrated from all containers included in the first physical host, where The replica is migrated to the second physical host.
基于相同的技术构思,本发明实施例提供了一种计算机设备,计算机设备可以是终端或服务器,如图5所示,该设备500包括至少一个处理器501,以及与至少一个处理器连接的存储器502,本发明实施例中不限定处理器501与存储器502之间的具体连接介质,图5中处理器501和存储器502之间通过总线连接为例。总线可以分为地址总线、数据总线、控制总线等。该计算机设备可以执行图2至图3任一方法流程。Based on the same technical concept, an embodiment of the present invention provides a computer device. The computer device may be a terminal or a server. As shown in Figure 5, the device 500 includes at least one processor 501 and a memory connected to the at least one processor. 502. The embodiment of the present invention does not limit the specific connection medium between the processor 501 and the memory 502. In Figure 5, the processor 501 and the memory 502 are connected through a bus as an example. The bus can be divided into address bus, data bus, control bus, etc. The computer device can execute any method process shown in Figure 2 to Figure 3.
在本发明实施例中,存储器502存储有可被至少一个处理器501执行的指令,至少一个处理器501通过执行存储器502存储的指令,可以执行上述图5所示的方法中所包括的步骤。In this embodiment of the present invention, the memory 502 stores instructions that can be executed by at least one processor 501. By executing the instructions stored in the memory 502, at least one processor 501 can perform the steps included in the method shown in Figure 5.
其中,处理器501是计算机设备的控制中心,可以利用各种接口和线路连接计算机设备的各个部分,通过运行或执行存储在存储器502内的指令以及调用存储在存储器502内的数据。可选的,处理器501可包括一个或多个处理单元,处理器501可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器501中。在一些实施例中,处理器501和存储器502可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。Among them, the processor 501 is the control center of the computer equipment, and can use various interfaces and lines to connect various parts of the computer equipment, by running or executing instructions stored in the memory 502 and calling data stored in the memory 502. Optionally, the processor 501 may include one or more processing units. The processor 501 may integrate an application processor and a modem processor. The application processor mainly processes the operating system, user interface, application programs, etc., and the modem processor The debug processor mainly handles wireless communications. It can be understood that the above modem processor may not be integrated into the processor 501. In some embodiments, the processor 501 and the memory 502 can be implemented on the same chip, and in some embodiments, they can also be implemented on separate chips.
处理器501可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。The processor 501 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps and logical block diagrams disclosed in the embodiments of the present invention. A general-purpose processor may be a microprocessor or any conventional processor, etc. The steps of the methods disclosed in conjunction with the embodiments of the present invention can be directly implemented by a hardware processor, or executed by a combination of hardware and software modules in the processor.
存储器502作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器502可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、 带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等。存储器502是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器502还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。As a non-volatile computer-readable storage medium, the memory 502 can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 502 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Memory, Disk , CD, etc. Memory 502 is, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory 502 in the embodiment of the present invention can also be a circuit or any other device capable of realizing a storage function, used to store program instructions and/or data.
基于同一发明构思,本发明实施例提供了一种计算机可读存储介质,其存储有可由计算机设备执行的计算机程序,当程序在计算机设备上运行时,使得计算机设备执行上述案例活跃度检测方法的步骤。Based on the same inventive concept, embodiments of the present invention provide a computer-readable storage medium that stores a computer program that can be executed by a computer device. When the program is run on the computer device, the computer device is caused to perform the above case activity detection method. step.
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
本发明是参照根据本发明的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据传输设备的处理器以产生一个机器,使得通过计算机或其他可编程数据传输设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the invention. It will be understood that each process and/or block in the flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data transmission device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data transmission device produce a use A device for realizing the functions specified in one process or multiple processes of the flowchart and/or one block or multiple blocks of the block diagram.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据传输设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory that causes a computer or other programmable data transmission device to operate in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction means, the instructions The device implements the functions specified in a process or processes of the flowchart and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据传输设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions may also be loaded onto a computer or other programmable data transmission device, causing a series of operating steps to be performed on the computer or other programmable device to produce computer-implemented processing, thereby executing on the computer or other programmable device. Instructions provide steps for implementing the functions specified in a process or processes of a flowchart diagram and/or a block or blocks of a block diagram.
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the invention. In this way, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and equivalent technologies, the present invention is also intended to include these modifications and variations.

Claims (10)

  1. 一种容器调度方法,其特征在于,包括:A container scheduling method, characterized by including:
    确定第一物理主机的负载指标,根据所述负载指标确定所述第一物理主机过载;Determine a load indicator of the first physical host, and determine that the first physical host is overloaded based on the load indicator;
    从所述第一物理主机包括的所有容器中确定X个待迁移容器,X为大于0的整数;Determine X containers to be migrated from all containers included in the first physical host, where X is an integer greater than 0;
    将所述X个待迁移容器中的至少一个待迁移容器以及所述至少一个待迁移容器的容器副本迁移至第二物理主机。Migrate at least one container to be migrated among the X containers to be migrated and a container copy of the at least one container to be migrated to the second physical host.
  2. 根据权利要求1所述的方法,其特征在于,所述第一物理主机的负载指标,包括:The method according to claim 1, characterized in that the load indicator of the first physical host includes:
    所述第一物理主机的中央处理器利用率;The central processor utilization rate of the first physical host;
    所述第一物理主机的内存利用率。The memory utilization of the first physical host.
  3. 根据权利要求2所述的方法,其特征在于,所述确定第一物理主机的负载指标,根据所述负载指标确定所述第一物理主机过载,包括:The method according to claim 2, characterized in that determining the load indicator of the first physical host and determining that the first physical host is overloaded according to the load indicator includes:
    如果所述第一物理主机的中央处理器利用率大于或等于第一阈值,和/或所述第一物理主机的内存利用率大于或等于第二阈值,则确定所述第一物理主机过载。If the CPU utilization of the first physical host is greater than or equal to the first threshold, and/or the memory utilization of the first physical host is greater than or equal to the second threshold, it is determined that the first physical host is overloaded.
  4. 根据权利要求1所述的方法,其特征在于,确定所述待迁移容器,包括:The method according to claim 1, characterized in that determining the container to be migrated includes:
    对于所述第一物理主机中不存在容器副本的容器,如果所述容器与所述第一物理主机的负载相关性小于预设阈值,则将所述容器确定为所述待迁移容器;For a container that does not have a container copy in the first physical host, if the load correlation between the container and the first physical host is less than a preset threshold, determine the container as the container to be migrated;
    对于所述第一物理主机中存在容器副本的容器,确定所述容器为待缩容的容器或待扩容的容器,将所述容器确定为所述待迁移容器。For a container with a container copy in the first physical host, the container is determined to be a container to be reduced or a container to be expanded, and the container is determined to be the container to be migrated.
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method of claim 4, further comprising:
    对于所述待缩容的容器,确定所述容器的容器副本缩容后的第一副本数量,将缩容后所述第一副本数量的容器副本确定为所述待迁移容器;For the container to be scaled down, determine the first number of replicas of the container's container replicas after scaling down, and determine the first number of replicas of the container after scaling down as the container to be migrated;
    对于所述待扩容的容器,确定所述容器的容器副本扩容后的第二副本数量,将扩容后所述第二副本数量的容器副本确定为所述待迁移容器。For the container to be expanded, a second number of expanded copies of a container copy of the container is determined, and the expanded container copies of the second number of copies are determined as the container to be migrated.
  6. 根据权利要求1所述的方法,其特征在于,所述将所述X个待迁移容器中的至少一个待迁移容器以及所述至少一个待迁移容器的容器副本迁移至第二物理主机,包括:The method of claim 1, wherein migrating at least one container to be migrated among the X containers to be migrated and a container copy of the at least one container to be migrated to the second physical host includes:
    对所述X个待迁移容器,根据每个待迁移容器的负载按照从大到小的顺序,将所述X个待迁移容器中,所述负载最大的至少一个待迁移容器以及所述至少一个待迁移容器的容器副本迁移至所述第二物理主机。For the X containers to be migrated, according to the load of each container to be migrated, in order from large to small, among the X containers to be migrated, at least one container to be migrated with the largest load and the at least one The container copy of the container to be migrated is migrated to the second physical host.
  7. 一种容器调度装置,其特征在于,包括:A container scheduling device, characterized by including:
    获取单元,用于确定第一物理主机的负载指标,根据所述负载指标确定所述第一物理主机过载;An acquisition unit configured to determine a load indicator of the first physical host, and determine that the first physical host is overloaded based on the load indicator;
    处理单元,用于从所述第一物理主机包括的所有容器中确定X个待迁移容器,X为大于0的整数;将所述X个待迁移容器中的至少一个待迁移容器以及所述至少一个待迁移容器的容器副本迁移至第二物理主机。A processing unit configured to determine X containers to be migrated from all containers included in the first physical host, where A container copy of the container to be migrated is migrated to the second physical host.
  8. 如权利要求7所述的装置,其特征在于,所述处理单元具体用于:The device according to claim 7, wherein the processing unit is specifically configured to:
    对于所述第一物理主机中不存在容器副本的容器,如果所述容器与所述第一物理主机的负载相关性小于预设阈值,则将所述容器确定为所述待迁移容器;For a container that does not have a container copy in the first physical host, if the load correlation between the container and the first physical host is less than a preset threshold, determine the container as the container to be migrated;
    对于所述第一物理主机中存在容器副本的容器,确定所述容器为待缩容的容器或待扩容的容器,将所述容器确定为所述待迁移容器。For a container with a container copy in the first physical host, the container is determined to be a container to be reduced or a container to be expanded, and the container is determined to be the container to be migrated.
  9. 一种计算机设备,包括存储器,处理器及存储在存储器上并可在处理器运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如权利要求1-6中任一项所述的作业调度方法。A computer device, including a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that when the processor executes the computer program, it implements any one of claims 1-6 The job scheduling method.
  10. 一种计算机可读存储介质,其特征在于,所述存储介质存储有计算机指令,所述计算机指令被处理器执行时实现如权利要求1至6中任一项所述的方法。A computer-readable storage medium, characterized in that the storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
PCT/CN2022/141481 2022-07-27 2022-12-23 Container scheduling method and apparatus WO2024021475A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210890099.1A CN115309502A (en) 2022-07-27 2022-07-27 Container scheduling method and device
CN202210890099.1 2022-07-27

Publications (1)

Publication Number Publication Date
WO2024021475A1 true WO2024021475A1 (en) 2024-02-01

Family

ID=83858710

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/141481 WO2024021475A1 (en) 2022-07-27 2022-12-23 Container scheduling method and apparatus

Country Status (2)

Country Link
CN (1) CN115309502A (en)
WO (1) WO2024021475A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115309502A (en) * 2022-07-27 2022-11-08 天翼云科技有限公司 Container scheduling method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120036515A1 (en) * 2010-08-06 2012-02-09 Itamar Heim Mechanism for System-Wide Target Host Optimization in Load Balancing Virtualization Systems
CN107547596A (en) * 2016-06-27 2018-01-05 中兴通讯股份有限公司 A kind of cloud platform control method and device based on Docker
CN110347498A (en) * 2019-06-10 2019-10-18 华南理工大学 A kind of load dynamic migration method under container and virtual machine mixing cloud environment
CN114296867A (en) * 2021-12-17 2022-04-08 山东海量信息技术研究院 Container operation method and system of cloud platform and related device
CN114625474A (en) * 2020-12-08 2022-06-14 中移(苏州)软件技术有限公司 Container migration method and device, electronic equipment and storage medium
CN115309502A (en) * 2022-07-27 2022-11-08 天翼云科技有限公司 Container scheduling method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120036515A1 (en) * 2010-08-06 2012-02-09 Itamar Heim Mechanism for System-Wide Target Host Optimization in Load Balancing Virtualization Systems
CN107547596A (en) * 2016-06-27 2018-01-05 中兴通讯股份有限公司 A kind of cloud platform control method and device based on Docker
CN110347498A (en) * 2019-06-10 2019-10-18 华南理工大学 A kind of load dynamic migration method under container and virtual machine mixing cloud environment
CN114625474A (en) * 2020-12-08 2022-06-14 中移(苏州)软件技术有限公司 Container migration method and device, electronic equipment and storage medium
CN114296867A (en) * 2021-12-17 2022-04-08 山东海量信息技术研究院 Container operation method and system of cloud platform and related device
CN115309502A (en) * 2022-07-27 2022-11-08 天翼云科技有限公司 Container scheduling method and device

Also Published As

Publication number Publication date
CN115309502A (en) 2022-11-08

Similar Documents

Publication Publication Date Title
Sahni et al. A hybrid approach to live migration of virtual machines
US8627143B2 (en) Dynamically modeling and selecting a checkpoint scheme based upon an application workload
US10877766B2 (en) Embedded scheduling of hardware resources for hardware acceleration
WO2018099299A1 (en) Graphic data processing method, device and system
CN104156197B (en) Microprocessor and microprocessor operation method
JP5311234B2 (en) Computer system and its operation method
WO2014029219A1 (en) Method and device for integrating virtualized cluster, and virtualized cluster system
US10176014B2 (en) System and method for multithreaded processing
CN106125888B (en) The efficient power-economizing method of the utilization of resources in cloud data center based on virtual machine (vm) migration
CN104102543A (en) Load regulation method and load regulation device in cloud computing environment
WO2016014182A1 (en) Mid-thread pre-emption with software assisted context switch
CN109144710A (en) Resource regulating method, device and computer readable storage medium
Wang et al. Improving mapreduce performance with partial speculative execution
CN106293881B (en) Performance monitor based on non-uniform I/O access framework and monitoring method thereof
WO2015032201A1 (en) Virtual machine placing method and device
WO2024021475A1 (en) Container scheduling method and apparatus
WO2020248227A1 (en) Load prediction-based hadoop computing task speculative execution method
CN103823706A (en) RTLinux (real-time Linux) based real-time scheduling method for analog simulation of controlled object model
Gottschlag et al. Automatic core specialization for AVX-512 applications
Yang et al. Improving Spark performance with MPTE in heterogeneous environments
US20120054762A1 (en) Scheduling apparatus and method for a multicore device
CN104657198A (en) Memory access optimization method and memory access optimization system for NUMA (Non-Uniform Memory Access) architecture system in virtual machine environment
CN107423114B (en) Virtual machine dynamic migration method based on service classification
Fu et al. Optimizing speculative execution in spark heterogeneous environments
Liu et al. Scheduling parallel jobs using migration and consolidation in the cloud

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: 22952906

Country of ref document: EP

Kind code of ref document: A1