Cluster task scheduling method and device, equipment, storage medium and program product
By adopting a multi-cluster hybrid scheduling method in a multi-cloud K8s environment, combining service request information and load information, the target service cluster is determined and tasks is issued, and the problem of easy failure of task scheduling and low resource utilization rate is solved, and more efficient resource utilization and management components are optimized.
Patent Information
- Application Number
- CN202411767461.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-04
AI Technical Summary
In multi-cloud K8s environment, Redis-based task scheduling is prone to failure and has a low resource utilization rate. This is mainly because K8S scheduling adopts a single task scheduling method, and it is impossible to effectively comprehensively consider the Redis pod type, availability zone information, customer level, node performance differences and customer usage.
The multi-cluster hybrid scheduling method is adopted to determine the key factor set of the target service based on the service request information of the target service and the load information on the existing network, and determine the target service cluster from multiple service clusters based on the key factor set and the preset factor set of the service cluster in the multi-cloud cluster, and distribute the target service to the adapted service cluster.
Through the multi-cluster hybrid scheduling method, it is possible to optimize task scheduling, improve resource utilization, reduce management component overhead, and meet business needs while increasing cluster resource utilization.
Smart Images

Figure CN119557072A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a cluster task scheduling method, device, equipment, storage medium and program product. Background Art
[0002] As a container orchestration engine (Kubernetes, K8s), K8s is used to manage containerized applications on multiple hosts in the cloud platform. It supports automated deployment, large-scale scalability and application containerization management. In related technologies, a limited task (pod) is assigned to each Remote Dictionary Server (Redis) component through K8S scheduling, so that multiple pods are combined to form an instance for users to use. In a multi-cloud K8s environment, there are only four pod scheduling methods: specified labels, specified nodes, affinity / anti-affinity, and pod topology distribution constraints. Redis-based scheduling requires comprehensive consideration of Redis pod type, availability zone (az) information, customer level, performance differences of different nodes, and customer usage. Therefore, since K8S scheduling uses a single task scheduling method, Redis-based task scheduling is prone to failure and resource utilization is low. Summary of the invention
[0003] The embodiments of the present application provide a cluster task scheduling method, apparatus, device, storage medium and program product to solve the problem that Redis-based task scheduling is prone to failure and has low resource utilization.
[0004] In a first aspect, an embodiment of the present application provides a cluster task scheduling method, the method comprising:
[0005] Determine a set of key factors corresponding to the target service according to service request information of the target service and existing network load information;
[0006] Determining a target business cluster from the at least two business clusters according to the key factor set and preset factor sets respectively corresponding to at least two business clusters in the multi-cloud cluster;
[0007] The target service is sent to the target service cluster.
[0008] Optionally, the multi-cloud cluster includes a management cluster and the at least two business clusters, the management cluster includes a first management cluster and a second management cluster, the first management cluster is at least used to schedule the second management cluster and at least one of the target management clusters, the second management cluster is at least used to schedule the target management cluster, and the target management cluster is at least one business cluster of the at least two business clusters.
[0009] Optionally, determining a set of key factors corresponding to the target service according to service request information of the target service and existing network load information includes:
[0010] Based on the service request information and the existing network load information, determine the key factors corresponding to each service factor in at least one service factor; wherein the at least one service factor includes any one or more of the task load, the container orchestration engine K8s type, the type of the target service, the area of the target service, and the usage mode of the target service;
[0011] The key factor set is constructed based on the key factors respectively corresponding to each business factor in the at least one business factor.
[0012] Optionally, determining a target business cluster from the at least two business clusters in the multi-cloud cluster according to the key factor set and preset factor sets respectively corresponding to the at least two business clusters includes:
[0013] Acquire a preset factor set corresponding to each of the at least two service clusters, the preset factor set including a preset factor corresponding to at least one service factor; wherein the preset factor is used to indicate the degree of adaptation of the service cluster in aspects related to the service factor corresponding to the preset factor;
[0014] Determining, according to the key factor set and the preset factor set, a business coefficient corresponding to each of the at least two business clusters;
[0015] The service cluster with the highest service coefficient among the at least two service clusters is determined as the target service cluster.
[0016] Optionally, the method further comprises:
[0017] Determine the water level value corresponding to each node in the at least two service clusters according to the scheduling information and the historical load information of the historical services;
[0018] In the case where the number of first nodes in the at least two business clusters is less than the first number, the limited task pod in the second node is migrated to the third node, the first node is a node in the at least two business clusters whose water level value is lower than the first preset water level value, the first number is determined based on resource distribution information of multiple nodes in the at least two business clusters, the second node is a node in the at least two business clusters whose water level value is in the first range, and the third node is a node in the at least two business clusters whose water level value is in the second range;
[0019] Among them, the minimum value of the first range is greater than the first preset water level value, the maximum value of the first range is less than the second preset water level value, the minimum value of the second range is greater than the second preset water level value, the maximum value of the first range is less than the third preset water level value, and the third preset water level value is greater than the first preset water level value.
[0020] Optionally, determining the water level value corresponding to each node in the at least two service clusters according to the scheduling information and the historical load information of the historical service includes:
[0021] Obtain resource scheduling information and the historical load information of the historical services related to each node in the at least two service clusters, wherein the scheduling information of the historical services includes at least one of a central processing unit (CPU) utilization, a memory utilization, and a pod utilization of the node;
[0022] Determining resource utilization of each node in the at least two service clusters based on the resource scheduling information of the historical service;
[0023] Determine the nodes in the at least two service clusters whose resource utilization is greater than or equal to the preset utilization as high-water mark nodes, and determine the nodes in the at least two service clusters whose resource utilization is less than the preset utilization as low-water mark nodes;
[0024] Determine a water level value corresponding to the high water level node according to the historical load information and one of the CPU utilization, memory utilization, and pod utilization of the high water level node;
[0025] The water level value corresponding to the low water level node is determined according to the historical load information and one of the CPU utilization, memory utilization, and pod utilization of the low water level node.
[0026] In a second aspect, an embodiment of the present application further provides a cluster task scheduling device, including:
[0027] A first determination module is used to determine a set of key factors corresponding to the target service according to service request information of the target service and existing network load information;
[0028] A second determination module is used to determine a target business cluster from the at least two business clusters in the multi-cloud cluster according to the key factor set and preset factor sets respectively corresponding to the at least two business clusters in the multi-cloud cluster;
[0029] The service delivery module is used to deliver the target service to the target service cluster.
[0030] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein the program, when executed by the processor, implements the steps of the cluster task scheduling method described in the first aspect above.
[0031] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the cluster task scheduling method described in the first aspect are implemented.
[0032] In a fifth aspect, a computer program product is provided. The computer program product is stored in a storage medium and is executed by at least one processor to implement the steps of the cluster task scheduling method as described in the first aspect.
[0033] In an embodiment of the present application, a multi-cluster hybrid scheduling method is adopted, and the management cluster in the multi-cloud cluster determines the key factor set corresponding to the target business based on the business request information of the target business and the existing network load information. In this way, the target business cluster can be determined from at least two business clusters based on the key factor set and the preset factor sets corresponding to at least two business clusters in the multi-cloud cluster, and then the target business can be sent to the target business cluster.
[0034] Therefore, the present application can preset key factors according to the needs of different target businesses and the existing network load, adapt the key factors of the target business with the preset key factors of multiple business clusters, create user instances on the matching target business clusters, and send the target business to the adapted business cluster, thereby reducing the management component overhead and improving the utilization rate of cluster resources while meeting the business needs of the target business. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0036] Figure 1 is a flow chart of a cluster task scheduling method provided in an embodiment of the present application;
[0037] Figure 2 This is a schematic diagram of simple scheduling in multi-cluster scheduling;
[0038] Figure 3 It is a schematic diagram of optimized scheduling in multi-cluster scheduling;
[0039] Figure 4 is a schematic diagram of multi-cluster hybrid scheduling provided by an embodiment of the present application;
[0040] Figure 5 It is a structural diagram of a cluster task scheduling device provided in an embodiment of the present application;
[0041] Figure 6 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0043] See also Figure 1 , Figure 1 This is one of the flow charts of a cluster task scheduling method provided in an embodiment of the present application, the method comprising the following steps:
[0044] Step 101: Determine a set of key factors corresponding to a target service according to service request information of the target service and existing network load information.
[0045] It should be noted that the multi-cloud cluster may include a management cluster and a business cluster. The controller in the management cluster can communicate with the schedulers of multiple business clusters, and the schedulers of multiple business clusters are independent of each other. The controller can instruct the scheduler to execute the instruction and return the execution result by sending a control instruction to the scheduler. In an embodiment of the present application, the execution subject may be the management cluster in the multi-cloud cluster. The controller in the management cluster can comprehensively determine the target business cluster corresponding to the target business based on the business request information of the target business and the existing network load information, that is, determine the distribution strategy of each business instance, distribute each business instance to each business cluster, optimize the task scheduling process, and uniformly manage the business clusters in the multi-cloud cluster to improve the cluster resource utilization.
[0046] Specifically, when there is a target service processing request, the controller in the management cluster can select one of the remaining service clusters that are currently unloaded or have a small load as a target service cluster according to the load conditions of each service cluster in the current network. For example, the load required by the service cluster to process the target service accounts for 40% of the service cluster load. The current network load information includes the current load capacity of each service cluster. The load remaining capacity of one service cluster is 30%, and the load remaining capacity of the other two service clusters is 50% and 70% respectively. Although the latter two service clusters can load the target service, in order to improve the service processing speed and efficiency, the service cluster with a load remaining capacity of 70% can be selected as the target service cluster. Thus, the optimized scheduling of the target service is achieved. In order to reasonably schedule each target service, key factors can be set for multiple information in the service request information and the current network load information, and the key factors in various directions are combined to form a key factor set, so that the target service cluster can be selected through the key factor set.
[0047] Step 102: Determine a target business cluster from the at least two business clusters in the multi-cloud cluster according to the key factor set and preset factor sets corresponding to the at least two business clusters in the multi-cloud cluster.
[0048] It is understandable that the key factor set may include key factors corresponding to multiple aspects of the service request information and the existing network load information, and the preset factor set may also include preset factors corresponding to the same aspects of the service cluster, and the preset factors may be used to measure the service capability of a certain service cluster in a certain aspect of the service request information or the existing network load information. For example, if there is a preset factor corresponding to a service type in the preset factor set, there is a key factor corresponding to the service type in the key factor set.
[0049] In an embodiment of the present application, a target business cluster can be screened by comprehensively combining a key factor set and a preset factor set corresponding to each business cluster. For example, most of the preset factors in the preset factor set corresponding to the target business cluster can be consistent with the key factors of the corresponding aspects in the key factor set. Alternatively, the sum of the preset factors in the preset factor set corresponding to the target business cluster is the sum of the preset factors of all business clusters that is closest to the sum of the key factors in the key factor set. Alternatively, the sum of the products of the preset factors of various aspects in the preset factor set corresponding to the target business cluster and the key factors of the corresponding aspects is the largest one among all business clusters. Thus, an embodiment of the present application can determine the target business cluster by comprehensively considering the business needs of the user, the current load conditions of each business cluster, and the actual processing capabilities of each business cluster.
[0050] Step 103: Send the target service to the target service cluster.
[0051] In the embodiment of the present application, after determining the distribution strategy of the target business, that is, after determining the target business cluster, the management cluster can directly send the processing instruction of the target business to the target business cluster, and the target business cluster creates a redis instance to process the target business. It can be seen that the embodiment of the present application can send the target business to the adapted business cluster, reduce the management component overhead, and improve the utilization rate of cluster resources while meeting the business needs of the target business.
[0052] Optionally, the multi-cloud cluster includes a management cluster and the at least two business clusters, the management cluster includes a first management cluster and a second management cluster, the first management cluster is at least used to schedule the second management cluster and at least one of the target management clusters, the second management cluster is at least used to schedule the target management cluster, and the target management cluster is at least one business cluster of the at least two business clusters.
[0053] It is worth mentioning that Redis containerized orchestration scheduling, that is, scheduling Redis pods to corresponding nodes through k8s, and multiple Redis pods further form Redis instances to provide services to the outside world. In the multi-cluster orchestration method, a hybrid scheduling optimization orchestration method is adopted for scheduling Redis to multiple clusters. Multi-cluster hybrid scheduling, that is, on the basis of existing cluster scheduling, multiple single-cluster scheduling modes are mixed to achieve a hybrid scheduling method for multiple types of clusters. Figure 2 As shown in the figure, simple multi-cluster scheduling means that under the premise of using multiple sets of K8S independently, through Redis's own orchestration, Redis instances are scheduled to different K8S clusters and lifecycle maintenance is performed. That is, there are 1+N sets of K8S, where 1 is the management cluster and N is the business cluster. The controller in the management cluster distributes the target business or demand to different business clusters, and the scheduler in the business cluster creates instances and performs full lifecycle management.
[0054] For multi-cluster optimization scheduling, such as Figure 3 As shown in the figure, 1+N clusters are connected to the network and the network policy provider (calico) network through network components. 1 is the management cluster, N is the business cluster, and the management cluster 1 can manage instances in multiple business clusters 1, 2, and 3 through a scheduler. Although multiple clusters are included in unified management, each business cluster still exists independently. The controller and scheduler are unified into the management cluster, and the business cluster carries the Redis instance.
[0055] In the specific embodiments of the present application, Figure 4 As shown in Figure 2, a multi-cluster hybrid scheduling method is provided, which combines the above Figure 2 Simple scheduling and Figure 3In the optimized scheduling, multiple service clusters of the optimized scheduling are managed as subclusters of one of the clusters of the simple scheduling. The management cluster 2 of the simple scheduling is the second management cluster. The management cluster used to schedule the second management cluster and multiple service clusters in the simple scheduling is the management cluster 1 (i.e., the first management cluster). The first management cluster uses the controller to control the remaining service clusters. Figure 4 Business cluster 1, management cluster 2, and business cluster 2 are directly controlled by the controller of management cluster 1, and the control method is simple scheduling.
[0056] In addition, the scheduler of management cluster 2 can manage business cluster 3, business cluster 4 and business cluster 5, and the management mode is optimized scheduling. Among them, business cluster 1, business cluster 2, business cluster 3, business cluster 4 and business cluster 5 can all accommodate Redis instances, realizing unified management of existing clusters, reducing management component overhead, and saving management component resources.
[0057] It should be understood that the number of management clusters and business clusters in a multi-cloud cluster can be expanded as needed, and this application does not impose any specific restrictions.
[0058] Optionally, determining a set of key factors corresponding to the target service according to service request information of the target service and existing network load information includes:
[0059] Based on the service request information and the existing network load information, determine the key factors corresponding to each service factor in at least one service factor; wherein the at least one service factor includes any one or more of the task load, the container orchestration engine K8s type, the type of the target service, the area of the target service, and the usage mode of the target service;
[0060] The key factor set is constructed based on the key factors respectively corresponding to each business factor in the at least one business factor.
[0061] In some embodiments, the above-mentioned business request information may include task load demand information, required K8s type, target business type, target business area and target business usage, etc. Based on this, specific key factors can be set for each business factor. For example, there are two different target businesses, and the two target businesses require different K8s types, and the values of the key factors corresponding to the K8s type business factor are also different. Therefore, corresponding key factors can be set for each business factor to form a key factor set.
[0062] For example, the set of key factors can be represented by [A1,A2,A3,…,A n ], the preset factor set can be represented by [B1,B2,B3,…,B n] indicates that A1 and B1 can correspond to the same business factor and can include n business factors.
[0063] Optionally, determining a target business cluster from the at least two business clusters in the multi-cloud cluster according to the key factor set and preset factor sets respectively corresponding to the at least two business clusters includes:
[0064] Acquire a preset factor set corresponding to each of the at least two service clusters, the preset factor set including a preset factor corresponding to at least one service factor; wherein the preset factor is used to indicate the degree of adaptation of the service cluster in aspects related to the service factor corresponding to the preset factor;
[0065] Determining, according to the key factor set and the preset factor set, a business coefficient corresponding to each of the at least two business clusters;
[0066] The service cluster with the highest service coefficient among the at least two service clusters is determined as the target service cluster.
[0067] It should be noted that the preset factor set may include preset factors corresponding to multiple business factors, and the preset factors may indicate the adaptability of the business set in a certain business factor. For example, in terms of the business factor of task load of the target business, if the business cluster can meet the task load required in this business factor, the preset factor corresponding to this business factor may be set to 1, and if it does not meet the requirement, the preset factor may be set to 0. Thus, the actual task processing capability of each business cluster can be accurately indicated through the preset factor set, so as to match each target business, optimize the task scheduling process, and improve the task processing efficiency.
[0068] In some embodiments, the following expression may be used to determine the service coefficients corresponding to the plurality of service clusters, and select the target service cluster from them, which is specifically expressed as:
[0069]
[0070] Wherein, A1 represents a key factor corresponding to one of the at least one business factors, such as a key factor corresponding to the task load; A2 represents a key factor corresponding to another of the at least one business factors, such as a key factor corresponding to the K8s type; Indicates a preset factor corresponding to a business factor in at least one business factor of business cluster 1 in at least two business clusters, for example, a preset factor corresponding to a task load; Indicates a preset factor corresponding to another business factor in at least one business factor of business cluster 1 in at least two business clusters, for example, a preset factor corresponding to the K8s type; Indicates a preset factor corresponding to a business factor in at least one business factor of business cluster 2 in at least two business clusters; Indicates a preset factor corresponding to a business factor in at least one business factor of a business cluster k in at least two business clusters.
[0071] Through the above formula, a business cluster with the highest business coefficient can be selected as the target business cluster. The target business cluster is the optimal business cluster that currently processes the target business. This optimizes the task scheduling process, reduces the management component overhead, and improves the utilization rate of cluster resources while meeting the business needs of the target business.
[0072] Optionally, the method further comprises:
[0073] Determine the water level value corresponding to each node in the at least two service clusters according to the scheduling information and the historical load information of the historical services;
[0074] In the case where the number of first nodes in the at least two business clusters is less than the first number, the limited task pod in the second node is migrated to the third node, the first node is a node in the at least two business clusters whose water level value is lower than the first preset water level value, the first number is determined based on resource distribution information of multiple nodes in the at least two business clusters, the second node is a node in the at least two business clusters whose water level value is in the first range, and the third node is a node in the at least two business clusters whose water level value is in the second range;
[0075] Among them, the minimum value of the first range is greater than the first preset water level value, the maximum value of the first range is less than the second preset water level value, the minimum value of the second range is greater than the second preset water level value, the maximum value of the first range is less than the third preset water level value, and the third preset water level value is greater than the first preset water level value.
[0076] It should be understood that when K8S is scheduling, it uses the default scheduling strategy of Scheduler, whether it is balanced, maximum allocation, or minimum allocation strategy, which may cause some problems. For example, when each node (node) of the cluster occupies a large amount of resources, such as 40-80% of the resources, it will not be possible to create an instance that occupies 50-60% of the resources. Alternatively, due to the different pods allocated to each node and user usage, the resource utilization of some nodes may be too high while some nodes are actually vacant. Therefore, in response to the above problems, the embodiment of the present application also discloses a technical solution for pod migration in multiple clusters, which optimizes the resource utilization of nodes in each cluster through defragmentation during the cluster governance stage, i.e., during the pod operation process.
[0077] In some embodiments, the water level value corresponding to each node in each business cluster can be set according to the scheduling information and historical load information of the historical business. The scheduling information of the historical business can include the corresponding business cluster information assigned to the historical business, the degree of completion of the business processing, the load demand, etc., and the historical load information can include the load information occupied by each business cluster when processing the historical business. In addition, the water level value can also be adjusted according to the number of business clusters in the multi-cloud cluster, for example, the more nodes there are in the business cluster, the higher the high water level value can be, indicating that more nodes can be used.
[0078] Furthermore, the first node whose water level is lower than the first preset water level is a low-water level node. To meet the load scheduling requirements, the number of low-water level nodes should be greater than the preset value, so that there are enough low-water level nodes to reserve space for large instances (i.e., instances that need to occupy 50% to 60% of the node resources). When the number of low-water level nodes is less than the first number, that is, the low-water level nodes are insufficient, the pods that can be migrated on the node close to the low water level can be migrated to the node close to the high water level. Among them, the low water level is the first preset water level, the high water level is the third preset water level, the second node is the node close to the low water level, and the third node is the node close to the high water level. In this way, by migrating the node close to the low water level to the node close to the high water level, the corresponding node resources are released.
[0079] Specifically, taking the migration of CPU as an example, the number of CPUs of the node to be migrated is the number of sentinels*sentinel CPUs that can be migrated+the number of proxies*proxy CPUs that can be migrated+the number of slave pods*slave CPUs that can be migrated, and the priority is sorted in order of sentinel, proxy, and slave. If the demand cannot be met even after the full migration, the migration of this node is abandoned. The migration order starts with the node close to the low water mark. In addition, the pod logic that each node can receive, taking the ability to receive a fixed amount of CPU as an example, receives the CPU that can be migrated from a single node. If all nodes that can receive the CPU cannot meet the demand, the migration is abandoned. The receiving order starts with the node close to the high water mark.
[0080] It is worth mentioning that nodes that exceed the highest watermark can no longer carry new demands, and such nodes will no longer be scheduled for migration. Nodes below the lowest watermark will be used to reserve space for large instance creation. The nodes in the migration range are sorted from large to small, and the migratable pods on the nodes close to the low watermark will be migrated to the nodes close to the high watermark. Among them, the migratable pods include the sentinel pods, proxy pods, and slave pods in the instance, and the non-migratable pod type is the master pod.
[0081] In the embodiment of the present application, the actual CPU and memory (MEM) usage on the node can be obtained for calculation, and the number of pods does not participate in the actual utilization calculation. At the same time, migration is only performed on nodes above the low water mark, that is, nodes above the low water mark and above the high water mark will participate in utilization balancing. In this way, through multi-cluster dynamic water level setting and load optimization scheduling algorithms, the node resource management of multiple clusters is connected in series, and the node usage of multiple clusters is optimized and managed on the basis of minimizing the impact on users as much as possible, thereby improving the optimal use of resources and reducing machine costs.
[0082] Optionally, determining the water level value corresponding to each node in the at least two service clusters according to the scheduling information and the historical load information of the historical service includes:
[0083] Obtain resource scheduling information and the historical load information of the historical services related to each node in the at least two service clusters, wherein the scheduling information of the historical services includes at least one of a central processing unit (CPU) utilization, a memory utilization, and a pod utilization of the node;
[0084] Determining resource utilization of each node in the at least two service clusters based on the resource scheduling information of the historical service;
[0085] Determine the nodes in the at least two service clusters whose resource utilization is greater than or equal to the preset utilization as high-water mark nodes, and determine the nodes in the at least two service clusters whose resource utilization is less than the preset utilization as low-water mark nodes;
[0086] Determine a water level value corresponding to the high water level node according to the historical load information and one of the CPU utilization, memory utilization, and pod utilization of the high water level node;
[0087] The water level value corresponding to the low water level node is determined according to the historical load information and one of the CPU utilization, memory utilization, and pod utilization of the low water level node.
[0088] In some embodiments, each node can be sorted according to its resource utilization rate, and each node can be assigned a value. First, nodes with high resource utilization rates are assigned a high water mark value. The initial value of the high water mark value can be set to 75%, and the low water mark value can be set to 25%. In addition, the minimum number of cluster nodes can be set to 9 or more. If the number of nodes is less than 9, no dynamic water mark is assigned. In the embodiment of the present application, the dynamic high water mark value can be expressed as:
[0089] Max{min[(75+number of nodes / 100+max(CPU utilization, memory utilization, pod utilization)*weight+cluster weight-user weight) / 100, 0.9], 0.6};
[0090] In the above formula, the highest value among CPU utilization, MEM utilization and pod utilization can be selected, and the maximum value is not greater than 1. The corresponding weight can be set between 1-10, and the weight can be determined based on the historical data of the cluster. In multiple clusters, when some clusters need to be used intensively, the load can be set higher, and some clusters need to be gradually withdrawn from the network. The load is set lower to achieve no more added user instances. The cluster weight is set between 15 and 15, and the sum of the weights of each cluster is 0. In addition, the user weight is set according to the importance of different customers. For example, important customers can be set to 5 and ordinary customers to 2. When the calculated value is higher than 0.9 (ie 90%), 0.9 can be directly taken. When the calculated value is lower than 0.6, 0.6 (ie 60%) can be directly taken.
[0091] Similarly, for the low water level node, 0-0.4 can be used, and the following formula can be used:
[0092] max(min((25-number of nodes / 100-max(CPU utilization, MEM utilization, pod utilization)*weight-cluster weight+user weight) / 100, 0.4), 0);
[0093] Among them, if there is a business cluster that needs to be gradually withdrawn from the network, its dynamic low water mark value can be forcibly set to 0 to achieve the purpose of gradually withdrawing cluster machines from the network.
[0094] It is worth mentioning that the water level value in this application can be adjusted according to the set scheduled tasks or triggered tasks. After Redis-scheduler completes the unified setting of the dynamic water level values of multiple clusters, node-level resource fragmentation is performed, and the migratable pods are screened on the nodes in the same area, and the pods are migrated through the load optimization scheduling algorithm. The specific implementation is to obtain the distribution of all resources of the batch of nodes, specifically the allocation number of CPU, MEM or pod, based on the highest allocation amount. Sort the indicators from large to small, and set the number of nodes that need to be below the water level.
[0095] Therefore, the above-mentioned embodiments of the present application, through the setting of dynamic water levels of multiple clusters and the defragmentation of each cluster node based on the water level setting, can calculate the usage of resources such as CPU, MEM, POD, etc., adjust Pod tasks in time according to different resource utilization conditions, optimize node resource usage, and reduce node resource usage costs.
[0096] like Figure 5 As shown, the embodiment of the present application further provides a cluster task scheduling device 200, the device comprising:
[0097] A first determination module 201 is used to determine a set of key factors corresponding to the target service according to service request information of the target service and existing network load information;
[0098] A second determination module 202, configured to determine a target business cluster from the at least two business clusters in the multi-cloud cluster according to the key factor set and preset factor sets respectively corresponding to the at least two business clusters in the multi-cloud cluster;
[0099] The service delivery module 203 is used to deliver the target service to the target service cluster.
[0100] Optionally, the multi-cloud cluster includes a management cluster and the at least two business clusters, the management cluster includes a first management cluster and a second management cluster, the first management cluster is at least used to schedule the second management cluster and at least one of the target management clusters, the second management cluster is at least used to schedule the target management cluster, and the target management cluster is at least one business cluster of the at least two business clusters.
[0101] Optionally, the first determining module 201 includes:
[0102] A first determination unit is used to determine, based on the service request information and the existing network load information, a key factor corresponding to each service factor in at least one service factor; wherein the at least one service factor includes any one or more of the task load, the container orchestration engine K8s type, the type of the target service, the area of the target service, and the usage mode of the target service;
[0103] The set construction unit is used to construct the key factor set based on the key factors respectively corresponding to each business factor in the at least one business factor.
[0104] Optionally, the second determining module 202 includes:
[0105] A factor acquisition module, used to acquire a preset factor set corresponding to each of the at least two business clusters, wherein the preset factor set includes a preset factor corresponding to at least one business factor; wherein the preset factor is used to indicate the degree of adaptation of the business cluster in aspects related to the business factor corresponding to the preset factor;
[0106] A second determining unit, configured to determine a service coefficient corresponding to each service cluster in the at least two service clusters according to the key factor set and the preset factor set;
[0107] A third determining unit is configured to determine the service cluster with the highest service coefficient among the at least two service clusters as the target service cluster.
[0108] Optionally, the cluster task scheduling device 200 further includes:
[0109] A third determination module, configured to determine the water level value corresponding to each node in the at least two service clusters according to the scheduling information and the historical load information of the historical services;
[0110] A task migration module, used for migrating the limited task pod in the second node to the third node when the number of first nodes in the at least two business clusters is less than the first number, the first node is a node in the at least two business clusters whose water level value is lower than the first preset water level value, the first number is determined based on resource distribution information of multiple nodes in the at least two business clusters, the second node is a node in the at least two business clusters whose water level value is within the first range, and the third node is a node in the at least two business clusters whose water level value is within the second range;
[0111] Among them, the minimum value of the first range is greater than the first preset water level value, the maximum value of the first range is less than the second preset water level value, the minimum value of the second range is greater than the second preset water level value, the maximum value of the first range is less than the third preset water level value, and the third preset water level value is greater than the first preset water level value.
[0112] Optionally, the third determining module includes:
[0113] An information acquisition unit, configured to acquire resource scheduling information and historical load information of the historical services related to each node in the at least two service clusters, wherein the scheduling information of the historical services includes at least one of a central processing unit (CPU) utilization, a memory utilization, and a pod utilization of the node;
[0114] a fourth determining unit, configured to determine a resource utilization rate of each node in the at least two service clusters based on the resource scheduling information of the historical service;
[0115] a fifth determining unit, configured to determine that the nodes in the at least two service clusters whose resource utilization is greater than or equal to the preset utilization are high-water nodes, and to determine that the nodes in the at least two service clusters whose resource utilization is less than the preset utilization are low-water nodes;
[0116] a sixth determining unit, configured to determine a water level value corresponding to the high water level node according to the historical load information and one of the CPU utilization, memory utilization, and pod utilization of the high water level node;
[0117] The seventh determination unit is used to determine the water level value corresponding to the low water level node according to the historical load information and one of the CPU utilization, memory utilization and pod utilization of the low water level node.
[0118] It should be noted that this embodiment is Figure 1 The implementation in the embodiment shown corresponds to the device side embodiment, and its specific implementation can be found in Figure 1 In order to avoid repeated description, the relevant description of the embodiment shown is not repeated in this embodiment.
[0119] See also Figure 6 , Figure 6 It is a structural diagram of an electronic device provided in an embodiment of the present application, wherein the electronic device comprises: a processor 300, a memory 320, and a program or instruction stored in the memory 320 and executable on the processor 300, wherein the processor 300 is used to read the program or instruction in the memory 320; the electronic device also comprises a bus interface and a transceiver 310.
[0120] The transceiver 310 is configured to receive and send data under the control of the processor 300 .
[0121] Among them, Figure 6 In the embodiment, the bus architecture may include any number of interconnected buses and bridges, specifically linking together various circuits of one or more processors represented by processor 300 and memory represented by memory 320. The bus architecture may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are well known in the art and are therefore not further described herein. The bus interface provides an interface. The transceiver 310 may be a plurality of components, namely, a transmitter and a transceiver, providing a unit for communicating with various other devices on a transmission medium. The processor 300 is responsible for managing the bus architecture and general processing, and the memory 320 may store data used by the processor 300 when performing operations.
[0122] The processor 300 is used to read the program or instruction in the memory 320 and execute the following steps:
[0123] Determine a set of key factors corresponding to the target service according to service request information of the target service and existing network load information;
[0124] Determining a target business cluster from the at least two business clusters according to the key factor set and preset factor sets respectively corresponding to at least two business clusters in the multi-cloud cluster;
[0125] The target service is sent to the target service cluster through the transceiver 310 .
[0126] Optionally, the multi-cloud cluster includes a management cluster and the at least two business clusters, the management cluster includes a first management cluster and a second management cluster, the first management cluster is at least used to schedule the second management cluster and at least one of the target management clusters, the second management cluster is at least used to schedule the target management cluster, and the target management cluster is at least one business cluster of the at least two business clusters.
[0127] Optionally, the processor 300 is configured to read a program or instruction in the memory 320 and perform the following steps:
[0128] Based on the service request information and the existing network load information, determine the key factors corresponding to each service factor in at least one service factor; wherein the at least one service factor includes any one or more of the task load, the container orchestration engine K8s type, the type of the target service, the area of the target service, and the usage mode of the target service;
[0129] The key factor set is constructed based on the key factors respectively corresponding to each business factor in the at least one business factor.
[0130] Optionally, the processor 300 is configured to read a program or instruction in the memory 320 and perform the following steps:
[0131] Acquire a preset factor set corresponding to each of the at least two service clusters, the preset factor set including a preset factor corresponding to at least one service factor; wherein the preset factor is used to indicate the degree of adaptation of the service cluster in aspects related to the service factor corresponding to the preset factor;
[0132] Determining, according to the key factor set and the preset factor set, a business coefficient corresponding to each of the at least two business clusters;
[0133] The service cluster with the highest service coefficient among the at least two service clusters is determined as the target service cluster.
[0134] Optionally, the processor 300 is configured to read a program or instruction in the memory 320, and further execute the following steps:
[0135] Determine the water level value corresponding to each node in the at least two service clusters according to the scheduling information and the historical load information of the historical services;
[0136] In the case where the number of first nodes in the at least two business clusters is less than the first number, the limited task pod in the second node is migrated to the third node through the transceiver 310, the first node is a node in the at least two business clusters whose water level value is lower than the first preset water level value, the first number is determined based on resource distribution information of multiple nodes in the at least two business clusters, the second node is a node in the at least two business clusters whose water level value is in the first range, and the third node is a node in the at least two business clusters whose water level value is in the second range;
[0137] Among them, the minimum value of the first range is greater than the first preset water level value, the maximum value of the first range is less than the second preset water level value, the minimum value of the second range is greater than the second preset water level value, the maximum value of the first range is less than the third preset water level value, and the third preset water level value is greater than the first preset water level value.
[0138] Optionally, the processor 300 is configured to read a program or instruction in the memory 320 and perform the following steps:
[0139] Obtain resource scheduling information and the historical load information of the historical services related to each node in the at least two service clusters, wherein the scheduling information of the historical services includes at least one of a central processing unit (CPU) utilization, a memory utilization, and a pod utilization of the node;
[0140] Determining resource utilization of each node in the at least two service clusters based on the resource scheduling information of the historical service;
[0141] Determine the nodes in the at least two service clusters whose resource utilization is greater than or equal to the preset utilization as high-water mark nodes, and determine the nodes in the at least two service clusters whose resource utilization is less than the preset utilization as low-water mark nodes;
[0142] Determine a water level value corresponding to the high water level node according to the historical load information and one of the CPU utilization, memory utilization, and pod utilization of the high water level node;
[0143] The water level value corresponding to the low water level node is determined according to the historical load information and one of the CPU utilization, memory utilization, and pod utilization of the low water level node.
[0144] It should be noted that the electronic device in the embodiment of the present application can achieve Figure 1 The various processes implemented in the cluster task scheduling method embodiment shown can achieve the same beneficial effects, and will not be described again here to avoid repetition.
[0145] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above Figure 1 The various processes of the cluster task scheduling method embodiment shown in the figure can achieve the same technical effect, and are not repeated here to avoid repetition. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0146] The present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the above Figure 1 The various processes of the method embodiment shown can achieve the same technical effect, and will not be described again here to avoid repetition.
[0147] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0148] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0149] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A cluster task scheduling method, characterized in that: The method comprises: Determine a set of key factors corresponding to the target service according to service request information of the target service and existing network load information; Determining a target business cluster from the at least two business clusters according to the key factor set and preset factor sets respectively corresponding to at least two business clusters in the multi-cloud cluster; The target service is sent to the target service cluster.
2. The method according to claim 1, characterized in that The multi-cloud cluster includes a management cluster and the at least two business clusters, the management cluster includes a first management cluster and a second management cluster, the first management cluster is at least used to schedule at least one of the second management cluster and a target management cluster, the second management cluster is at least used to schedule the target management cluster, and the target management cluster is at least one business cluster of the at least two business clusters.
3. The method according to any one of claims 1 to 2, characterized in that The determining, according to the service request information of the target service and the existing network load information, a set of key factors corresponding to the target service includes: Based on the service request information and the existing network load information, determine the key factors corresponding to each service factor in at least one service factor; wherein the at least one service factor includes any one or more of the task load, the container orchestration engine K8s type, the type of the target service, the area of the target service, and the usage mode of the target service; The key factor set is constructed based on the key factors respectively corresponding to each business factor in the at least one business factor.
4. The method according to claim 3, characterized in that The determining a target business cluster from the at least two business clusters according to the key factor set and preset factor sets respectively corresponding to the at least two business clusters in the multi-cloud cluster includes: Acquire a preset factor set corresponding to each of the at least two service clusters, the preset factor set including a preset factor corresponding to at least one service factor; wherein the preset factor is used to indicate the degree of adaptation of the service cluster in aspects related to the service factor corresponding to the preset factor; Determining, according to the key factor set and the preset factor set, a business coefficient corresponding to each of the at least two business clusters; The service cluster with the highest service coefficient among the at least two service clusters is determined as the target service cluster.
5. The method according to claim 1, characterized in that The method further comprises: Determine the water level value corresponding to each node in the at least two service clusters according to the scheduling information and the historical load information of the historical services; In the case where the number of first nodes in the at least two business clusters is less than the first number, the limited task pod in the second node is migrated to the third node, the first node is a node in the at least two business clusters whose water level value is lower than the first preset water level value, the first number is determined based on resource distribution information of multiple nodes in the at least two business clusters, the second node is a node in the at least two business clusters whose water level value is in the first range, and the third node is a node in the at least two business clusters whose water level value is in the second range; Among them, the minimum value of the first range is greater than the first preset water level value, the maximum value of the first range is less than the second preset water level value, the minimum value of the second range is greater than the second preset water level value, the maximum value of the first range is less than the third preset water level value, and the third preset water level value is greater than the first preset water level value.
6. The method according to claim 5, characterized in that The determining, according to the scheduling information and the historical load information of the historical services, the water level value corresponding to each node in the at least two service clusters, includes: Obtain resource scheduling information and the historical load information of the historical services related to each node in the at least two service clusters, wherein the scheduling information of the historical services includes at least one of a central processing unit (CPU) utilization, a memory utilization, and a pod utilization of the node; Determining resource utilization of each node in the at least two service clusters based on the resource scheduling information of the historical service; Determine the nodes in the at least two service clusters whose resource utilization is greater than or equal to the preset utilization as high-water mark nodes, and determine the nodes in the at least two service clusters whose resource utilization is less than the preset utilization as low-water mark nodes; Determine a water level value corresponding to the high water level node according to the historical load information and one of the CPU utilization, memory utilization, and pod utilization of the high water level node; The water level value corresponding to the low water level node is determined according to the historical load information and one of the CPU utilization, memory utilization, and pod utilization of the low water level node.
7. A cluster task scheduling device, characterized in that: include: A first determination module is used to determine a set of key factors corresponding to the target service according to service request information of the target service and existing network load information; A second determination module is used to determine a target business cluster from the at least two business clusters in the multi-cloud cluster according to the key factor set and preset factor sets respectively corresponding to the at least two business clusters in the multi-cloud cluster; The service delivery module is used to deliver the target service to the target service cluster.
8. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the cluster task scheduling method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the cluster task scheduling method according to any one of claims 1 to 6 are implemented.
10. A computer program product, characterized in that The method comprises computer instructions, which, when executed by a processor, implement the steps of the cluster task scheduling method as claimed in any one of claims 1 to 6.