Method, device and electronic device for scheduling idle computing power of server

By obtaining and analyzing the usage data of computing power nodes and Pod resources in the server cluster, and expanding or reducing capacity according to preset thresholds, the problem of how to reasonably schedule server computing power resources when they are idle is solved, and the resource utilization rate is improved.

CN114579296BActive Publication Date: 2025-02-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111617734.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-27
Publication Date
2025-02-11
Estimated Expiration
2041-12-27

AI Technical Summary

Technical Problem

The existing technology cannot effectively solve the problem of how to fully and reasonably schedule server computing resources when they are idle, resulting in low resource utilization.

Method used

By obtaining the computing power nodes and Pod resources in the target server cluster, determine the actual usage data of the CPU resource of each computing power node and Pod, judge the usage status of the computing power node based on the preset CPU usage threshold, and perform capacity expansion or reduction operations. Optimize resource utilization.

Benefits of technology

More reasonable resource scheduling is achieved, resource utilization is improved, and the problems of idle and over-utilization of resources are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579296B_ABST
    Figure CN114579296B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device and electronic device for scheduling idle computing power of a server, comprising: obtaining computing power nodes and Pod resources managed in a target server cluster; determining the actual usage data of the CPU resources of each computing power node and the actual usage data of the CPU resources of each Pod in the Pod resources; determining the current usage status of the computing power node according to the actual usage data of the CPU resources of the computing power node and the corresponding preset CPU usage threshold; when the current usage status of any of the computing power nodes is an idle status, expanding the computing power node according to the actual usage data of the CPU resources of each Pod in the Pod resources that is not configured with idle computing power; when the current usage status of any of the computing power nodes is a busy status, shrinking the computing power node according to the actual usage data of the CPU resources of each Pod that has been configured with the computing power node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of server resource scheduling, and in particular to a method, device and electronic equipment for scheduling idle computing power of a server. Background Art

[0002] The native scheduler of Kubernetes is only responsible for selecting a suitable node from the cluster to run for each unscheduled Pod resource based on a series of rules. This default scheduler selects the most suitable node through node preselection Predicate and node priority sorting Priority. The core goal is to fairly distribute each Pod resource on the cluster nodes based on resource availability. The native QoS of Kubernetes only defines different QoS for different Pods based on resource limits and request resource limits. The native technology cannot solve how to fully and reasonably schedule Pods when server computing resources are idle.

[0003] For example, in most business scenarios, the business will show the obvious characteristics of troughs and peaks. How to use reasonable and effective resource scheduling strategies to schedule resources during the trough has become an urgent problem to be solved. Therefore, it is urgent to propose a new server idle computing power scheduling method to improve resource utilization. Summary of the invention

[0004] Therefore, the technical problem to be solved by the present invention is to overcome the defect of low resource utilization caused by the existing resource scheduling method, thereby providing a server idle computing power scheduling method, device and electronic device.

[0005] According to the first aspect, an embodiment of the present invention discloses a method for scheduling idle computing power of a server, comprising: obtaining computing power nodes and Pod resources managed in a target server cluster; determining the actual CPU resource usage data of each of the computing power nodes and the actual CPU resource usage data of each Pod in the Pod resources; determining the current usage status of the computing power node based on the actual CPU resource usage data of the computing power node and the corresponding preset CPU usage threshold; when the current usage status of any of the computing power nodes is an idle state, expanding the computing power node according to the actual CPU resource usage data of each Pod in the Pod resources that has not been configured with idle computing power; when the current usage status of any of the computing power nodes is a busy state, shrinking the computing power node according to the actual CPU resource usage data of each Pod that has been configured with the computing power node.

[0006] Optionally, the current usage status of the computing power node is determined based on the actual usage data of the CPU resources of the computing power node and the corresponding preset CPU usage threshold, including: obtaining the actual usage data of the CPU resources of the computing power node within a continuous target number of monitoring periods; when the actual usage data of the CPU resources of the computing power node within a continuous target number of monitoring periods are greater than the corresponding preset CPU usage threshold, determining that the current usage status of the computing power node is a busy state; when the current usage status of any of the computing power nodes is a busy state, scaling down the computing power node according to the actual usage data of the CPU resources of each Pod configured with the computing power node, including: expelling the Pod corresponding to the computing power node in the busy state and setting the scheduling status information of the computing power node to prohibit idle computing power scheduling until the target duration.

[0007] Optionally, the expelling the Pod corresponding to the computing power node in the busy state includes expelling the non-business Pods corresponding to the computing power node from high to low according to the actual CPU usage data of the non-business Pods.

[0008] Optionally, when the current usage status of any of the computing power nodes is an idle state, the computing power node is expanded according to the actual CPU resource usage data of each Pod in the Pod resources that has not been configured with idle computing power, including: determining the CPU resource redundancy and expansion threshold of the computing power node that is currently in an idle state; and determining the expansion upper limit of the corresponding computing power node according to the CPU resource redundancy and expansion threshold of the computing power node.

[0009] Optionally, the method further includes: when a CPU resource preemption problem occurs when a computing power node that is currently in an idle state is expanded, a CPU computing power resource mutual exclusion operation is performed in the Predicate stage of the idle computing power scheduler in response.

[0010] Optionally, the Pod corresponding to the computing power node in the busy state is expelled and the scheduling status information of the computing power node is set to prohibit idle computing power scheduling until a target duration, including: marking the computing power node in the busy state with an idle computing power scheduling not allowed taint until the CPU resource usage of the computing power node within the target duration is lower than the corresponding preset CPU usage threshold, and then deleting the idle computing power scheduling not allowed taint.

[0011] Optionally, the method further includes: when allocating an idle computing power Pod to a computing power node in an idle state, configuring the oom_score of the idle computing power Pod to be greater than the oom_score corresponding to the business Pod of the computing power node.

[0012] According to the second aspect, an embodiment of the present invention also discloses a server idle computing power scheduling device, including: an acquisition module, used to acquire the computing power nodes and Pod resources managed in the target server cluster; a first determination module, used to determine the actual CPU resource usage data of each of the computing power nodes and the actual CPU resource usage data of each Pod in the Pod resources; a second determination module, used to determine the current usage status of the computing power node based on the actual CPU resource usage data of the computing power node and the corresponding preset CPU usage threshold; an expansion module, used to expand the computing power node when the current usage status of any of the computing power nodes is an idle state according to the actual CPU resource usage data of each Pod in the Pod resources that has not been configured with idle computing power; a reduction module, used to reduce the computing power node when the current usage status of any of the computing power nodes is a busy state according to the actual CPU resource usage data of each Pod configured with the computing power node.

[0013] According to the third aspect, an embodiment of the present invention also discloses 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 steps of the server idle computing power scheduling method as described in the first aspect or any optional implementation manner of the first aspect.

[0014] According to the fourth aspect, an embodiment of the present invention further discloses a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the server idle computing power scheduling method as described in the first aspect or any optional embodiment of the first aspect are implemented.

[0015] The technical solution of the present invention has the following advantages:

[0016] The server idle computing power scheduling method / device provided by the present invention obtains the computing power nodes and Pod resources managed in the target server cluster, determines the actual CPU resource usage data of each computing power node and the actual CPU resource usage data of each Pod in the Pod resources; determines the current usage status of the computing power node according to the actual CPU resource usage data of the computing power node and the corresponding preset CPU usage threshold; when the current usage status of any computing power node is idle, the computing power node is expanded according to the actual CPU resource usage data of each Pod in the Pod resources that has not been configured with idle computing power; when the current usage status of any computing power node is busy, the computing power node is reduced according to the actual CPU resource usage data of each Pod that has been configured with the computing power node. Compared with the resource scheduling method in the prior art, which determines whether the actual usage of the Pod's CPU, memory, and custom indicators exceeds the threshold set by the HPA, and if exceeded, expands the capacity; if it is less than a certain redundancy value, shrinks the capacity, the method proposed in this application schedules the Pod to the Node with idle computing power for expansion according to the actual usage of the Node's CPU resources, and expels and shrinks the capacity according to the actual usage of the Pod's CPU when the Node's computing power resources are tight, thereby realizing resource scheduling more reasonably and improving resource utilization. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0018] Figure 1 It is a flowchart of a specific example of the method for scheduling idle computing power of a server in an embodiment of the present invention;

[0019] Figure 2 A schematic diagram of a specific example of a method for scheduling idle computing power of a server in an embodiment of the present invention;

[0020] Figure 3 A schematic diagram of a specific example of a method for scheduling idle computing power of a server in an embodiment of the present invention;

[0021] Figure 4 It is a principle block diagram of a specific example of a server idle computing power scheduling device in an embodiment of the present invention;

[0022] Figure 5 FIG. 4 is a specific example diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0024] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0025] The embodiment of the present invention discloses a method for scheduling idle computing power of a server. The idle computing power resource scheduling is to schedule the Pod to the node with idle computing power resources in the selected server set by selecting a dedicated resource pool or multiple resource pools. Figure 1 As shown, the method comprises the following steps:

[0026] Step 101, obtaining the computing nodes and Pod resources managed in the target server cluster;

[0027] Exemplarily, the target server cluster takes kubernetes and kubeedge as examples, and schedules idle computing resources for the Node managed by kubernetes and kubeedge. Computing nodes (Node) and Pods are two basic concepts. Nodes are abstractions of the entire cluster resources, and Pods are the smallest application unit for resources. The embodiment of the present application uses the Label and Taint of the Node and the Tolerant of the Pod as the boundaries for dividing resource pools to support the deployment of services that require exclusive resource pools; at the same time, Tolerants also support deployment across multiple resource pools.

[0028] Step 102, determining the actual CPU resource usage data of each of the computing power nodes and the actual CPU resource usage data of each Pod in the Pod resources;

[0029] For example, the Node managed by kubernetes can access the actual CPU resource usage data of the Node through Metrics Server and Aggregator in a way that complies with the standard kubernetes API. The Node managed by kubeedge needs to rely on Prometheus and Prometheus adapter, access Prometheusadapter through Aggregator to make a layer of adaptation, and obtain the actual CPU resource usage data of the Node from Prometheus. This method complies with the standard kubernetes API definition. Taking the actual CPU resource usage data of the Node in the Kubernetes cluster as an example, the method of obtaining it can be obtained by directly calling the link "https: / / 10.96.0.1 / apis / metrics.k8s.io / v1beta / nodes" to obtain the actual CPU resource usage data of each computing power node.

[0030] Step 103, determining the current usage status of the computing node according to the actual usage data of the CPU resources of the computing node and the corresponding preset CPU usage threshold; each computing node in the cluster is pre-set with its fixed CPU usage threshold.

[0031] As an optional implementation of the present invention, step 103 includes: obtaining actual CPU resource usage data of the computing power node within a continuous target number of monitoring cycles; when the actual CPU resource usage data of the computing power node within a continuous target number of monitoring cycles are greater than the corresponding preset CPU usage threshold, determining that the current usage state of the computing power node is a busy state;

[0032] Step 104: when the current usage state of any of the computing power nodes is an idle state, the computing power node is expanded according to the actual usage data of the CPU resources of each Pod that is not configured with idle computing power in the Pod resources;

[0033] For example, the embodiment of the present application adopts enhanced HPA (abbreviated as HPA+). HPA+ is an enhanced version of HPA based on Kubernetes native. The working principle is based on the CustomController of open source Kubernetes. The flowchart of CustomController is as follows: Figure 2As shown. Every minute, the actual CPU resource usage data of each Node is written into the configmap. The advantage of this is that the Node structure is not expanded, and the edgecore and kubelet are kept consistent with the upstream. At the same time, the actual CPU resource usage data is provided for the custom scheduler to schedule Pods to idle computing nodes, thereby realizing the expansion of computing nodes in an idle state.

[0034] The configmap structure is as follows:

[0035]

[0036]

[0037] Step 105: When the current usage status of any of the computing nodes is busy, the computing node is scaled down according to the actual usage data of the CPU resources of each Pod configured on the computing node.

[0038] As an optional implementation of the present invention, step 105 includes: expelling the Pod corresponding to the computing power node in a busy state and setting the scheduling status information of the computing power node to prohibit idle computing power scheduling until the target duration. Exemplarily, if the CPU usage threshold is exceeded within 5 HPA+ monitoring cycles, the Pod managed by HPA+ on this part of the Node is expelled and the Node is set to not allow idle computing power scheduling and return to normal after the custom target duration. In the embodiment of the present application, the target duration can be any duration of more than ten minutes, and those skilled in the art can determine it according to actual needs.

[0039] As an optional implementation of the present invention, the Pod corresponding to the computing power node in a busy state is evicted, including evicting the non-business Pods corresponding to the computing power node from high to low according to the actual CPU usage data of the non-business Pods. Exemplarily, the Pods are evicted based on the actual CPU usage data of the Pods, and the Pods with high actual CPU usage data are evicted first, and only the Pods managed by HPA+ are evicted, and the business Pods are not evicted.

[0040] The server idle computing power scheduling method provided by the present invention obtains the computing power nodes and Pod resources managed in the target server cluster, determines the actual usage data of the CPU resources of each computing power node and the actual usage data of the CPU resources of each Pod in the Pod resources; determines the current usage status of the computing power node according to the actual usage data of the CPU resources of the computing power node and the corresponding preset CPU usage threshold; when the current usage status of any computing power node is an idle state, the computing power node is expanded according to the actual usage data of the CPU resources of each Pod in the Pod resources that is not configured with idle computing power; when the current usage status of any computing power node is a busy state, the computing power node is reduced according to the actual usage data of the CPU resources of each Pod that has been configured with the computing power node. Compared with the resource scheduling method in the prior art, which determines whether the actual usage of the Pod's CPU, memory, and custom indicators exceeds the threshold set by the HPA, and if exceeded, expands the capacity; if it is less than a certain redundancy value, shrinks the capacity, the method proposed in this application schedules the Pod to the Node with idle computing power for expansion according to the actual usage of the Node's CPU resources, and expels and shrinks the capacity according to the actual usage of the Pod's CPU when the Node's computing power resources are tight, thereby realizing resource scheduling more reasonably and improving resource utilization.

[0041] As an optional implementation of the present invention, step 104 includes: determining the CPU resource redundancy and expansion threshold of the computing power node that is currently in an idle state; and determining the expansion upper limit of the corresponding computing power node based on the CPU resource redundancy and expansion threshold of the computing power node.

[0042] Exemplarily, HPA+ is organized as follows:

[0043]

[0044] The scaling algorithm is as follows:

[0045] idleCPU=∑(nodeCPU*(1-redundancy)-nodeCPUUsage)

[0046] targetPods=idleCPU / podCPULimit

[0047] Among them, nodeCPU represents the number of CPU cores of the node; redundancy represents the CPU redundancy value of the node (in percentage), which can be obtained from the Node's Label; nodeCPUUsage represents the actual CPU usage data of the node, which can be taken as the average value within 5 HPA+ cycles; podCPULimit is the CPU usage limited by the pod.

[0048] Statistics on available idle CPU resources in the HPA+ resource pool. For example, NodeA, NodeB, and NodeC have 16, 32, and 64 cores, respectively, with a redundancy of 50%. The current CPU usage is the average value of 2, 4, and 6 over 5 cycles. The PodCPUlimit is 2, and the target number of Pods (targetPods) is as follows. The calculated targetPods = 28 exceeds the HPA+yaml maximum expansion threshold of 10, so the expansion limit is 10 Pods:

[0049] ((16*0.5+32*0.5+64*0.5)-(2+4+6)) / 2=28

[0050] As an optional implementation of the present invention, the method further includes: when a CPU resource preemption problem occurs when a computing power node that is currently in an idle state is expanded, a CPU computing power resource mutual exclusion operation is performed in the Predicate stage of the idle computing power scheduler in response. Exemplarily, if multiple HPA+ expansions encounter a CPU resource preemption problem, CPU computing power resources are mutually excluded in the Predicate stage of the idle computing power scheduler to avoid multiple Pods being scheduled to one Node, resulting in the CPU computing power resources exceeding the redundancy value, and the Pods that fail to be subsequently scheduled will be scaled down in the next HPA+ cycle.

[0051] The custom scheduler is based on kube-scheduler to enhance the idle computing power scheduling strategy. The Deployment deployed through idle computing power needs to specify the idle computing power scheduler, which can be specified through the keyword schedulerName:CPUIdleScheduler. The idle computing power scheduler is essentially the same as kube-scheduler, divided into Predicates and Priorities. The idle computing power scheduling strategy is registered to the Predicates strategy chain through register, as shown below: Figure 3 As shown:

[0052] First, if the idle computing power Deployment plans a resource pool, the Nodes in the resource pool will be screened out in the GeneralPredicates strategy in the Predicates stage. Then, after executing all the default Predicates strategies in the kube-scheduler, the idle computing power Predicates will be executed. The algorithm of this method is as follows:

[0053] nodeCPUIdle=(nodeCPU*(1-redundancy)-nodeCPUUsage)

[0054] Among them, nodeCPU represents the number of CPU cores of the node; redundancy represents the CPU redundancy value of the node (in percentage), which can be obtained from the Node's Label; nodeCPUUsage represents the actual CPU usage data of the node, which can be taken as the average value within 5 HPA+ monitoring collection cycles; podCPULimit is the CPU usage limited by the pod. <node-name>-resource-usage configmap obtains the actual usage of CPU computing resources.

[0055] If nodeCPUIdle is greater than the pod's CPU limit value (preset CPU usage threshold), the Node is considered to be running and scheduled, otherwise the Node is filtered out. It should be noted that the idle Deployment must set the CPU Limit to prevent its CPU resources from running high and affecting other high-priority services on the Node. In theory, the idle computing power Pod is the Pod with the lowest priority.

[0056] As an optional implementation of the present invention, the Pod corresponding to the computing power node in a busy state is expelled and the scheduling status information of the computing power node is set to prohibit idle computing power scheduling until the target duration, including: marking the computing power node in a busy state with an idle computing power scheduling not allowed stain until the CPU resource usage of the computing power node is lower than the corresponding preset CPU usage threshold within the target duration, and then deleting the idle computing power scheduling not allowed stain.

[0057] For example, if the actual CPU usage exceeds the redundancy value within five consecutive CPU collection cycles, it can be determined that the CPU computing resources of the Node are busy, and the Node will be marked with the idle computing scheduling not allowed taint, and the idle computing Pod will no longer be scheduled to the Node. When the CPU usage reaches the custom target time and is lower than the preset CPU usage threshold, the idle computing scheduling not allowed taint is deleted. <node-name>-resource-usage configmap, obtains HPA+-managed Pods with high CPU computing resource usage and evicts them. The principle is to execute the Kubernetes delete pod API. The rebuilt Pod will be scheduled to the remaining Nodes with idle CPUs. If there is no Node to schedule, it will be scaled down in the next HPA+ cycle.

[0058] As an optional implementation of the present invention, the method further includes: when allocating an idle computing power Pod to a computing power node in an idle state, configuring the oom_score of the idle computing power Pod to be greater than the oom_score corresponding to the business Pod of the computing power node.

[0059] For example, the QoS policies of kubernetes are divided into BestEffort, Burstable, and Guaranteed, with priorities increasing from left to right. The Guaranteed type of Pod is the one that needs to be protected the most, and its oom_score_adj is also set to the lowest. The idle computing power Pod needs to limit its CPU usage to avoid affecting online business, so the QoS of the idle computing power Pod is Guaranteed, which will cause the Pod to run out of memory and cause oom, because of its low oom_score_adj, it is not easy to be killed by oom, which will affect the online business Pod, so the idle computing power scheduling sets a very high oom_score_adj for the Pod, which is different from the existing kubernetes QoS policy.

[0060] The server idle computing power scheduling method provided in the embodiment of the present application adds a resource pool management method and an idle computing power resource scheduling strategy, and on the basis of the original HPA elastic scaling, newly adds elastic scaling of the Pod according to the actual CPU usage and redundancy value of the Node, and schedules it to the idle computing power Node and when the Node computing power is busy, ensures the stability of the business Pod, expels the Pod scheduled by the idle computing power and performs capacity reduction, prioritizes the eviction of idle Pods, and prioritizes the killing of idle computing power processes, thereby ensuring the business Pod and other advantages.

[0061] The embodiment of the present invention also discloses a server idle computing power scheduling device, such as Figure 4 As shown, the device comprises:

[0062] The acquisition module 201 is used to acquire the computing nodes and Pod resources managed in the target server cluster;

[0063] The first determination module 202 is used to determine the actual usage data of the CPU resources of each of the computing power nodes and the actual usage data of the CPU resources of each Pod in the Pod resources;

[0064] The second determination module 203 is used to determine the current usage status of the computing power node according to the actual usage data of the CPU resources of the computing power node and the corresponding preset CPU usage threshold;

[0065] The capacity expansion module 204 is used to expand the capacity of any computing node according to the actual usage data of the CPU resources of each Pod that is not configured with idle computing power in the Pod resources when the current usage state of any computing node is idle;

[0066] The capacity reduction module 205 is used to reduce the capacity of any computing node according to the actual usage data of the CPU resources of each Pod configured by the computing node when the current usage status of any computing node is busy.

[0067] The server idle computing power scheduling device provided by the present invention obtains the computing power nodes and Pod resources managed in the target server cluster, determines the actual CPU resource usage data of each computing power node and the actual CPU resource usage data of each Pod in the Pod resources; determines the current usage status of the computing power node according to the actual CPU resource usage data of the computing power node and the corresponding preset CPU usage threshold; when the current usage status of any computing power node is idle, the computing power node is expanded according to the actual CPU resource usage data of each Pod in the Pod resources that has not been configured with idle computing power; when the current usage status of any computing power node is busy, the computing power node is reduced according to the actual CPU resource usage data of each Pod that has been configured with the computing power node. Compared with the resource scheduling method in the prior art, which determines whether the actual usage of the Pod's CPU, memory, and custom indicators exceeds the threshold set by the HPA, and if exceeded, expands the capacity; if it is less than a certain redundancy value, shrinks the capacity, the method proposed in this application schedules the Pod to the Node with idle computing power for expansion according to the actual usage of the Node's CPU resources, and expels and shrinks the capacity according to the actual usage of the Pod's CPU when the Node's computing power resources are tight, thereby realizing resource scheduling more reasonably and improving resource utilization.

[0068] As an optional embodiment of the present invention, the second determination module 203 includes: a first acquisition sub-module, used to obtain the actual usage data of the CPU resources of the computing power node within a continuous target number of monitoring periods; a first determination sub-module, used to determine that the current usage status of the computing power node is a busy state when the actual usage data of the CPU resources of the computing power node within a continuous target number of monitoring periods are greater than the corresponding preset CPU usage threshold; the reduction module 205 includes: an eviction module, used to evict the Pod corresponding to the computing power node in the busy state and set the scheduling status information of the computing power node to prohibit idle computing power scheduling until the target duration.

[0069] As an optional implementation manner of the present invention, the eviction module includes: a first eviction submodule, which is used to evict the non-business Pods corresponding to the computing power node from high to low according to the actual CPU usage data of the non-business Pods.

[0070] As an optional embodiment of the present invention, the capacity expansion module 204 includes: a second determination submodule, used to determine the CPU resource redundancy and capacity expansion threshold of the computing power node currently in an idle state; a third determination submodule, used to determine the capacity expansion upper limit of the corresponding computing power node based on the CPU resource redundancy and capacity expansion threshold of the computing power node.

[0071] As an optional embodiment of the present invention, the device also includes: a mutual exclusion module, which is used to respond to the CPU computing power resource mutual exclusion operation in the Predicate stage of the idle computing power scheduler when the CPU resource preemption problem occurs when the computing power node currently in the idle state is expanded.

[0072] As an optional embodiment of the present invention, the eviction module includes: a second eviction sub-module, which is used to mark the computing power node in a busy state with an idle computing power scheduling not allowed stain until the CPU resource usage of the computing power node within the target time period is lower than the corresponding preset CPU usage threshold, and then the idle computing power scheduling not allowed stain is deleted.

[0073] As an optional implementation of the present invention, the device also includes: a configuration module, which is used to configure the oom_score of the idle computing power Pod to be greater than the oom_score corresponding to the business Pod of the computing power node when allocating an idle computing power Pod to a computing power node in an idle state.

[0074] The embodiment of the present invention further provides an electronic device, such as Figure 5 As shown, the electronic device may include a processor 401 and a memory 402, wherein the processor 401 and the memory 402 may be connected via a bus or other means. Figure 5 The example of connecting through bus is taken in the following.

[0075] The processor 401 may be a central processing unit (CPU). The processor 401 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.

[0076] The memory 402 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the server idle computing power scheduling method in the embodiment of the present invention. The processor 401 executes various functional applications and data processing of the processor by running the non-transient software programs, instructions and modules stored in the memory 402, that is, implementing the server idle computing power scheduling method in the above method embodiment.

[0077] The memory 402 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created by the processor 401, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 402 may optionally include a memory remotely arranged relative to the processor 401, and these remote memories may be connected to the processor 401 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0078] The one or more modules are stored in the memory 402, and when executed by the processor 401, the following is performed: Figure 1 The server idle computing power scheduling method in the illustrated embodiment.

[0079] For details of the above electronic equipment, please refer to Figure 1 The corresponding related descriptions and effects in the illustrated embodiments can be understood and will not be repeated here.

[0080] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the storage medium can be a disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD), etc.; the storage medium can also include a combination of the above-mentioned types of memory.

[0081] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for scheduling idle computing power of a server, characterized in that: include: Obtain the managed computing nodes and Pod resources in the target server cluster; Determine the actual CPU resource usage data of each of the computing power nodes and the actual CPU resource usage data of each Pod in the Pod resources; Determine the current usage status of the computing power node according to the actual usage data of the CPU resources of the computing power node and the corresponding preset CPU usage threshold; When the current usage state of any of the computing power nodes is idle, the computing power node is expanded according to the actual usage data of the CPU resources of each Pod that is not configured with idle computing power in the Pod resources; When the current usage status of any of the computing nodes is busy, the computing node is scaled down according to the actual usage data of the CPU resources of each Pod configured on the computing node; When the current usage state of any of the computing nodes is a busy state, scaling down the computing node according to the actual usage data of the CPU resources of each Pod configured on the computing node includes: The Pod corresponding to the computing power node in the busy state is expelled and the scheduling status information of the computing power node is set to prohibit the scheduling of idle computing power until the target duration; The eviction of the Pod corresponding to the computing node in a busy state includes: The non-business Pods are evicted according to the actual CPU usage data of the non-business Pods corresponding to the computing power nodes from high to low.

2. The method according to claim 1, characterized in that: Determining the current usage status of the computing power node according to the actual usage data of the CPU resources of the computing power node and the corresponding preset CPU usage threshold includes: Obtaining actual CPU resource usage data of the computing power node within a target number of consecutive monitoring cycles; When the actual usage data of the CPU resources of the computing power node within a continuous target number of monitoring cycles are greater than the corresponding preset CPU usage threshold, it is determined that the current usage status of the computing power node is a busy state.

3. The method according to claim 1, characterized in that When the current usage state of any of the computing power nodes is an idle state, the computing power node is expanded according to the actual usage data of the CPU resources of each Pod that is not configured with idle computing power in the Pod resources, including: Determine the CPU resource redundancy and expansion threshold of the computing power nodes that are currently in an idle state; The expansion upper limit of the corresponding computing power node is determined according to the CPU resource redundancy and expansion threshold of the computing power node.

4. The method according to claim 1, characterized in that The method further comprises: When the capacity of a computing node that is currently in an idle state is expanded, a CPU resource preemption problem occurs. In response, a CPU computing resource mutual exclusion operation is performed in the Predicate stage of the idle computing scheduler.

5. The method according to claim 1, characterized in that The Pod corresponding to the computing power node in the busy state is expelled and the scheduling state information of the computing power node is set to prohibit the scheduling of idle computing power until the target duration, including: The computing power node in the busy state is marked with an idle computing power scheduling not allowed taint until the CPU resource usage of the computing power node is lower than the corresponding preset CPU usage threshold within the target time period, and then the idle computing power scheduling not allowed taint is deleted.

6. The method according to claim 3, characterized in that The method further comprises: When an idle computing power Pod is allocated to a computing power node in an idle state, the oom_score of the idle computing power Pod is configured to be greater than the oom_score corresponding to the business Pod of the computing power node.

7. A server idle computing power scheduling device, characterized in that: include: The acquisition module is used to obtain the computing nodes and Pod resources managed in the target server cluster; A first determination module is used to determine the actual usage data of the CPU resources of each of the computing power nodes and the actual usage data of the CPU resources of each Pod in the Pod resources; A second determination module is used to determine the current usage status of the computing power node according to the actual usage data of the CPU resources of the computing power node and the corresponding preset CPU usage threshold; An expansion module, used for, when the current usage state of any of the computing power nodes is idle, expanding the computing power node according to the actual usage data of the CPU resources of each Pod that is not configured with idle computing power in the Pod resources; A capacity reduction module, used for reducing the capacity of any computing node according to the actual usage data of the CPU resources of each Pod configured on the computing node when the current usage status of any computing node is busy; The shrinking module includes: an eviction module, which is used to evict the Pod corresponding to the computing power node in a busy state and set the scheduling status information of the computing power node to prohibit idle computing power scheduling until the target duration; The eviction module includes: a first eviction submodule, which is used to evict the non-business Pods corresponding to the computing power node from high to low according to the actual CPU usage data of the non-business Pods.

8. An electronic device, characterized in that: include: 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 so that the at least one processor performs the steps of the server idle computing power scheduling method as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the server idle computing power scheduling method as described in any one of claims 1-6 are implemented.

Citation Information

Patent Citations

  • Container resource creating method, device and equipment and computer readable storage medium

    CN110221901A

  • Kubernetes-based cluster load adjustment method and storage medium

    CN112988380A