A scheduling method of application cluster, storage medium and electronic device
By generating an evaluation feature set and performing real-time resource matching, a suitable server cluster is selected, solving the problem of inaccurate scheduling results in existing technologies and achieving efficient scheduling for service-oriented and computing applications.
Patent Information
- Application Number
- CN202410662760.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2025-12-05
- Estimated Expiration
- 2044-05-27
AI Technical Summary
Existing server cluster scheduling methods fail to take into account the different resource requirements of different types of applications, resulting in inaccurate scheduling results and the inability to load and run the corresponding applications in a timely and effective manner.
An evaluation feature set is generated using historical data, including cluster pressure features, resource features, and network topology features. An initial target application cluster is selected using a decision tree model, and the target scheduling server is determined by matching real-time resource supply and demand profiles.
It improves the scheduling accuracy of service-oriented and compute-oriented applications, prevents call failures caused by differences in server state, and ensures that applications run efficiently on appropriate servers.
Smart Images

Figure CN118484302B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of server scheduling, in particular to a scheduling method of application cluster, a storage medium and an electronic device. BACKGROUND
[0002] Server cluster scheduling refers to, in a cluster environment composed of multiple servers, efficiently and reasonably allocating and managing various resources (such as computing resources, storage resources, network resources, etc.) through specific scheduling algorithms and management software, to meet the running needs of various work tasks (such as application programs, services, data processing tasks, etc.), while ensuring the overall performance, availability, efficiency and fairness of the cluster.
[0003] Although the existing server cluster scheduling system has greatly improved resource utilization, service response speed and system stability, it still has some inherent drawbacks and challenges. For example, in the scheduling process, the differences in the demand for corresponding resources of each type of application in the server cluster are not considered in detail, and the same scheduling standard is used to select the servers in the cluster. However, for service-type applications and computing-type applications, their characteristics during work are different, and the types of resources they demand are also different. Therefore, the existing scheduling method may lead to inaccurate final scheduling results, and thus cannot timely and effectively load and run the corresponding applications. SUMMARY
[0004] To solve the above technical problems, the technical solution adopted by the present application is as follows:
[0005] According to one aspect of the present application, a scheduling method of application cluster is provided, which is applied to a server cluster including multiple application clusters and multiple computing clusters. The method includes the following steps:
[0006] In response to a creation request of a service-type application, an optimal application cluster is evaluated to screen out an initial target application cluster from the multiple application clusters. The optimal application cluster evaluation is used to determine whether the cluster meets the scheduling condition according to the historical information of the cluster.
[0007] Each server in each initial target application cluster is pre-scheduled to determine a target scheduling server from the initial target application cluster. The pre-scheduling is used to determine the target scheduling server according to the matching degree of the real-time resource supply portrait of the server and the real-time resource demand portrait of the application.
[0008] A scheduling request is sent to the apiserver of the target scheduling server to create a service-type application in the target scheduling server.
[0009] The optimal application cluster evaluation includes:
[0010] According to historical data, an evaluation feature set corresponding to each application cluster is generated, and the evaluation feature set includes a cluster stress feature subvector, a cluster resource feature subvector, and a cluster interconnection network topology relationship feature subvector.
[0011] The cluster stress feature subvector includes historical CPU usage, historical memory usage, historical connection number, historical QPS, and historical soft interrupt number.
[0012] The cluster resource feature subvector includes historical network connection timeout state information and historical memory overflow state information.
[0013] The cluster interconnection network topology relationship feature subvector includes historical inter-cluster connection hop number information and historical cluster communication delay information.
[0014] Each evaluation feature set is input into a target evaluation decision tree model to generate an evaluation result of whether each evaluation feature set corresponds to an application cluster that meets a scheduling condition.
[0015] The application cluster that meets the scheduling condition is used as an initial target application cluster.
[0016] According to a second aspect of the present application, a non-transitory computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the application cluster scheduling method.
[0017] According to a third aspect of the present application, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the application cluster scheduling method when executing the computer program.
[0018] The present application has at least the following beneficial effects:
[0019] In the present application, when the clusters are evaluated and screened, the initial target application cluster that is more suitable for service-type application scheduling is screened out according to the performance of each cluster in the historical data. Then, the target scheduling server is determined according to the matching degree of the real-time resource supply portrait of each server in the initial target application cluster and the real-time resource demand portrait of the application through pre-scheduling. Therefore, the initial target application cluster can be screened and determined through historical data. At the same time, in order to prevent the current server state from being different from the state shown by the historical data, thereby causing a call failure, the target scheduling server is further determined through real-time data. Therefore, through the screening and matching of data in two different time dimensions, the appropriate server for service-type application scheduling can be more accurately determined.
[0020] And, when performing the preferred application cluster evaluation, the input features of the prediction are configured from three dimensions of cluster stress features, cluster resource features and inter-cluster network topology relationship features respectively. Since, the service-type application generally refers to the application program and server type focusing on providing service functions, and their design and optimization target is to provide stable and efficient service response to external users. In the present application, the cluster stress features can generally reflect the busy state and load pressure of the cluster; the cluster resource features can generally reflect the health state of each entity of the cluster through the historical log, and then reflect the stability of the cluster; the inter-cluster network topology relationship features can generally reflect the smoothness of cluster communication and the timeliness of request response. Therefore, the above three dimensional feature data can more accurately determine the cluster that meets the service-type application scheduling. BRIEF DESCRIPTION OF DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiment description. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0022] Figure 1 A flowchart of the scheduling method of the application cluster provided by the embodiment of the present application is shown in the figure.
[0023] Figure 2 A flowchart of the scheduling method of the computing cluster provided by the embodiment of the present application is shown in the figure.
[0024] Figure 3 A flowchart of the multi-type cluster cooperative scheduling method provided by the embodiment of the present application is shown in the figure.
[0025] Figure 4 A flowchart of the scheduling method based on server idle resources provided by the embodiment of the present application is shown in the figure. DETAILED DESCRIPTION
[0026] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings of the embodiments of the present application. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0027] As a possible embodiment of the present application, as shown in Figure 1 A scheduling method of an application cluster is provided, which is applied to the scheduling work of a server cluster, and the server cluster includes a plurality of application clusters and a plurality of computing clusters.
[0028] The method comprises the following steps:
[0029] S100: In response to a creation request of a service type application, performing preferred application cluster evaluation on a plurality of application clusters to screen an initial target application cluster from the plurality of application clusters. The preferred application cluster evaluation is used to determine whether the cluster meets a scheduling condition according to historical information of the cluster.
[0030] The preferred application cluster evaluation comprises:
[0031] S101: According to historical data, generating an evaluation feature set corresponding to each application cluster, the evaluation feature set comprising a cluster pressure feature sub-vector, a cluster resource feature sub-vector and an inter-cluster network topology relationship feature sub-vector.
[0032] Specifically, the evaluation feature set can be an evaluation feature vector, which is spliced by the cluster pressure feature sub-vector, the cluster resource feature sub-vector and the inter-cluster network topology relationship feature sub-vector.
[0033] The cluster pressure feature sub-vector comprises historical CPU usage, historical memory usage, historical connection number, historical QPS (Queries-per-second) and historical soft interrupt number.
[0034] In the Linux kernel, the number of soft interrupts is defined by the macro NR_SOFTIRQS. Soft interrupts are managed by the softirq_vec array, and the size of this array depends on the value of NR_SOFTIRQS. Each soft interrupt corresponds to an element in the array, representing a specific type of deferred task, such as network packet processing (NET_RX_SOFTIRQ), timer events (HI_SOFTIRQ and TIMER_SOFTIRQ), etc. The exact number of soft interrupts should be checked in the corresponding Linux kernel source code or recorded by the corresponding monitoring components.
[0035] The cluster resource feature sub-vector comprises historical network connection timeout state information and historical memory overflow state information.
[0036] The inter-cluster network topology relationship feature sub-vector comprises historical inter-cluster connection hop count information and historical cluster communication delay information.
[0037] Specifically, the acquisition method of each feature sub-vector in S101 is as follows:
[0038] The acquisition of the cluster pressure feature sub-vector can be performed according to the following method:
[0039] S111: Obtain a historical data sequence of CPU usage, memory usage, connection number, QPS, and soft interrupt number corresponding to the application cluster generated in a first preset historical statistical period, respectively.
[0040] S121: According to the values in each historical data sequence, generate feature values corresponding to CPU usage, memory usage, connection number, QPS, and soft interrupt number, respectively, and generate a cluster pressure feature sub-vector. The feature values include: average value or maximum value or minimum value or standard deviation.
[0041] The acquisition of the cluster resource feature sub-vector can be performed according to the following method:
[0042] S131: Obtain historical log data generated by the application cluster in the first preset historical statistical period through the log management system.
[0043] S141: Perform named entity recognition on the historical log data using the bert model to extract target named entities and their current states. The target named entities and their current states include: network connection entities and their corresponding timeout states, and memory entities and their corresponding overflow states.
[0044] This step is a named entity recognition process, which specifically identifies multiple entities and the relationships between entities in the log to infer whether certain states of the server (such as network connection timeout state and memory overflow state) are healthy.
[0045] For example, taking a line of normal log: 2024-04-23T06:57:01.354948078Z SLF4J:Class path contains multiple SLF4J bindings as an example, it can be identified that the entities are Class, path, SLF4J, and bindings. These key entity information and the relationship between entities can indicate that the relationship is healthy.
[0046] S151: Use one-hot encoding technology to one-hot encode each entity state to generate a binary vector. The length of the binary vector is equal to the total number of all entity types.
[0047] S161: Map the binary vector to a fixed-length low-dimensional real vector through embedding mapping.
[0048] S171: Combine multiple low-dimensional real vectors into a cluster resource feature sub-vector by averaging, and the cluster resource feature sub-vector includes historical network connection timeout state information and historical memory overflow state information.
[0049] S131 to S171 are essentially a processing procedure of named entity recognition-entity vectorization-vector unification, specifically, after the named entity recognition of the log, the entities and their relationships are combined into a vector, then the embedding vectorization is performed, and then the vectors are combined into a vector by averaging, and the vector is subsequently spliced with other data and put into the decision tree.
[0050] After processing through S131 to S171, the entities and their states extracted from the log can be encoded using One-Hot Encoding, and finally the category type data vector is converted into a numerical type vector for subsequent calculation and use.
[0051] For obtaining the cluster resource feature sub-vector
[0052] For obtaining the inter-cluster network topology relationship feature sub-vector, the following method can be used:
[0053] S181: According to the topology connection relationship between the application cluster and other application clusters in the first preset historical statistical period, the network topology ID corresponding to the application cluster is generated. The network topology ID is used to represent the connection hop relationship of the corresponding application cluster and the remaining application clusters when communicating. When the entire cluster deployment is completed, the network topology relationship of the servers in each cluster is also completely determined, and the corresponding network topology ID is also determined.
[0054] An example of network topology ID is given: assuming there are 3 clusters, cluster 1-3, the network topology ID of cluster 1 may be represented as [0, 1, 1] or [0, 1, 2] or [0, 2, 1].
[0055] S191: According to the communication data of the application cluster in the first preset historical statistical period, the cluster communication delay information corresponding to the application cluster is generated. The first preset historical statistical period is the same as the second preset historical statistical period, which can be 15 days.
[0056] S1101: According to the network topology ID and the cluster communication delay information corresponding to the application cluster, the inter-cluster network topology relationship feature sub-vector is generated. The inter-cluster network topology relationship feature sub-vector includes the historical inter-cluster connection hop information and the historical cluster communication delay information.
[0057] Processing of missing values in the feature set:
[0058] For numerical features, the average value of the corresponding feature is used for filling.
[0059] For category type data processed by One-Hot Encoding, missing values are treated as an independent category for encoding.
[0060] S102: input each evaluation feature set into the target evaluation decision tree model, and generate an evaluation result of whether the application cluster corresponding to each evaluation feature set meets the scheduling condition.
[0061] S103: take the application cluster meeting the scheduling condition as the initial target application cluster.
[0062] In this fact instance, the evaluation prediction is performed by using the decision tree. Since the decision tree is trained, a better prediction effect can be obtained by using fewer samples (about 200), so as to meet the use of the current scene. Thus, the required result can be obtained at a smaller cost.
[0063] S200: pre-schedule each server in each initial target application cluster to determine a target scheduling server from the initial target application cluster. The pre-scheduling is used to determine the target scheduling server according to the matching degree of the real-time resource supply portrait of the server and the real-time resource demand portrait of the application.
[0064] S300: send a scheduling request to the apiserver of the target scheduling server to create a service-type application in the target scheduling server.
[0065] In this embodiment, when the clusters are evaluated and screened, the initial target application cluster more suitable for service-type application scheduling is first screened out according to the performance of each cluster in the historical data. Then, the target scheduling server is determined according to the matching degree of the real-time resource supply portrait of each server in the initial target application cluster and the real-time resource demand portrait of the application through pre-scheduling. Thus, the initial target application cluster can be screened and determined through the historical data. At the same time, in order to prevent the current server state from being different from the state shown by the historical data, and thus causing the call to fail, the target scheduling server is further determined through real-time data. Thus, through the screening and matching of data in two different time dimensions, the appropriate server for service-type application scheduling can be more accurately determined.
[0066] Further, when performing the preferred application cluster evaluation, the input features of the prediction are configured from three dimensions of cluster stress features, cluster resource features and inter-cluster network topology relationship features. Since service-type applications generally refer to application programs and servers that focus on providing service functions, their design and optimization goals are to provide stable and efficient service response to external users. In the present application, the cluster stress features can generally reflect the busy state and load pressure of the cluster; the cluster resource features can generally reflect the health status of each entity in the cluster through historical logs, thereby reflecting the stability of the cluster; and the inter-cluster network topology relationship features can generally reflect the smoothness of cluster communication and the timeliness of request response. Thus, the above three dimensions of feature data can more accurately determine the cluster that meets the scheduling of service-type applications.
[0067] As another embodiment of the present application, as shown in Figure 2 A scheduling method for computing clusters is also provided, which is also applied to the scheduling of server clusters, and the server clusters include a plurality of computing clusters and a plurality of computing clusters.
[0068] The scheduling method includes the following steps:
[0069] W100: In response to a creation request of a computing-type application, performing preferred computing cluster evaluation on the plurality of computing clusters to screen out an initial target computing cluster from the plurality of computing clusters. The preferred computing cluster evaluation is used to determine whether the cluster meets the scheduling condition according to historical information of the cluster.
[0070] Specifically, the preferred computing cluster evaluation includes:
[0071] W101: According to historical data, generating an evaluation feature set corresponding to each computing cluster, the evaluation feature set including a cluster storage-computing resource topology ID, a cluster historical task average processing time, a cluster historical computing accuracy and a cluster stress feature sub-vector.
[0072] The evaluation feature set can be an evaluation feature vector, which is integrated by concatenating the storage-computing resource topology ID, the cluster historical task average processing time, the cluster historical computing accuracy and the cluster stress feature sub-vector.
[0073] The cluster storage-computing resource topology ID is used to indicate the storage location of the data required by the computing-type application in each computing cluster.
[0074] The cluster stress feature sub-vector includes a historical CPU usage, a historical memory usage, a historical connection number, a historical QPS and a historical soft interrupt number.
[0075] Specifically, the acquisition method of each feature sub-vector in W101 is as follows:
[0076] The obtaining of the cluster storage and computing resource topology ID can be performed according to the following steps:
[0077] The position of the data required by the application in the cluster can be obtained through the topology structure managed in the management component of the cluster, and a server ID, that is, the cluster storage and computing resource topology ID, is obtained. The ID is a manually defined mapping relationship.
[0078] The obtaining of the cluster historical task average processing duration and the cluster historical computing accuracy can be performed according to the following steps:
[0079] W111: Obtain the processing duration of all tasks corresponding to the computing cluster in the second preset historical statistical period.
[0080] W121: Take the average of the processing duration of all tasks as the cluster historical task average processing duration.
[0081] W131: Obtain the computing result of all tasks corresponding to the computing cluster in the second preset historical statistical period.
[0082] W141: Generate the cluster historical computing accuracy according to the computing result of all tasks.
[0083] The basic data of the cluster historical task average processing duration and the cluster historical computing accuracy come from the monitoring component, and the accuracy of the running result of the historical task of the cluster (if any) is counted. This part mainly reflects whether the computing result error caused by possible resource competition exists when the computing pressure exists in the cluster.
[0084] The obtaining of the cluster pressure feature sub-vector can be performed according to the following steps:
[0085] W151: Obtain the historical data sequence of the CPU usage rate, the memory usage rate, the connection number, the QPS and the soft interrupt number corresponding to the computing cluster in the second preset historical statistical period respectively.
[0086] W161: Generate the feature value corresponding to the CPU usage rate, the memory usage rate, the connection number, the QPS and the soft interrupt number according to the value in each historical data sequence, and generate the cluster pressure feature sub-vector. The feature value includes: average value or maximum value or minimum value or standard deviation.
[0087] The obtaining of the cluster pressure feature sub-vector can refer to S111 and S121 in the above embodiment.
[0088] W102: Input each evaluation feature set into the target evaluation decision tree model to generate the evaluation result of whether the computing cluster meets the scheduling condition corresponding to each evaluation feature set.
[0089] W103: The computing cluster meeting the scheduling condition is taken as an initial target computing cluster.
[0090] W200: Each server in each initial target computing cluster is pre-scheduled to determine a target scheduling server from the initial target computing cluster. The pre-scheduling is used to determine the target scheduling server according to the matching degree of the cluster real-time resource supply profile and the application real-time resource demand profile.
[0091] W300: A scheduling request is sent to an apiserver of the target scheduling server to create a computing application in the target scheduling server.
[0092] In the embodiment, when the clusters are evaluated and screened, the initial target application cluster more suitable for the scheduling of the computing application is first screened out through the performance of each cluster in the historical data. Then, the target scheduling server is determined according to the matching degree of the real-time resource supply profile of each server in the initial target application cluster and the real-time resource demand profile of the application. Thus, the initial target application cluster can be screened and determined through the historical data. At the same time, in order to prevent the current server state from being different from the state shown by the historical data, and thus causing the call to fail, the target scheduling server is further determined through real-time data. Thus, through the screening and matching of data in two different time dimensions, the suitable server for the scheduling of the computing application can be more accurately determined.
[0093] In addition, when the preferred application cluster is evaluated, the input features of the prediction are configured through multiple dimensions of the cluster storage and computing resource topology ID, the cluster historical task average processing time, the cluster historical computing accuracy and the cluster pressure feature sub-vector. Since the computing application mainly focuses on processing a large number of computing-intensive tasks, the design focus is to maximize the use of computing resources for complex computing or data analysis, and more attention is paid to the timeliness and accuracy of computing and the smoothness of obtaining related data participating in computing. In the present application, the cluster storage and computing resource topology ID can roughly reflect the storage location of the related data participating in computing, and thus can reflect the smoothness of obtaining the related data participating in computing in the cluster; the cluster historical task average processing time and the cluster historical computing accuracy can roughly reflect and pay more attention to the timeliness and accuracy of computing; and the cluster pressure feature can roughly reflect the busy state and load pressure of the cluster. Thus, the cluster suitable for the scheduling of the computing application can be more accurately determined through the feature data in the above multiple dimensions.
[0094] As another embodiment of the present application, the pre-scheduling includes:
[0095] S201: Obtain an application resource demand profile vector corresponding to the service-type application. The application resource demand profile vector includes CPU demand information, memory demand information, application role information and application dependency information.
[0096] S201 comprises:
[0097] S211: using svm (Support Vector Machine), the historical information sequence corresponding to the CPU requirement information, the memory requirement information, the application role information and the application dependency information of the service type application respectively, a fitting expected value corresponding to each is generated.
[0098] S221: using the fitting expected value corresponding to the CPU requirement information, the memory requirement information, the application role information and the application dependency information respectively, an application resource demand portrait vector corresponding to the service type application is generated.
[0099] Thus, through svm, a near-fitting expected value is obtained based on the historical information sequence of each index, and then a corresponding length vector can be formed.
[0100] S202: obtaining the server real-time resource supply portrait vector corresponding to each server in the initial target application cluster. The server real-time resource supply portrait vector includes: CPU available information, GPU available information, memory available information, server storage and computing topology ID and server network topology ID.
[0101] Taking the server cluster as an example, S202 comprises:
[0102] S212: through the resource monitoring component, the CPU available information, the GPU available information and the memory available information of each server are obtained.
[0103] S222: through the management component of the k8s cluster, the server storage and computing topology ID of each server is obtained.
[0104] S232: according to the communication network topology design of the servers in the cluster, the network topology ID of each server is obtained.
[0105] The server real-time resource supply portrait vector is generated through a series of current indicators. Among them, CPU, GPU and memory are obtained from monitoring indicators, and storage and computing topology ID returns device ID. The ID information is obtained from the management component of k8s.
[0106] S203: after splicing the application resource demand portrait vector with each server real-time resource supply portrait vector respectively, inputting into the target transformer model, the result of whether each server in the initial target application cluster meets the application loading condition is generated.
[0107] Specifically, the application resource demand portrait vector is spliced with each server real-time resource supply portrait vector, and then a normalized vector is obtained through embedding logic, and then the normalized vector is input into a trained encoder transformer for output prediction.
[0108] S204: Simultaneously performing simulation loading test and real loading test on the service-type application that meets the application loading condition to generate simulation loading result and real loading result. The simulation loading test speed is greater than the real loading test speed.
[0109] The simulation loading test can be implemented through an existing mock simulation test module. The real loading test is to load the corresponding application on the corresponding server and perform corresponding stress test to observe whether the server can run stably.
[0110] Specifically, since the simulation loading test speed is greater than the real loading test speed, the simulation loading result can be obtained earlier. If the simulation loading running result is unsuccessful, the time interval for waiting for the real loading running result can be used to directly execute the steps of S400 to S600 to perform the scaling and rescheduling processing on the scalable application. If the real loading running result is also unsuccessful, the scaling and rescheduling processing is performed in advance, and the processing time is saved, so that the application can be loaded and run more timely.
[0111] S205: If the simulation loading result and the real loading result are both application loading running successful, the corresponding server is determined as the target scheduling server to determine the target scheduling server from the initial target application cluster.
[0112] In this embodiment, the target scheduling server is determined according to the matching degree of the real-time resource supply portrait of each server in the initial target application cluster and the real-time resource demand portrait of the application. Therefore, through more accurate real-time data that fits the actual situation, the matching degree between each server and the corresponding application to be loaded can be more accurately reflected. Therefore, it can be prevented that the current server state is different from the state shown by the historical data, and thus the call failure occurs, and thus the application can be more accurately scheduled to the appropriate server.
[0113] As another possible embodiment of the present application, as Figure 3Also shown, a multi-type cluster cooperative scheduling method is provided for cross-cluster invocation to improve the use sufficiency of servers in each cluster. The server cluster includes a plurality of application clusters, a plurality of computing clusters, and a plurality of standby clusters. The performance of the application clusters and the computing clusters are both greater than the performance of the standby clusters. The application clusters are preferentially used to create service-type applications. The computing clusters are preferentially used to create computing-type applications.
[0114] The method includes the following steps:
[0115] S400: In response to the information that the application cluster cannot meet the service-type application creation condition, obtaining the Qos level of the service-type application. The Qos level includes an application scalable level and an application non-scalable level.
[0116] S500: If the Qos level of the service-type application is the application non-scalable level (i.e., high service level), performing server resource occupation according to the current idle resource view corresponding to the computing cluster, to schedule the resources of the computing cluster to create and load the service-type application.
[0117] S600: If the Qos level of the service-type application is the application scalable level (i.e., low service level), performing scalable rescheduling processing on the service-type application, to schedule the resources in the application cluster or the standby cluster to create and load the scaled service-type application.
[0118] Generally, in order to improve the request processing capability, the service-type application will use the horizontal scaling method in the deployment architecture. Horizontal scaling means increasing more server instances or containers, and each instance runs the same application copy to process more concurrent requests.
[0119] Therefore, reducing a certain number of application copies will not cause the service to be unavailable, but will only reduce the response speed. In the present scenario, the availability of the service needs to be preferentially guaranteed, and thus the success rate of application loading can be improved by scaling to ensure the availability of the service.
[0120] S601: The scalable rescheduling processing includes:
[0121] S602: Reducing the number of copies of the current service-type application to generate a scaled service-type application. In each scalable rescheduling processing, only one copy of the current service-type application is reduced.
[0122] S603: According to the scaled service-type application, pre-scheduling each server in each initial target application cluster to generate a scheduling result corresponding to the scaled service-type application. The scheduling result includes: the application cluster cannot meet the creation condition of the scaled service-type application and a server meets the creation condition of the scaled service-type application.
[0123] S604: The pre-scheduling is used for determining a target scheduling server according to a matching degree of a server real-time resource supply image and an application real-time resource demand image.
[0124] S605: If the scheduling result is that the server meets the creation condition of the scaling-in service type application, a scheduling request is sent to an apiserver of the corresponding server to create the scaling-in service type application in the server.
[0125] S700: If the number of replicas of the current service type application cannot be reduced, a scheduling request is sent to an apiserver of a server in the standby cluster to create the scaling-in service type application in the server in the standby cluster.
[0126] In the embodiment, when the server in the application cluster cannot meet the creation condition of the current service type application, subsequent server calling operations are performed according to a Qos (Quality of Service) level corresponding to the service type application. Specifically, idle resources in the computing cluster are directly called for the application of a level that cannot be scaled in, to complete the smooth loading of the service type application, thereby ensuring the smooth performance of the service. Since the service type application and the computing type application have different task characteristics and functional requirements, the occupation tendency of various resources is different. The service type application usually occupies more network resources and memory resources, and the occupation of computing resources (CPU) is relatively moderate; the computing type application significantly occupies computing resources (especially CPU, GPU and memory). In addition, there is a big difference between the working periods of the service type application and the computing type application. The service type application is usually executed in the daytime when human activities are frequent, while most of the statistical analysis applications in the computing type application are executed at night. Therefore, based on the above two characteristics, there is a high degree of idleness in a part of the computing cluster during the busy period of the service cluster. Therefore, the service type application with high Qos can be preferentially loaded into the computing cluster to ensure the timely availability of the service.
[0127] Meanwhile, for some service type applications with low Qos level (i.e., scaling-in applications), the number of replicas is gradually reduced to re-call the server. Therefore, by actively reducing the resource demand of the service type application, the success rate of scheduling the service cluster is improved. In the case where the application cannot be scaled in again, the service type application with the smallest resource demand is directly loaded into the standby cluster with lower performance to call the bottom. Therefore, the success rate of scheduling the service type application is ensured, thereby ensuring the availability of the service type application. Under this setting, the standby cluster with lower performance can be used, thereby reducing the cost of building a cluster.
[0128] As another possible embodiment of the present application, as Figure 4As shown, a server idle resource-based scheduling method is also provided, the method comprising the following steps:
[0129] Z100: In response to a scheduling request of a target application to a server, obtaining residual quantity information of each type of resource in the server.
[0130] Specifically, the residual quantity information of each type of resource in the server comprises residual quantity information of memory, disk, CPU and GPU in the server. The residual quantity information of each type of resource in the server is the residual quantity of the total quantity of each type of resource in the server after removing the online occupation quantity and the resource reservation quantity.
[0131] Z200: Performing scheduling amplitude configuration processing on the residual quantity information of each type of resource to generate a schedulable quantity of each type of resource.
[0132] The scheduling amplitude configuration processing comprises:
[0133] Z201: If the generation time of the scheduling request of the target application to the server is within [5:00, 23:00], generating the schedulable quantity of each type of resource according to the configuration duration and the resource usage rate of the server. Wherein, the schedulable quantity of the i-th type of resource Q i satisfies the following conditions:
[0134]
[0135] Wherein, Q ID is the unit scheduling resource quantity of the i-th type of resource. t is the configuration duration. P i is the resource usage rate of the i-th type of resource in the server, that is, the usage pressure of the i-th type of resource. Y i 1 is the first usage rate threshold of the i-th type of resource, Y i 1 may be 75%. Y i 2 is the second usage rate threshold of the i-th type of resource, Y i 2 may be 85%. Y i 2 > Y i 1 . Q i Y2 is P i = Y i 2 , the schedulable quantity of the i-th type of resource.
[0136] Z202: If the generation time of the scheduling request of the target application to the server is located in (23:00, 4:40], the schedulable amount of each type of resource is generated according to the configured duration and the resource usage of the server. Wherein, the schedulable amount of the i-th type of resource Q i satisfy the following conditions:
[0137]
[0138] wherein, K i Max is the demand amount of the i-th type of resource declared by the publisher in the target application.
[0139] The scheduling period is added in Z202 and Z203, which is mainly used to distinguish the busy degree of resource. In the higher busy degree [5:00, 23:00], the schedulable amount of resource needs to be configured gradually to prevent the server from causing greater resource pressure. And in the lower busy degree (23:00, 4:40], the corresponding K i Max , the idle resources of the server in this period are more, and the resource pressure of the server is the lowest, so the corresponding K i Max can be directly configured to the application to ensure the timely and normal loading of the application and ensure the normal availability of the service.
[0140] Z300: Load the target application according to the schedulable amount of each type of resource, and detect the usage of each type of resource in the server in real time during the loading process.
[0141] Specifically, taking the server node in the K8s cluster as an example,
[0142] Load according to the schedulable amount of each type of resource, including:
[0143] Z301: Adjust the cgroup allocation of the task corresponding to the target application to gradually allocate the corresponding resources to the task to create and load the target application in the corresponding server.
[0144] Z400: When the usage of any type of resource is greater than the preset usage threshold, delete the loading task of the target application on the server.
[0145] Z500: Set a node cooling period for the server, and prohibit the calling request of the application corresponding to the offline task to the server in the node cooling period. The length of the node cooling period is negatively related to the current resource usage of the server. For example, the node cooling period can be between 5 minutes and 10 minutes.
[0146] In this embodiment, when scheduling and allocating idle resources on the server, the current resource pressure level of each resource on the server is considered, that is, the utilization rate of the corresponding resource on the server. When the resource pressure on the server exceeds a preset utilization rate threshold after allocating the corresponding amount of resources, the target application is removed from the server. This promptly releases the resource pressure on the server to ensure the normal and stable operation of existing applications on the server.
[0147] At the same time, based on the schedulable amount Q of resources i The calculation formula shows that in the initial stage of resource allocation (i.e., P) i <Y i 1 (Time) Q i Growth occurs exponentially to quickly meet the resource requirements of the target application, thereby rapidly loading and running the application and providing timely services. This occurs during the mid-term of resource allocation (i.e., Y). i 1 <P i ≤Y i 2 (Time) Q i The resource allocation is increased slowly in a linear fashion to further meet the resource requirements of the target application while avoiding excessive pressure on the server and reducing the possibility of server crashes. Finally, at the end of the resource allocation process (P... i =Y i 2 (At that time), that is, when the server resource pressure reaches its highest level, Q i The load is instantly reduced to half to quickly relieve server pressure and expel the target application, thereby ensuring the normal operation of the server.
[0148] In addition, prior to S100, W100, and Z100, the scheduling methods also included:
[0149] S110: Retrieve the application type tag corresponding to the application creation request. The type tag includes computational tags, application tags, and user configuration tags.
[0150] S120: If the type tag is a computational tag, then obtain the task execution type tag corresponding to the application. Task execution type tags include: online task type tags and offline task type tags.
[0151] S130: If the task execution type label is an online task type label, then generate a creation request for the corresponding computing application in W100.
[0152] S140: If the task execution type label is an offline task type label, then generate a creation request for the corresponding computing application in Z100.
[0153] Meanwhile, when the computing cluster fails to meet the creation condition of the computing-type application or the application cluster fails to meet the creation condition of the service-type application, a corresponding creation request in Z100 is generated to invoke idle resources in other idle clusters to successfully create and load the application.
[0154] S150: If the type label is an application-type label, a creation request of the service-type application corresponding to the application in S100 is generated.
[0155] Through the screening and shunting processing of S110 to S150 described above, each application can be more appropriately and accurately shunted to different server scheduling processing schemes in the application to ensure that the application can be normally loaded and used.
[0156] In addition, although the various steps of the method in the present disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in this specific order, or that all of the steps shown must be performed to achieve the desired results. In addition or alternatively, some steps can be omitted, multiple steps can be combined into one step, and / or one step can be divided into multiple steps, etc.
[0157] Through the above description of the embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes a number of instructions to make a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) execute the method according to the embodiments of the present disclosure.
[0158] In the example embodiments of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0159] Those skilled in the art can understand that each aspect of the present application can be implemented as a system, a method or a program product. Therefore, each aspect of the present application can be embodied in the form of a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which can be collectively referred to as "circuitry", "module" or "system" here.
[0160] The electronic device according to this embodiment of the present application. The electronic device is only an example, and should not limit the function and use range of the embodiments of the present application.
[0161] The electronic device is in the form of a general purpose computing device. Components of the electronic device can include, but are not limited to, the at least one processor described above, the at least one memory described above, a bus that connects the different system components including the memory and the processor.
[0162] The memory stores a program code that can be executed by the processor, such that the processor performs the steps described in the above "Exemplary Methods" section of this specification according to various exemplary embodiments of the present application.
[0163] The memory can include a readable medium in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and can further include read only memory (ROM).
[0164] The memory can further include a program / utility having a set (at least one) of program modules that include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each or a combination thereof, which may
[0165] The bus can be representative of one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or local bus using any of a variety of bus structures.
[0166] The electronic device can also communicate with one or more external devices (e.g., a keyboard or a pointing device, etc.) that can be coupled to the electronic device through an input / output (I / O) interface. The electronic device can also communicate with one or more devices that enable a user to interact with the electronic device, and / or one or more devices (e.g., a router, a modem, etc.) that enable the electronic device to communicate with one or more other computing devices. Such communication can occur via an I / O interface. The electronic device can also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or the Internet) through a network adapter. It should be appreciated that, although not shown, the electronic device can include additional hardware and / or software modules that can be used in conjunction with the electronic device, such as, but not limited to, microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data archival storage systems, etc.
[0167] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a U disk, a mobile hard disk, etc.) or a network, and includes a plurality of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to perform the method according to the embodiments of the present disclosure.
[0168] In the example embodiments of the present disclosure, a computer readable storage medium is also provided, which stores a program product capable of implementing the above-mentioned method of the present disclosure. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code for causing a terminal device to perform the steps according to various example embodiments of the present disclosure described in the above-mentioned “example method” section of the present disclosure when the program product is run on the terminal device.
[0169] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, be but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0170] The computer readable signal medium can include a data signal propagated in a baseband or as a part of a carrier wave, in which readable program code is borne. Such a propagated data signal can take on multiple forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable signal medium can also be any readable medium other than the readable storage medium, which can send, propagate or transmit the program for use by or in connection with an instruction execution system, apparatus or device.
[0171] The program code contained on the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0172] The program code may be executed by one or more programmable processing devices to perform a set of tasks on a computing device. As used in this description and the accompanying claims, the term "computing device" is intended to encompass any suitable processing device or devices such as, for example, a computer, a server, a computing cluster, a network appliance, a handheld device, a mobile device, a network router, a network switch, a network bridge, or any other suitable processing device or devices. The program code may be executed by one or more programmable processing devices to perform a set of tasks on a computing device. As used in this description and the accompanying claims, the term "computing device" is intended to encompass any suitable processing device or devices such as, for example, a computer, a server, a computing cluster, a network appliance, a handheld device, a mobile device, a network router, a network switch, a network bridge, or any other suitable processing device or devices. The program code may be executed by one or more programmable processing devices to perform a set of tasks on a computing device. As used in this description and the accompanying claims, the term "computing device" is intended to encompass any suitable processing device or devices such as, for example, a computer, a server, a computing cluster, a network appliance, a handheld device, a mobile device, a network router, a network switch, a network bridge, or any other suitable processing device or devices. The program code may be executed by one or more programmable processing devices to perform a set of tasks on a computing device. As used in this description and the accompanying claims, the term "computing device" is intended to encompass any suitable processing device or devices such as, for example, a computer, a server, a computing cluster, a network appliance, a handheld device, a mobile device, a network router, a network switch, a network bridge, or any other suitable processing device or devices.
[0173] Furthermore, the above-described diagrams are merely schematic illustrations of the processes included in the method according to the exemplary embodiments of the present application, and are not intended for limiting purposes. It is readily understood that the processes shown in the above-described diagrams do not indicate or limit the time sequence of the processes. In addition, it is readily understood that the processes can be executed, for example, synchronously or asynchronously in a plurality of modules.
[0174] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, such a division is not mandatory. Indeed, according to embodiments of the present disclosure, the features and functionalities of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functionalities of one module or unit described above can be further divided into embodied by a plurality of modules or units.
[0175] The above merely shows the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any changes or replacements within the technical scope disclosed by the present application can be easily conceived by those skilled in the art. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A scheduling method for application clusters, characterized in that, The application is applied to a server cluster, and the server cluster includes a plurality of application clusters and a plurality of computing clusters; the method comprises the following steps: In response to a creation request of a service-type application, a preferred application cluster evaluation is performed on a plurality of application clusters to screen out an initial target application cluster from the plurality of application clusters; The preferred application cluster evaluation is used to determine whether a cluster meets a scheduling condition according to historical information of the cluster; Each server in each initial target application cluster is pre-scheduled to determine a target scheduling server from the initial target application cluster; The pre-scheduling is used to determine the target scheduling server according to a matching degree of a real-time resource supply portrait of the server and a real-time resource demand portrait of the application; A scheduling request is sent to an api server of the target scheduling server to create the service-type application in the target scheduling server; The preferred application cluster evaluation comprises: According to historical data, an evaluation feature set corresponding to each application cluster is generated, and the evaluation feature set comprises a cluster stress feature sub-vector, a cluster resource feature sub-vector and a cluster interconnection network topology relationship feature sub-vector; The cluster stress feature sub-vector comprises historical CPU usage, historical memory usage, historical connection number, historical QPS and historical soft interrupt number; The cluster resource feature sub-vector comprises historical network connection timeout state information and historical memory overflow state information; The cluster interconnection network topology relationship feature sub-vector comprises historical inter-cluster connection hop number information and historical cluster communication delay information; Each evaluation feature set is input into a target evaluation decision tree model to generate an evaluation result of whether each evaluation feature set corresponds to an application cluster that meets a scheduling condition; An application cluster that meets the scheduling condition is taken as an initial target application cluster.
2. The method of claim 1, wherein, According to historical data, an evaluation feature set corresponding to each application cluster is generated, comprising: Respective historical data sequences of CPU usage, memory usage, connection number, QPS and soft interrupt number corresponding to the application cluster in a first preset historical statistical period are obtained; According to values in each historical data sequence, feature values corresponding to CPU usage, memory usage, connection number, QPS and soft interrupt number are generated, and a cluster stress feature sub-vector is generated; the feature values comprise an average value, a maximum value, a minimum value or a standard deviation.
3. The method of claim 2, wherein, According to historical data, an evaluation feature set corresponding to each application cluster is generated, comprising: Through a log management system, historical log data generated by the application cluster in a first preset historical statistical period is obtained; Using a bert model, named entity recognition is performed on the historical log data to extract target named entities and their current states, including network connection entities and their corresponding timeout states and memory entities and their corresponding overflow states; Each entity state is one-hot encoded using a one-hot encoding technology to generate a binary vector; the length of the binary vector is equal to the total number of all entity types; The binary vector is mapped to a fixed-length low-dimensional real number vector through embedding mapping; The multiple low-dimensional real number vectors are combined into one cluster resource feature sub-vector by averaging, and the cluster resource feature sub-vector includes historical network connection timeout state information and historical memory overflow state information.
4. The method of claim 3, wherein, According to historical data, an evaluation feature set corresponding to each application cluster is generated, including: According to the topological connection relationship between the application cluster and other application clusters in the first preset historical statistical period, a network topology ID corresponding to the application cluster is generated; the network topology ID is used to represent the connection hop relationship when the corresponding application cluster communicates with the remaining application clusters; According to the communication data of the application cluster in the first preset historical statistical period, cluster communication delay information corresponding to the application cluster is generated; According to the network topology ID and the cluster communication delay information corresponding to the application cluster, an inter-cluster network topology relationship feature sub-vector is generated; the inter-cluster network topology relationship feature sub-vector includes historical inter-cluster connection hop information and historical cluster communication delay information.
5. The method of claim 4, wherein, The evaluation feature set is an evaluation feature vector; According to historical data, an evaluation feature set corresponding to each application cluster is generated, including: The cluster stress feature sub-vector, the cluster resource feature sub-vector, and the inter-cluster network topology relationship feature sub-vector are spliced into the evaluation feature vector.
6. The method of claim 1, wherein, The pre-scheduling includes: An application resource demand portrait vector corresponding to the service-type application is obtained; the application resource demand portrait vector includes CPU demand information, memory demand information, application role information, and application dependency information; An server real-time resource supply portrait vector corresponding to each server in the initial target application cluster is obtained; the server real-time resource supply portrait vector includes CPU available information, GPU available information, memory available information, server storage and computing topology ID, and server network topology ID; After splicing the application resource demand portrait vector with each server real-time resource supply portrait vector, the result of whether each server in the initial target application cluster meets the application loading condition is generated by inputting the spliced vectors into a target transformer model; The service-type application is simultaneously subjected to a simulation loading test and a real loading test on the servers that meet the application loading condition, to generate simulation loading results and real loading results; the speed of the simulation loading test is greater than the speed of the real loading test; If both the simulation loading results and the real loading results are application loading and running successes, the corresponding servers are determined as target scheduling servers, so as to determine the target scheduling servers from the initial target application cluster.
7. The method of claim 6, wherein, The application resource demand portrait vector corresponding to the service-type application includes: Using svm, historical information sequences corresponding to the CPU demand information, the memory demand information, the application role information, and the application dependency information of the service-type application are used to generate fitting expected values corresponding to the CPU demand information, the memory demand information, the application role information, and the application dependency information, respectively; Using the fitting expected values corresponding to the CPU demand information, the memory demand information, the application role information, and the application dependency information, respectively, an application resource demand portrait vector corresponding to the service-type application is generated.
8. The method of claim 6, wherein, The server cluster is a K8s cluster; Obtaining a server real-time resource supply portrait vector corresponding to each server in an initial target application cluster, comprising: Obtaining CPU available information, GPU available information and memory available information of each server through a resource monitoring component; Obtaining a server storage and computing topology ID of each server through a management component of the k8s cluster. Obtaining a network topology ID of each server according to a communication network topology design of the servers in the cluster. 9.A non-transitory computer-readable storage medium storing a computer program, the computer program comprising instructions configured to cause a processor to perform the method according to any one of claims 1 to 8. The computer program is executed by the processor to implement the application cluster scheduling method of any one of claims 1 to 8.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to implement the application cluster scheduling method of any one of claims 1 to 8.
Citation Information
Patent Citations
Server automatic configuration method and device
CN109600245A
Cross-multi-cluster work scheduling method and device
CN114153580A