Container scheduling method and device, server and storage medium

By obtaining the number of scheduled containers and disk load on each disk in the target machine, the scheduling strategy of the containers is determined, which solves the problems of unreasonable container scheduling and insufficient utilization of hardware resources in the existing technology for CDN caching services, and achieves reasonable scheduling and improved resource utilization.

CN113867887BActive Publication Date: 2026-02-06CHINANETCENT TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111087118.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-16
Publication Date
2026-02-06
Estimated Expiration
2041-09-16

AI Technical Summary

Technical Problem

In existing technologies, container scheduling only considers factors such as machine CPU and memory, which leads to unreasonable container scheduling and insufficient utilization of hardware resources for CDN caching services.

Method used

By obtaining the number of scheduled containers and disk load on each disk in the target machine, the scheduling strategy for containers can be determined, and containers can be scheduled reasonably to make full use of hardware resources and reduce load pressure.

Benefits of technology

It enables the rational scheduling of containers, makes full use of hardware resources, reduces the load pressure on the target machine, and improves the utilization rate of hardware resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113867887B_ABST
    Figure CN113867887B_ABST
Patent Text Reader

Abstract

The embodiment of the application relates to the technical field of containers, and discloses a container scheduling method and device, a server and a storage medium. The container scheduling method comprises the following steps: receiving a scheduling request for a target container; acquiring the number of scheduling containers of each disk in a target machine corresponding to the target container and the disk load of each disk in the target machine; and determining a scheduling strategy of the target container according to the number of scheduling containers of each disk and the disk load of each disk. Therefore, the application can quickly process and make a container scheduling judgment according to the number of scheduling containers of each disk in the target machine and the load condition of each disk in the target machine, can reasonably schedule the target container, fully utilize the hardware resources of the target machine, and reduce the load pressure of the target machine.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of containers, and in particular to a container scheduling method and device, a server and a storage medium. BACKGROUND

[0002] In recent years, cloud computing technology has developed rapidly, especially virtualization and container technology. Container technology has gradually replaced virtualization as the basis of cloud computing due to its lightweight, fast startup, low resource occupation, high security and other characteristics. Kubernetes is used to manage containerized applications on multiple machines in a cloud platform and is an open-source platform that can realize functions such as automatic deployment, automatic scaling, and maintenance of container clusters. Kubernetes has the advantages of rapid deployment of applications, rapid expansion of applications, seamless integration of new application functions, saving of resources, and optimization of the use of hardware resources. Traditional Kubernetes technology is often used in the scheduling process of stateless computing business containers. The disks in the machines scheduled by such business containers are usually in the form of Redundant Array of Independent Disks (RAID), which treats each disk as a single disk. When scheduling containers, only factors such as CPU, memory, and other factors of the machine are considered.

[0003] However, a Content Delivery Network (CDN) cache type business container is a business container with data caching. The CDN cache type business container has certain requirements for disk size and disk performance. The disks in the machines scheduled by the CDN cache type business container are directly mounted in the form of N bare disks. Due to the difference in the distribution of disks in the machine and the type of business containers, scheduling the CDN cache type business container only by considering factors such as CPU, memory, and other factors of the machine will result in unreasonable scheduling of the CDN cache type business container and insufficient utilization of machine hardware resources. SUMMARY

[0004] The purpose of the embodiments of the present application is to provide a container scheduling method, device, server and storage medium, which can reasonably schedule target containers, fully utilize the hardware resources of target machines, and reduce the load pressure of target machines.

[0005] To solve the above technical problems, in a first aspect, embodiments of the present application provide a container scheduling method, comprising the following steps: receiving a scheduling request for a target container; obtaining the number of scheduled containers of each disk in a target machine corresponding to the target container and the disk load of each disk in the target machine; and determining a scheduling strategy for the target container according to the number of scheduled containers of each disk and the disk load of each disk.

[0006] In a second aspect, the embodiments of the present application also provide a container scheduling apparatus, comprising: a receiving module configured to receive a scheduling request of a target container; an obtaining module configured to obtain a number of scheduling containers of each disk in a target machine corresponding to the target container and a disk load of each disk in the target machine; and a scheduling module configured to determine a scheduling strategy of the target container according to the number of scheduling containers of each disk and the disk load of each disk.

[0007] In a third aspect, the embodiments of the present application also provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the container scheduling method.

[0008] In a fourth aspect, the embodiments of the present application also provide a computer readable storage medium storing a computer program, and the computer program is executed by a processor to implement the container scheduling method.

[0009] In the embodiments of the present application, when a scheduling request of a target container is received, the number of scheduling containers of each disk in a target machine corresponding to the target container and the disk load of each disk in the target machine are obtained, and then the scheduling strategy of the target container is determined according to the number of scheduling containers of each disk and the disk load of each disk. Thus, the present application can make a quick processing and make a container scheduling judgment according to the number of scheduling containers of each disk and the disk load of each disk in the target machine, can reasonably schedule the target container, fully utilize the hardware resources of the target machine, and reduce the load pressure of the target machine. The technical problems of unreasonable container scheduling and insufficient utilization of machine hardware resources caused by only considering the factors such as CPU and memory of a target machine for container scheduling in the prior art are solved. BRIEF DESCRIPTION OF DRAWINGS

[0010] One or more embodiments are illustrated by way of example in the figures that are part of this document, and which illustrate key aspects of the embodiments. It should be noted that these embodiments are only meant to facilitate description of the application.

[0011] Figure 1 is a flowchart of the container scheduling method provided by the embodiments of the present application;

[0012] Figure 1a is a flowchart of step 102 of obtaining the number of scheduling containers of each disk in the container scheduling method provided by the embodiments of the present application;

[0013] Figure 2 is a flowchart of the container scheduling method provided by the embodiments of the present application;

[0014] Figure 3 is a flowchart of the container scheduling method provided by the embodiments of the present application;

[0015] Figure 4 is a flowchart of a container scheduling method provided by an embodiment of the present application;

[0016] Figure 5 is a structural schematic diagram of a container scheduling apparatus provided by an embodiment of the present application;

[0017] Figure 6 is a structural schematic diagram of a server provided by an embodiment of the present application. DETAILED DESCRIPTION

[0018] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the embodiments of the present application will be described in detail below with reference to the drawings. However, those skilled in the art can understand that, in the embodiments of the present application, many technical details are presented in order to make the readers better understand the present application. However, the technical solutions claimed by the present application can be implemented even without these technical details and based on various changes and modifications of the following embodiments. The division of the following embodiments is for the convenience of description, and should not constitute any limitation on the specific implementation of the present application. The embodiments can be combined and referenced with each other on the premise of no contradiction.

[0019] The container scheduling method, apparatus, server and storage medium mentioned in the present application can be operated in two business scenarios. One is a scenario of deploying a container for a brand-new machine. The other is a scenario of an old machine that has already deployed a container and has a certain cache directory. Such a machine needs to be repaired after a failure and then needs to be deployed with a container.

[0020] One embodiment of the present application relates to a container scheduling method, as shown in Figure 1 specifically comprising the following steps.

[0021] Step 101, receiving a scheduling request for a target container.

[0022] Specifically, the received scheduling request for the target container can come from a third-party user or the target container itself. That is, when a third-party user needs to schedule the target container, a scheduling request for the target container can be generated, and the third-party user can also send a scheduling inquiry instruction to the target request before generating the scheduling request for the target container, and when the third-party user receives the scheduling response returned by the target container (indicating that the target container can now be scheduled), the scheduling request for the target container is generated; or the target container itself generates the scheduling request when the target container triggers the scheduling; regardless of who generates the scheduling request for the target container, the information contained in the scheduling request for the target container is consistent, and the scheduling request can contain the identification of the target container, the identification of the target machine, and the related parameters of the target container, etc. The information contained in the scheduling request is not limited here.

[0023] In step 102, the number of scheduling containers of each disk in the target machine corresponding to the target container and the disk load of each disk in the target machine are obtained.

[0024] Specifically, the target container and the target machine correspond to each other, and the correspondence between the target container and the target machine is clear in the received scheduling request for the target container; and a target machine contains multiple disks, and the number of scheduling containers of each disk in the target machine and the disk load of each disk in the target machine are obtained according to the identification of the target machine in the scheduling request, wherein the number of scheduling containers of each disk in the target machine is used to express the maximum deployable number of containers of each disk, and the disk load of each disk in the target machine is used to represent the size of the cache directory of the existing old container of each disk (the old container refers to the container deployed before the failure of the old machine in the second application scenario), and the disk load of each disk in the target machine can be directly obtained by querying the instruction, and the number of scheduling containers of each disk in the target machine is obtained as shown in Figure 1a Specifically, the target machine configuration parameters are obtained, and the number of scheduling containers of each disk in the target machine is obtained according to the target machine configuration parameters.

[0025] In sub-step 1021, the configuration parameters of the target machine are obtained.

[0026] Specifically, the configuration parameters of the target machine can refer to parameters set by the target machine when it is manufactured, or parameters for resetting before using the target machine. The configuration parameters can include machine export bandwidth, single-container bandwidth, machine CPU, single-container CPU, machine memory, single-container memory, disk specification, disk quantity, and mirror storage specification. Among them, the machine export bandwidth refers to the total export bandwidth size of the target machine, the single-container bandwidth refers to the single size allocated to one target container, the machine CPU refers to the total CPU size of the target machine, the single-container CPU refers to the CPU range (including the upper limit CPU size and the lower limit CPU size) that can be allocated to one target container, the machine memory refers to the total memory size of the target machine, the single-container memory refers to the memory range (including the upper limit memory size and the lower limit memory size) that can be allocated to one target container, the disk specification refers to the size specification of each disk in the target container (the size specification of each disk can be consistent or inconsistent), the disk quantity refers to the quantity of disks contained in the target machine, and the mirror storage specification refers to the mirror storage space size of the target machine. Table 1 is an example of the configuration parameters of a certain target machine.

[0027] Table 1 Configuration parameters of a target machine

[0028]

[0029] It should be noted here that the single-disk specification is a 4T disk, and the actual storage size is 3.6T. Since the full state of the disk will affect the IO and container bandwidth, the allocatable storage of the disk needs to be set to (actual storage amount 3.6T x 90% = 3.24T).

[0030] Sub-step 1022: According to the configuration parameters, obtain the number of scheduling containers supported by the bandwidth of each disk in the target machine, the number of scheduling containers supported by the CPU, the number of scheduling containers supported by the memory, the number of single-disk scheduling containers, and the number of concurrent scheduling containers.

[0031] Specifically, the number of scheduling containers supported by each disk bandwidth = machine export bandwidth ÷ single container bandwidth; taking the configuration parameters of the target machine given in Table 1 as an example, the number of scheduling containers supported by each disk bandwidth = 1.5G ÷ 12M = 110, that is, the maximum number of scheduling containers supported by each disk bandwidth is 110. The number of scheduling containers supported by each disk CPU = machine CPU ÷ single container CPU lower limit value; taking the configuration parameters of the target machine given in Table 1 as an example, the number of scheduling containers supported by each disk CPU = 40 ÷ 0.25 = 160, that is, the maximum number of scheduling containers supported by each disk CPU is 160, but since the target machine also needs to spend a part of the CPU in its own operation, therefore, in actual use, the maximum number of scheduling containers supported by each disk CPU also needs to be limited, for example, the number of scheduling containers supported by each disk CPU after limitation is 110. The number of scheduling containers supported by each disk memory = machine memory ÷ single container CPU; taking the configuration parameters of the target machine given in Table 1 as an example, the number of scheduling containers supported by each disk CPU = 80 ÷ 0.5 = 160, that is, the maximum number of scheduling containers supported by each disk memory is 160, but since the target machine also needs to spend a part of the memory in its own operation, therefore, in actual use, the maximum number of scheduling containers supported by each disk memory also needs to be limited, for example, the number of scheduling containers supported by each disk memory after limitation is 110. The number of single-disk scheduling containers of each disk = single-disk actual storage capacity ÷ mirror storage specification x number of disks, taking the configuration parameters of the target machine given in Table 1 as an example, the number of single-disk scheduling containers of each disk = 3.24T ÷ 300G x 11 = 110. The number of concurrent scheduling containers of each disk = preset single-disk concurrent read-write number * number of disks, taking the configuration parameters of the target machine given in Table 1 as an example, the number of concurrent scheduling containers of each disk = 11 * 11 = 121.

[0032] Sub-step 1023, selecting the number of scheduling containers of each disk in the target machine from the number of scheduling containers supported by bandwidth, the number of scheduling containers supported by CPU, the number of scheduling containers supported by memory, the number of single-disk scheduling containers and the number of concurrent scheduling containers according to a preset rule.

[0033] Specifically, as can be seen from step 1022, the number of scheduling containers supported by bandwidth, the number of scheduling containers supported by CPU, the number of scheduling containers supported by memory and the number of single-disk scheduling containers of each disk are all 110, while the number of concurrent scheduling containers of each disk is 121, and the preset rule of the present application is to select the minimum value of the number of scheduling containers as the number of scheduling containers of each disk in the target machine, wherein when the specifications of each disk in the target machine are inconsistent, the number of scheduling containers of each disk may be inconsistent.

[0034] Step 103, determining the scheduling strategy of the target container according to the number of scheduling containers of each disk and the disk load of each disk.

[0035] Specifically, first, it is determined whether the disk loads of the disks are all null values. When the disk loads of the disks are all null values, it is indicated that the target machine is a new machine on which no container is deployed. At this time, only the number of scheduled containers of each disk needs to be considered when the container strategy is determined. When the disk loads of the disks are not null values, first, the disks need to be sorted according to the disk loads (from large to small), and then the scheduling strategy of the target container is determined according to the sorting result of each disk and the number of scheduled containers of each disk.

[0036] In the embodiment of the application, when a scheduling request for a target container is received, the number of scheduled containers of each disk in a target machine corresponding to the target container and the disk load of each disk in the target machine are obtained, and then the scheduling strategy of the target container is determined according to the number of scheduled containers of each disk and the disk load of each disk. Thus, the application can quickly process and make a container scheduling judgment according to the number of scheduled containers of each disk and the disk load of each disk of the target machine, can reasonably schedule the target container, fully utilize the hardware resources of the target machine, and reduce the load pressure of the target machine. The technical problems of unreasonable container scheduling and insufficient utilization of machine hardware resources caused by only considering the CPU, memory and other factors of the target machine for container scheduling in the prior art are solved.

[0037] One embodiment of the application relates to a container scheduling method, as shown in Figure 2 The method specifically comprises the following steps.

[0038] In step 201, a scheduling request for a target container is received.

[0039] Specifically, the step is substantially the same as step 101 of the embodiment of the application, and thus is not described here in detail.

[0040] In step 202, the number of scheduled containers of each disk in a target machine corresponding to the target container and the disk load of each disk in the target machine are obtained.

[0041] Specifically, the step is substantially the same as step 102 of the embodiment of the application, and thus is not described here in detail.

[0042] Specifically, when one of the disk loads of the disks in the target machine is not null, it indicates that the target machine is an old machine, and the disks of the target machine have previously deployed containers and have cache directories created for the containers. The larger the disk load is, the more cache directories of the previously deployed containers are stored on the disk. The disks are arranged in descending order according to the sizes of the disk loads, and the disks with larger disk loads are preferentially scheduled, so that the cache directories of the previously deployed containers stored on the disks are reused, and the utilization of the hardware resources of the target machine is improved. After the sorting result of the disks is obtained, the target container (which can be more than one) is scheduled to the disks. When the target container is scheduled, whether the number of scheduled containers of each disk meets the requirement is also considered. If the requirement is met, the container is scheduled to another disk.

[0043] In step 204, when the disk loads of the disks in the target machine are all null, a scheduling strategy is determined according to the number of scheduled containers of each disk, and a cache directory of the target machine is created on the disk indicated by the scheduling strategy.

[0044] Specifically, when the disk loads of the disks in the target machine are all null, it indicates that the target machine is a new machine, and the disks of the target machine have not previously deployed containers and do not have cache directories created for the containers. At this time, when the target container is scheduled, a scheduling strategy is directly determined according to the number of scheduled containers of each disk (that is, which disk is scheduled to), and after the scheduling strategy is determined, a new cache directory of the target container is created on the disk indicated by the scheduling strategy.

[0045] In addition to the other embodiments, the embodiments of the present application can also sort the disks of the target machine according to the disk loads when the scheduling strategy of the target container is determined, and preferentially schedule the disks with larger disk loads, so that the cache directories on the machine are maximally reused and the new file traffic to the upper layer is prevented from suddenly increasing.

[0046] One embodiment of the present application relates to a container scheduling method, as shown in Figure 3 Specifically, the method comprises the following steps.

[0047] In step 301, a scheduling request for a target container is received.

[0048] Specifically, this step is substantially the same as step 101 of the embodiments of the present application, and is not described here.

[0049] In step 302, the number of scheduled containers of each disk in a target machine corresponding to the target container and the disk load of each disk in the target machine are obtained.

[0050] Specifically, this step is substantially the same as step 102 of the embodiment of the present application, and thus will not be described here.

[0051] In step 303, the scheduling strategy of the target container is determined according to the scheduling container number of each disk and the disk load of each disk.

[0052] Specifically, this step is substantially the same as step 103 of the embodiment of the present application, and thus will not be described here.

[0053] In step 304, it is detected whether the number of disks in the target machine changes.

[0054] Specifically, there are two cases of the change of the number of disks, one is that the disk drop or failure phenomenon occurs in each disk of the target machine, resulting in the decrease of the number of usable disks in the target machine; the other is that a blank disk (which can be a newly added disk in the target machine or a disk recovered from the disk drop phenomenon in the target machine) appears in the target machine, resulting in the increase of the number of usable disks in the target machine. The specific detection method includes: sending a state detection message and / or a disk read-write request to each disk in the target machine, and if no state response and / or read-write success instruction returned by each disk is received within a preset time, then the number of disks changes (i.e., the number of usable disks in the target machine decreases); or when disk information sent by a newly added disk is received, then the number of disks changes (i.e., the number of usable disks in the target machine increases), wherein the state detection message is used to detect whether the disk drop phenomenon occurs in each disk in the target machine, and the disk read-write request is used to detect whether each disk in the target machine supports the read-write function, if the read-write function is supported, it means that the disk can be normally used, if the read-write function is not supported, it means that the disk fails and cannot be normally used.

[0055] In step 305, when the number of disks changes, the existing containers on each disk of the target machine are sorted according to the container cache amount, and the existing containers on each disk are sequentially scheduled according to the sorting result of the existing containers and the preset scheduling rule.

[0056] Specifically, when the disk increases or the disk decreases in the target machine, the re-scheduling of the existing containers on each disk in the target machine is triggered, and in the re-scheduling, the existing containers on each disk of the target machine are first sorted according to the container cache amount, and then the sorting result is used to schedule to each disk in the target machine that can be normally used. In the scheduling process, the container with small container cache amount is preferentially scheduled to the disk with large idle storage space, and the uniform distribution of each disk and the single-disk container number limit of each disk also need to be considered.

[0057] The embodiment of the present application can further detect the state of each disk of the target machine during the operation of the target machine, and dynamically adjust the scheduling strategy of each container in the target machine in real time when the target machine has a disk drop or empty disk phenomenon, so as to avoid quality problems of the container service and effectively guarantee the stability of the container service with data storage state.

[0058] One embodiment of the present application relates to a container scheduling method, as shown in the accompanying drawings, specifically comprising: Figure 3

[0059] Step 401, receiving a scheduling request for a target container.

[0060] Specifically, the present step is substantially the same as step 101 of the embodiment of the present application, which will not be described here.

[0061] Step 402, obtaining the number of scheduled containers of each disk in the target machine corresponding to the target container and the disk load of each disk in the target machine.

[0062] Specifically, the present step is substantially the same as step 102 of the embodiment of the present application, which will not be described here.

[0063] Step 403, determining the scheduling strategy of the target container according to the number of scheduled containers of each disk and the disk load of each disk.

[0064] Specifically, the present step is substantially the same as step 103 of the embodiment of the present application, which will not be described here.

[0065] Step 404, objectifying the machine export bandwidth of the target machine to generate an object value of the machine export bandwidth.

[0066] Specifically, the machine export bandwidth of the target machine actually exists in the form of a network card, and one network card occupies a part of the bandwidth. An object value can be allocated for each network card, or an object value can be allocated for each bandwidth of the machine export bandwidth. Regardless of how the object value is allocated, an object value can be used to represent the change of a certain part of the bandwidth.

[0067] Step 405, when detecting a decrease in the object value, deleting the existing container on the machine export bandwidth corresponding to the object value, and reallocating the bandwidth for the existing container on the machine export bandwidth.

[0068] ​Specifically, when a change in an object value is detected, the existing containers of the bandwidth corresponding to the object value in the target machine are rescheduled (when a container is deployed on each disk of the target machine, the container is allocated a corresponding bandwidth), and when rescheduling, if the object value indicates that the bandwidth is scaled down or artificially reduced, all containers of the bandwidth corresponding to the object value are removed to avoid the phenomenon of empty running of the containers, and whether there is idle bandwidth to be allocated to all containers of the bandwidth corresponding to the object value is checked.

[0069] Step 406, when the object value is detected to increase, the existing containers on the machine export bandwidth corresponding to the object value are sorted according to the cache amount of each container, and the existing containers on the machine export bandwidth are sequentially scheduled according to the sorting result of the existing containers.

[0070] Specifically, if the change in the object value indicates that the bandwidth is restored or artificially scaled up, the existing containers of the bandwidth corresponding to the object value are first sorted according to the cache amount of each container, and then the containers are allocated to the export bandwidth of the target machine according to the sorting result.

[0071] The embodiments of the present application can further detect the machine export bandwidth of the target machine during the operation of the target machine, and when the target machine has a change in the machine export bandwidth, the scheduling strategy of each container in the target machine can be dynamically adjusted in real time to avoid quality problems of the container service and effectively guarantee the stability of the container service in the data storage state, and the utilization rate of the bandwidth of the target machine can be improved.

[0072] The step division of the above methods is only for clear description, and can be combined into one step or split into multiple steps during implementation, as long as the same logical relationship is included, and all are within the protection scope of the present patent; adding irrelevant modifications or introducing irrelevant designs in the algorithm or process, but not changing the core design of the algorithm and process are within the protection scope of the present patent.

[0073] One embodiment of the present application relates to a container scheduling device, and details of the container scheduling device of the present embodiment are specifically described below. The following content is only provided for the implementation details for easy understanding, and is not essential for implementing the present embodiment, Figure 5 is a schematic diagram of the container scheduling device of the present embodiment, which comprises a receiving module 501, an obtaining module 502, and a scheduling module 503.

[0074] The receiving module 501 is configured to receive a scheduling request of a target container.

[0075] The obtaining module 502 is configured to obtain the number of scheduled containers of each disk in a target machine corresponding to the target container and the disk load of each disk in the target machine.

[0076] The scheduling module 503 is configured to determine the scheduling strategy of the target container according to the scheduling container number of each disk and the disk load of each disk.

[0077] It can be found that the embodiment is a system embodiment corresponding to the above-mentioned method embodiment, and the embodiment can be implemented in cooperation with the above-mentioned method embodiment. The related technical details and technical effects mentioned in the above-mentioned embodiments are still valid in the embodiment. In order to reduce repetition, they will not be described here. Accordingly, the related technical details mentioned in the embodiment can also be applied in the above-mentioned embodiments.

[0078] One embodiment of the present application relates to an electronic device, such as Figure 6 As shown in FIG. 6, the electronic device includes at least one processor 601 and a memory 602 connected with the at least one processor 601; the memory 602 stores instructions executable by the at least one processor 601, and the instructions are executed by the at least one processor 601 to enable the at least one processor 601 to perform the container scheduling method in each of the above-mentioned embodiments.

[0079] The memory and the processor are connected in a bus mode, and the bus can include any number of interconnected buses and bridges. The bus connects various circuits of one or more processors and memories together. The bus can also connect various other circuits such as peripheral devices, voltage regulators and power management circuits, which are well known in the art, and thus will not be further described herein. The bus interface provides an interface between the bus and the transceiver. The transceiver can be one element or multiple elements such as multiple receivers and transmitters, which provide a unit for communicating with various other devices on a transmission medium. The data processed by the processor is transmitted on a wireless medium through the antenna, and further, the antenna also receives data and transmits the data to the processor.

[0080] The processor is responsible for managing the bus and general processing, and can also provide various functions including timing, peripheral interface, voltage regulation, power management and other control functions. The memory can be used to store data used by the processor during operation.

[0081] One embodiment of the present application relates to a computer readable storage medium storing a computer program. The computer program is executed by the processor to implement the method embodiments.

[0082] That is, a person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a program stored in a storage medium, including a plurality of instructions for causing a device (which can be a single-chip microcomputer, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of the present application. The aforementioned storage medium includes a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0083] A person of ordinary skill in the art can understand that the above-mentioned embodiments are specific embodiments for implementing the present application, and in actual applications, various changes can be made in form and details without departing from the spirit and scope of the present application.

Claims

1. A container dispatching method characterized by comprising: The method comprises: receiving a scheduling request for a target container; obtaining the number of scheduling containers of each disk in a target machine corresponding to the target container and the disk load of each disk in the target machine; determining a scheduling strategy of the target container according to the number of scheduling containers of each disk and the disk load of each disk; wherein the determination of the scheduling strategy of the target container according to the number of scheduling containers of each disk and the disk load of each disk comprises: when the disk load of each disk in the target machine is not empty, sorting each disk in the target machine according to the disk load of each disk; determining the scheduling strategy of the target container according to the sorting result of each disk and the number of scheduling containers of each disk; the disk load of each disk in the target machine represents the size of the cache directory of the existing old container of each disk; in the sorting result of each disk, the disk with large disk load is preferentially scheduled; wherein the number of scheduling containers of each disk represents the maximum number of deployable containers of each disk; the target container has at least one, and when the scheduling of the target container is performed, if the number of scheduling containers of the current scheduled disk has been satisfied, the scheduling is continued on other disks.

2. The container dispatching method according to claim 1, wherein, the determination of the scheduling strategy of the target container according to the number of scheduling containers of each disk and the disk load of each disk comprises: when the disk load of each disk in the target machine is empty, the scheduling strategy is determined according to the number of scheduling containers of each disk, and the cache directory of the target machine is created on the scheduling disk indicated by the scheduling strategy.

3. The container dispatching method according to claim 1 or 2, characterized by, after the determination of the scheduling strategy of the target container according to the number of scheduling containers of each disk and the disk load of each disk, the method further comprises: detecting whether the number of disks in the target machine changes; when the number of disks changes, sorting the existing containers on each disk of the target machine according to the cache amount of each container, and sequentially scheduling the existing containers on each disk according to the sorting result of the existing containers and a preset scheduling rule.

4. The container dispatching method according to claim 3, wherein, the detection of whether the number of disks in the target machine changes comprises: sending a state detection message or a disk read-write request to each disk in the target machine, and when no state response or read-write success instruction returned by each disk is received within a preset time, the number of disks changes; or when disk information sent by a newly added disk is received, the number of disks changes.

5. The container dispatching method according to claim 3, wherein, the scheduling rule comprises a disk equalization allocation principle and a single-disk container limitation principle.

6. The container dispatching method according to claim 1 or 2, wherein, after the determination of the scheduling strategy of the target container according to the number of scheduling containers of each disk and the disk load of each disk, the method further comprises: objectifying the machine egress bandwidth of the target machine to generate an object value of the machine egress bandwidth; when it is detected that the object value decreases, deleting the existing containers on the machine egress bandwidth corresponding to the object value, and re-allocating bandwidth for the existing containers on the machine egress bandwidth.

7. The container dispatching method according to claim 6, wherein, the method further comprises: When the object value is detected to increase, the existing containers on the machine export bandwidth corresponding to the object value are sorted according to the cache amount of each container, and the existing containers on the machine export bandwidth are sequentially scheduled according to the sorting result of the existing containers.

8. The container dispatching method according to claim 1 or 2, wherein, The obtaining of the scheduling container number of each disk in the target machine corresponding to the target container specifically includes: obtaining configuration parameters of the target machine; obtaining the scheduling container number supported by the bandwidth, the scheduling container number supported by the CPU, the scheduling container number supported by the memory, the single-disk scheduling container number and the concurrent scheduling container number of each disk in the target machine according to the configuration parameters; selecting the scheduling container number of each disk in the target machine from the scheduling container number supported by the bandwidth, the scheduling container number supported by the CPU, the scheduling container number supported by the memory, the single-disk scheduling container number and the concurrent scheduling container number according to a preset rule.

9. The container dispatching method according to claim 8, wherein, The configuration parameters include machine export bandwidth, single-container bandwidth, machine CPU, single-container CPU, machine memory, single-container memory, disk specification, disk quantity and image storage specification; The obtaining of the scheduling container number supported by the bandwidth, the scheduling container number supported by the CPU, the scheduling container number supported by the memory, the single-disk scheduling container number and the concurrent scheduling container number of each disk in the target machine according to the configuration parameters includes: obtaining the scheduling container number supported by the bandwidth according to the machine export bandwidth and the single-container bandwidth; obtaining the scheduling container number supported by the CPU according to the machine CPU and the single-container CPU; obtaining the scheduling container number supported by the memory according to the machine memory and the single-container memory; obtaining the single-disk scheduling container number according to the disk specification, the disk quantity and the image storage specification; obtaining the concurrent scheduling container number according to a preset single-disk concurrent read-write number and the disk quantity.

10. A container dispatching apparatus characterized by comprising: It includes: a receiving module configured to receive a scheduling request of a target container; an obtaining module configured to obtain a scheduling container number of each disk in a target machine corresponding to the target container and a disk load of each disk in the target machine; a scheduling module configured to determine a scheduling strategy of the target container according to the scheduling container number of each disk and the disk load of each disk; wherein the scheduling module is further configured to sort each disk in the target machine according to the disk load of each disk when the disk load of each disk in the target machine is not a null value; and determine the scheduling strategy of the target container according to the sorting result of each disk and the scheduling container number of each disk; the disk load of each disk in the target machine is used to represent the size of the cache directory of the existing old container of each disk; and the disk with a large disk load is preferentially scheduled in the sorting result of each disk; wherein the scheduling container number of each disk is used to express the maximum deployable container number of each disk; the target container is at least one, and the scheduling module is further configured to continue to schedule to other disks when the scheduling container number of the currently scheduled disk has been satisfied.

11. A server, characterized by It includes: at least one processor; and a memory in communication with the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the container scheduling method of any one of claims 1 to 9.

12. A computer readable storage medium storing a computer program, wherein the computer program comprises program instructions configured to cause a processor to perform the method according to any one of claims 1 to 11. the computer program, when executed by a processor, implements the container scheduling method of any one of claims 1 to 9.

Citation Information

Patent Citations

  • Method, equipment and system for virtual machine scheduling

    CN107479950A