Scheduling method based on idle resources of server, storage medium and equipment
By detecting server resource usage in real time and performing dynamic scheduling, it solves the problem of operating pressure caused by idle resource utilization and ensures the stability and performance of server applications.
Patent Information
- Application Number
- CN202410662754.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-08-23
- Estimated Expiration
- 2044-05-27
AI Technical Summary
Existing server cluster scheduling methods may cause a surge in server operating pressure when utilizing idle resources, which may lead to unstable or unavailable application operations.
By obtaining the remaining information of various types of resources on the server, the scheduling amplitude configuration is processed, the schedulable amount is generated, and the resource usage is detected in real time. When the usage exceeds the preset threshold, the target application is deleted to release the resource pressure, using the index sum Allocate resources in a linear growth manner to ensure stable server operation.
Effectively manage server resources to avoid excessive operating pressure, ensure normal and stable operation of applications, and release resource pressure in a timely manner to improve server availability and performance.
Smart Images

Figure CN118535334A
Abstract
Description
Background Art
[0002] Server cluster scheduling refers to the efficient and reasonable allocation and management of various resources (such as computing resources, storage resources, network resources, etc.) through specific scheduling algorithms and management software in a cluster environment composed of multiple servers to meet the operating requirements of various work tasks (such as applications, services, data processing tasks, etc.) while ensuring the overall performance, availability, efficiency and fairness of the cluster.
[0003] Usually when setting up a server cluster, in order to more efficiently and reasonably utilize the resources in the cluster, the existing server cluster usually sets up multiple sub-clusters with different roles, such as application cluster, computing cluster and standby cluster. Among them, the application cluster is used to create and load service-type applications, the computing cluster is used to create and load computing-type applications, and the standby cluster can load both service-type applications and computing-type applications for emergency use.
[0004] In order to further improve the utilization of the performance of each server in the cluster, cross-cluster scheduling is usually involved to utilize the remaining idle resources in other clusters. However, the existing scheduling method for idle resources directly loads applications to idle servers that meet the resource requirements. However, this scheduling method may cause a surge in the operating pressure of idle servers, which in turn causes unstable or unavailable operation of all applications on the server. Summary of the invention
[0005] In view of the above technical problems, the technical solution adopted by the present invention is:
[0006] According to one aspect of the present invention, a scheduling method based on idle resources of a server is provided, the method comprising the following steps:
[0007] In response to a scheduling request of a target application to a server, obtaining surplus information of each type of resource in the server;
[0008] Perform scheduling amplitude configuration processing on the surplus information of each type of resources to generate the schedulable amount of each type of resources;
[0009] Load the target application according to the schedulable amount of each type of resource, and detect the usage rate of each type of resource in the server in real time during the loading process;
[0010] When the usage rate of any type of resource is greater than a preset usage rate threshold, the loading task of the target application on the server is deleted;
[0011] The scheduling amplitude configuration process includes:
[0012] According to the configuration duration and the resource utilization rate of the server, the schedulable amount of each type of resource is generated; among which, the schedulable amount of the i-th type of resource Qi The following conditions must be met:
[0013]
[0014] Among them, Q i d is the unit scheduling resource quantity of the i-th type of resource; t is the configuration duration; P i is the resource utilization rate of the i-th type of resource in the server; Y i 1 Y is the first usage threshold of the i-th type of resource; i 2 Y is the second usage rate threshold of the i-th type of resource; i 2 >Y i 1 ;Q i Y2 P i =Y i 2 The schedulable amount of the i-th type of resources when .
[0015] According to a second aspect of the present invention, a non-transitory computer-readable storage medium is provided, wherein the non-transitory computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned scheduling method based on idle resources of a server is implemented.
[0016] According to a third aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned scheduling method based on idle resources of a server when executing the computer program.
[0017] The present invention has at least the following beneficial effects:
[0018] In the present invention, when scheduling and allocating idle resources in the server, the current resource water level pressure of each resource in the server, that is, the utilization rate of the corresponding resource in the server, is considered at the same time. If the resource water level pressure in the server exceeds the preset utilization rate threshold after scheduling and allocating the corresponding amount of resources, the target application is expelled from the server. In this way, the resource pressure of the server is released in time to ensure the normal and stable operation of the existing applications on the server.
[0019] At the same time, according to the schedulable amount of resources Q i From the calculation formula, we can see that in the early stage of resource allocation (i.e. P i <Y i 1 Time)Q iThe resource demand of the target application is quickly met by exponential growth, so as to quickly complete the loading and running of the target application and provide the corresponding service in time. i 1 <P i ≤Y i 2 Time)Q i Slowly increase in a linear form to further meet the resource requirements of the target application while avoiding putting too much pressure on the server and reducing the possibility of server crashes. Finally, at the end of resource allocation (P i =Y i 2 When the server resource pressure reaches the highest level, Q i It is instantly reduced to half to quickly relieve the pressure on the server and expel the target application, thereby ensuring the normal operation of the server. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0021] Figure 1 A flowchart of a scheduling method for an application cluster provided by an embodiment of the present invention;
[0022] Figure 2 A flowchart of a scheduling method for a computing cluster provided by an embodiment of the present invention;
[0023] Figure 3 A flowchart of a multi-type cluster collaborative scheduling method provided by an embodiment of the present invention;
[0024] Figure 4 A flowchart of a scheduling method based on idle resources of a server provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0026] As a possible embodiment of the present invention, Figure 1As shown, a scheduling method for an application cluster is provided, which is applied to the scheduling of a server cluster, wherein the server cluster includes multiple application clusters and multiple computing clusters.
[0027] The method comprises the following steps:
[0028] S100: In response to a creation request of a service-type application, a preferred application cluster evaluation is performed on multiple application clusters to select an initial target application cluster from the multiple application clusters. The preferred application cluster evaluation is used to determine whether a cluster meets a scheduling condition based on historical information of the cluster.
[0029] The preferred application cluster assessment includes:
[0030] S101: Generate an evaluation feature set corresponding to each application cluster based on historical data, where the evaluation feature set includes a cluster pressure feature sub-vector, a cluster resource feature sub-vector, and an inter-cluster network topology relationship feature sub-vector.
[0031] Specifically, the evaluation feature set may be an evaluation feature vector, which is formed by concatenating a cluster pressure feature sub-vector, a cluster resource feature sub-vector, and an inter-cluster network topology relationship feature sub-vector.
[0032] The cluster pressure feature sub-vectors include: historical CPU usage, historical memory usage, historical number of connections, historical QPS (Queries-per-second), and historical number of soft interrupts.
[0033] In the Linux kernel, the number of softirqs is defined by the macro NR_SOFTIRQS. Softirqs are managed by the softirq_vec array, the size of which depends on the value of NR_SOFTIRQS. Each softirq corresponds to an element in the array, representing a specific type of delayed task, such as network receive packet processing (NET_RX_SOFTIRQ), timer events (HI_SOFTIRQ and TIMER_SOFTIRQ), etc. The exact number of softirqs should be consulted in the corresponding Linux kernel source code or recorded and obtained through the corresponding monitoring component.
[0034] The cluster resource feature sub-vector includes: historical network connection timeout status information and historical memory overflow status information.
[0035] The feature sub-vector of the inter-cluster network topology relationship includes: historical inter-cluster connection hop count information and historical cluster communication delay information.
[0036] Specifically, the method for obtaining each characteristic sub-vector in S101 is as follows:
[0037] The cluster pressure characteristic sub-vector can be obtained as follows:
[0038] S111: Obtain historical data sequences of CPU usage, memory usage, number of connections, QPS, and number of soft interrupts generated by the application cluster in a first preset historical statistics period.
[0039] S121: Generate characteristic values corresponding to CPU usage, memory usage, number of connections, QPS and number of soft interrupts according to the values in each historical data sequence, and generate a cluster pressure characteristic subvector. The characteristic value includes: average value, maximum value, minimum value or standard deviation.
[0040] The acquisition of cluster resource feature subvectors can be performed as follows:
[0041] S131: Obtaining historical log data generated by the application cluster in a first preset historical statistics period through a log management system.
[0042] S141: Use the BERT model to perform named entity recognition on historical log data 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.
[0043] This step is named entity recognition processing, which specifically infers whether certain states of the server (such as network connection timeout state, memory overflow state) are healthy by identifying multiple entities in the log and the relationship between entities.
[0044] For example, in a common log line: 2024-04-23T06:57:01.354948078Z SLF4J:Class pathcontains multiple SLF4J bindings, we can identify the entities Class, path, SLF4J, and bindings. The key entity information and the relationship between the entities indicate that the relationship is healthy.
[0045] S151: Use the one-hot encoding technique to perform one-hot encoding on each entity state to generate a binary vector. The length of the binary vector is equal to the total number of all entity types.
[0046] S161: Map the binary vector to a low-dimensional real vector of fixed length through embedding mapping.
[0047] S171: merging multiple low-dimensional real number vectors into a cluster resource feature sub-vector by averaging, where the cluster resource feature sub-vector includes historical network connection timeout status information and historical memory overflow status information.
[0048] S131 to S171 are essentially a process of named entity recognition-entity vectorization-vector unification. Specifically, after named entity recognition is performed on the logs, the entities and their relationships are merged into a vector, and then embedding is vectorized. After that, these vectors are merged into a vector by averaging, and then this vector and other data are spliced together and put into the decision tree.
[0049] After processing from S131 to S171, the entities and their states extracted from the log can be type-encoded using One-Hot Encoding, and finally the categorical data vectors can be converted into numerical vectors for subsequent calculations.
[0050] Acquisition of cluster resource feature subvectors
[0051] The acquisition of the characteristic subvector of the inter-cluster network topology relationship can be carried out as follows:
[0052] S181: Generate a network topology ID corresponding to the application cluster according to the topological connection relationship between the application cluster and other application clusters in the first preset historical statistical period. The network topology ID is used to indicate the connection hop relationship between the corresponding application cluster and other application clusters when communicating. When the entire cluster is deployed, the network topology relationship of the servers in each cluster is also completely determined, and the corresponding network topology ID is also determined.
[0053] Take the network topology ID as an example: if there are three clusters, clusters 1-3, the network topology ID of cluster 1 may be expressed as [0,1,1] or [0,1,2] or [0,2,1].
[0054] S191: Generate cluster communication delay information corresponding to the application cluster according to communication data of the application cluster in a first preset historical statistics period. The first preset historical statistics period is the same as the second preset historical statistics period, which can be 15 days.
[0055] S1101: Generate an inter-cluster network topology relationship feature subvector according to the network topology ID corresponding to the application cluster and the cluster communication delay information. The inter-cluster network topology relationship feature subvector includes historical inter-cluster connection hop count information and historical cluster communication delay information.
[0056] Evaluate the treatment of missing values in a feature set:
[0057] For numerical features, the average value of the corresponding feature is used for filling.
[0058] For categorical data that has been processed by one-hot encoding, missing data is encoded as an independent category.
[0059] S102: Input each evaluation feature set into a target evaluation decision tree model to generate an evaluation result of whether the application cluster corresponding to each evaluation feature set meets the scheduling condition.
[0060] S103: Use the application cluster that meets the scheduling conditions as the initial target application cluster.
[0061] In this example, by using decision trees for evaluation and prediction, a relatively small number of samples (about 200) can be used to train the decision tree to obtain a better prediction effect to meet the current scenario. Thus, the required results can be obtained at a lower cost.
[0062] S200: Pre-scheduling each server in each initial target application cluster to determine a target scheduling server from the initial target application cluster. Pre-scheduling is used to determine the target scheduling server according to the matching degree between the server real-time resource supply profile and the application real-time resource demand profile.
[0063] S300: Send a scheduling request to the apiserver of the target scheduling server to create a service application in the target scheduling server.
[0064] In this embodiment, when evaluating and screening clusters, the initial target application cluster that is more suitable for service-oriented application scheduling is first screened out through the performance of each cluster in the historical data. Then, through pre-scheduling, the target scheduling server is determined based on 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. In this way, the initial target application cluster can be first screened and determined through historical data. At the same time, in order to prevent the current server status from being different from the status shown by the historical data, which leads to the failure of the call, the target scheduling server will be further determined through real-time data. Therefore, after two screening and matching of data in different time dimensions, the appropriate server can be more accurately scheduled for the service-oriented application.
[0065] Moreover, when evaluating the preferred application cluster, the predicted input features are configured from three dimensions: cluster pressure characteristics, cluster resource characteristics, and inter-cluster network topology relationship characteristics. Since service-oriented applications usually refer to application programs and server types that focus on providing service functions, their design and optimization goals are to provide stable and efficient service responses to external users. In the present invention, cluster pressure characteristics can roughly reflect the busy state and load pressure of the cluster; cluster resource characteristics can roughly reflect the health status of each entity in the cluster through historical logs, and then reflect the stability of the cluster; inter-cluster network topology relationship characteristics can roughly reflect the smoothness of cluster communication and the timeliness of request responses. Therefore, the characteristic data of the above three dimensions can more accurately determine the cluster that meets the service-oriented application scheduling.
[0066] As another embodiment of the present invention, Figure 2 As shown, a scheduling method for a computing cluster is also provided, which is also applied to the scheduling work of a server cluster, and the server cluster includes multiple computing clusters and multiple computing clusters.
[0067] The scheduling method includes the following steps:
[0068] W100: In response to a creation request of a computing application, a preferred computing cluster evaluation is performed on multiple computing clusters to select an initial target computing cluster from the multiple computing clusters. The preferred computing cluster evaluation is used to determine whether a cluster meets a scheduling condition based on historical information of the cluster.
[0069] Specifically, the optimal computing cluster evaluation includes:
[0070] W101: Generate an evaluation feature set corresponding to each computing cluster based on historical data. The evaluation feature set includes the cluster storage resource topology ID, the average processing time of cluster historical tasks, the cluster historical calculation accuracy, and the cluster pressure feature sub-vector.
[0071] The evaluation feature set may be an evaluation feature vector, which is formed by concatenating and integrating the storage resource topology ID, the average processing time of cluster historical tasks, the cluster historical calculation accuracy, and the cluster pressure feature sub-vector.
[0072] The cluster storage and computing resource topology ID is used to indicate the storage location of the data required by the computing application in each computing cluster.
[0073] Cluster pressure feature sub-vectors include: historical CPU usage, historical memory usage, historical number of connections, historical QPS, and historical number of soft interrupts.
[0074] Specifically, the method for obtaining each characteristic sub-vector in W101 is as follows:
[0075] To obtain the cluster storage resource topology ID, follow the steps below:
[0076] The location of the data required by the application in the cluster can be obtained through the topology structure managed in the cluster management component, and a server ID, which is the cluster storage and computing resource topology ID, can be obtained. The ID is a manually defined mapping relationship.
[0077] The average processing time of cluster historical tasks and the accuracy of cluster historical calculations can be obtained by following the steps below:
[0078] W111: Obtain the processing duration of all tasks generated by the computing cluster in the second preset historical statistical period.
[0079] W121: The average processing time of all tasks is taken as the average historical processing time of cluster tasks.
[0080] W131: Obtain the calculation results of all tasks generated by the computing cluster in the second preset historical statistics period.
[0081] W141: Generates the cluster historical calculation accuracy based on the calculation results of all tasks.
[0082] The basic data of the average processing time of the cluster's historical tasks and the accuracy of the cluster's historical calculations come from the monitoring component, which counts the accuracy of the running results of the cluster's historical tasks (if any). This part mainly reflects whether there may be errors in the calculation results caused by resource competition when the cluster is under computing pressure.
[0083] The acquisition of cluster pressure characteristic sub-vector can be carried out according to the following steps:
[0084] W151: Obtain the historical data series of CPU usage, memory usage, number of connections, QPS and number of soft interrupts generated by the computing cluster in the second preset historical statistical period.
[0085] W161: Generate the eigenvalues corresponding to CPU usage, memory usage, number of connections, QPS, and number of soft interrupts based on the values in each historical data sequence, and generate the cluster pressure feature subvector. The eigenvalues include: average value, maximum value, minimum value, or standard deviation.
[0086] The acquisition of the cluster pressure characteristic sub-vector may refer to S111 and S121 in the above embodiment.
[0087] W102: Input each evaluation feature set into the target evaluation decision tree model to generate an evaluation result of whether the computing cluster corresponding to each evaluation feature set meets the scheduling conditions.
[0088] W103: The computing cluster that meets the scheduling conditions is used as the initial target computing cluster.
[0089] W200: Pre-scheduling each server in each initial target computing cluster to determine the target scheduling server from the initial target computing cluster. 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.
[0090] W300: Send a scheduling request to the apiserver of the target scheduling server to create a computing application in the target scheduling server.
[0091] In this embodiment, when evaluating and screening clusters, the initial target application cluster that is more suitable for computing application scheduling is first screened out through the performance of each cluster in the historical data. Then, through pre-scheduling, the target scheduling server is determined based on 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. In this way, the initial target application cluster can be first screened and determined through historical data. At the same time, in order to prevent the current server status from being different from the status shown by the historical data, which leads to the failure of the call, the target scheduling server will be further determined through real-time data. Therefore, after two screening and matching of data in different time dimensions, the appropriate server can be more accurately scheduled for computing applications.
[0092] Moreover, when evaluating the optimal application cluster, the predicted input features are configured through multiple dimensions of cluster storage resource topology ID, cluster historical task average processing time, cluster historical calculation accuracy, and cluster pressure feature subvector. Since computing applications mainly focus on processing a large number of computing-intensive tasks, their design focus is to maximize the use of computing resources for complex calculations or data analysis, and pay more attention to the timeliness and accuracy of calculations and the smoothness of obtaining relevant data involved in the calculation. In the present invention, the cluster storage resource topology ID can roughly reflect the storage location of the relevant data involved in the calculation, and then can reflect the smoothness of obtaining the relevant data involved in the calculation in the cluster; the average processing time of cluster historical tasks and the accuracy of cluster historical calculations can roughly reflect and pay more attention to the timeliness and accuracy of calculations; cluster pressure characteristics can roughly reflect the busy state and load pressure of the cluster. Therefore, through the above-mentioned multiple dimensions of feature data, the cluster that meets the scheduling of computing applications can be more accurately determined.
[0093] As another embodiment of the present invention, pre-scheduling includes:
[0094] S201: Obtaining an application resource requirement portrait vector corresponding to a service-oriented application. The application resource requirement portrait vector includes CPU requirement information, memory requirement information, application role information, and application dependency information.
[0095] S201 includes:
[0096] S211: Use SVM (Support Vector Machine) to generate corresponding fitting expected values for the historical information sequences corresponding to the CPU requirement information, memory requirement information, application role information and application dependency information of the service-oriented application.
[0097] S221: Generate an application resource demand portrait vector corresponding to the service-type application using the fitted expected values corresponding to the CPU demand information, the memory demand information, the application role information, and the application dependency information.
[0098] Therefore, through SVM, a nearly fitting expected value is obtained based on the historical information sequence of each indicator, and then a vector of corresponding length can be formed.
[0099] S202: Obtain a 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 availability information, GPU availability information, memory availability information, server storage and computing topology ID, and server network topology ID.
[0100] Taking the server cluster as a K8s cluster as an example, S202 includes:
[0101] S212: Obtain CPU availability information, GPU availability information, and memory availability information of each server through a resource monitoring component.
[0102] S222: Obtain the server storage and computing topology ID of each server through the management component of the k8s cluster.
[0103] S232: According to the communication network topology design of the servers in the cluster, obtain the network topology ID of each server.
[0104] 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 the storage and computing topology ID returns the device ID, which is obtained from the management component of k8s.
[0105] S203: splicing the application resource demand portrait vector with each server's real-time resource supply portrait vector respectively and inputting them into the target transformer model to generate a result of whether each server in the initial target application cluster meets the application loading condition.
[0106] Specifically, the application resource demand portrait vector is concatenated with the real-time resource supply portrait vector of each server, and a normalized vector is obtained through the embedding logic. This normalized vector is then input into a trained encoder's transformer for output prediction.
[0107] S204: Simultaneously perform a simulated loading test and a real loading test on the service-type application for the server that meets the application loading condition, and generate a simulated loading result and a real loading result. The speed of the simulated loading test is higher than the speed of the real loading test.
[0108] The simulated load test can be implemented through the existing mock simulation test module. The real load test is to load the corresponding application on the corresponding server and perform the corresponding stress test to observe whether the server can run stably.
[0109] Specifically, since the speed of the simulated loading test is faster than that of the real loading test, the result of the simulated loading can be obtained earlier. If the result of the simulated loading operation is unsuccessful, the time interval of waiting for the result of the real loading operation can be used to directly execute steps S400 to S600 to perform scaling-down and rescheduling processing on the scalable application. If the final result of the real loading operation is also unsuccessful, the scaling-down and rescheduling processing can be performed in advance, which saves processing time, so that the application can be loaded and run more timely.
[0110] S205: If both the simulated loading result and the actual loading result indicate that the application loading is successful, the corresponding server is determined as the target scheduling server, so as to determine the target scheduling server from the initial target application cluster.
[0111] In this embodiment, the target scheduling server is determined based on the matching degree between 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 matching degree between each server and the corresponding application to be loaded can be more accurately reflected through more accurate real-time data that fits the actual situation. Thus, it can be prevented that the current server status is different from the status shown by the historical data, which leads to the occurrence of call failure, and the appropriate server can be more accurately scheduled for the application.
[0112] As another possible embodiment of the present invention, Figure 3As shown, a multi-type cluster collaborative scheduling method is also provided for cross-cluster calls to improve the utilization of servers in each cluster. The server cluster includes multiple application clusters, multiple computing clusters, and multiple standby clusters. The performance of the application cluster and the computing cluster is greater than that of the standby cluster. The application cluster is preferentially used to create service-oriented applications. The computing cluster is preferentially used to create computing-oriented applications.
[0113] The method comprises the following steps:
[0114] S400: In response to the information that the application cluster cannot meet the service application creation condition, the QoS level of the service application is obtained. The QoS level includes the application scalable level and the application non-scalable level.
[0115] S500: If the QoS level of the service-type application is the level at which the application cannot be scaled down (ie, a high service level), server resource occupation is performed according to the idle resource view currently corresponding to the computing cluster to schedule the computing cluster resources to create and load the service-type application.
[0116] S600: If the QoS level of the service-type application is the application scalable level (ie, low service level), the service-type application is scalable and rescheduled to schedule resources in the application cluster or the standby cluster to create a loaded and scalable service-type application.
[0117] Usually, service-oriented applications use horizontal scaling in their deployment architecture to improve request processing capabilities. Horizontal scaling means adding more server instances or containers, each of which runs the same copy of the application to handle more concurrent requests.
[0118] Therefore, reducing a certain number of application copies will not cause service unavailability, but will only reduce the response speed. In this scenario, the availability of the service needs to be prioritized, so the success rate of application loading can be increased by reducing the capacity to ensure service availability.
[0119] S601: The capacity reduction and rescheduling process includes:
[0120] S602: Reduce the number of copies of the current service-type application to generate a scaled-down service-type application. In each scale-down and rescheduling process, only one copy of the current service-type application is reduced.
[0121] S603: Pre-schedule each server in each initial target application cluster according to the reduced capacity service application to generate a scheduling result corresponding to the reduced capacity service application. The scheduling result includes: the application cluster cannot meet the creation condition of the reduced capacity service application and a server meets the creation condition of the reduced capacity service application.
[0122] S604: Pre-scheduling is used to determine the target scheduling server according to the matching degree between the server real-time resource supply profile and the application real-time resource demand profile.
[0123] S605: If the scheduling result is that the server meets the creation condition of the reduced capacity service type application, a scheduling request is sent to the apiserver of the corresponding server to create the reduced capacity service type application in the server.
[0124] S700: If the number of replicas of the current service-type application cannot be reduced, a scheduling request is sent to the apiserver of the server in the standby cluster to create a reduced-capacity service-type application in the server in the standby cluster.
[0125] In this embodiment, when the server in the application cluster cannot meet the creation conditions of the current service-oriented application, the subsequent server call operation will be performed according to the QoS (Quality of Service) level corresponding to the service-oriented application. Specifically, the idle resources in the computing cluster are directly called for the application that cannot be scaled down to complete the smooth loading of the service-oriented application, thereby ensuring the smooth operation of the service. Since service-oriented applications and computing-oriented applications have different occupation tendencies for various types of resources due to their different task characteristics and functional requirements. Service-oriented applications usually occupy more network resources and memory resources, while the occupation of computing resources (CPU) is relatively moderate; computing-oriented applications occupy computing resources (especially CPU, GPU and memory) significantly. In addition, there is a large gap between the working hours of service-oriented applications and computing-oriented applications. Service-oriented applications are usually executed during the daytime when human activities are more frequent, while most of the statistical analysis applications in computing-oriented applications are executed at night when the day is about to end. Therefore, based on the above two characteristics, during the period when the service cluster is relatively busy, there will often be a part of the computing cluster with a high degree of idleness. Therefore, high QoS service applications can be loaded into the computing cluster first to ensure the timely availability of services.
[0126] At the same time, for some service applications with low QoS levels (i.e., scalable applications), the present invention will gradually reduce the number of copies to re-call the server. In this way, the scheduling success rate of the service cluster is improved by actively reducing the resource requirements of the service application. And when the application cannot be scaled down again, the service application with the smallest resource requirement is directly loaded into the backup cluster with lower performance for call backup. In this way, the scheduling success rate of the service application is guaranteed, and then the availability of the service application is guaranteed. Under this setting, a backup cluster with lower performance can be used, thereby reducing the cost of cluster construction.
[0127] As another possible embodiment of the present invention, Figure 4As shown, a scheduling method based on idle resources of a server is also provided, and the method comprises the following steps:
[0128] Z100: In response to the target application's scheduling request to the server, obtain the margin information of each type of resource in the server.
[0129] Specifically, obtaining the remaining information of each type of resource in the server includes: obtaining the remaining information of the memory, disk, CPU and GPU in the server. The remaining information of each type of resource in the server is the remaining amount after deducting the online occupancy and resource reservation from the total amount of each type of resource in the server.
[0130] Z200: Perform scheduling amplitude configuration processing on the margin information of each type of resource to generate the schedulable amount of each type of resource.
[0131] The scheduling amplitude configuration process includes:
[0132] Z201: If the generation time of the target application's scheduling request to the server is within [5:00, 23:00], generate the schedulable amount of each type of resource according to the configuration duration and the resource utilization rate of the server. Among them, the schedulable amount of the i-th type of resource Q i The following conditions must be met:
[0133]
[0134] Among them, Q ID is the unit scheduling resource quantity of the i-th type of resource. t is the configuration duration. i is the resource utilization rate of the i-th type of resource in the server, that is, the usage pressure of the i-th type of resource. i 1 is the first utilization rate threshold of the i-th type of resource, Y i 1 It can be 75%. i 2 is the second usage rate threshold of the i-th type of resource, Y i 2 It can be 85%. i 2 >Y i 1 .Q i Y2 P i =Y i 2 The schedulable amount of the i-th type of resources when .
[0135] Z202: If the generation time of the target application's scheduling request to the server is within (23:00, 4:40], then generate the schedulable amount of each type of resource according to the configuration duration and the resource utilization rate of the server. Among them, the schedulable amount of the i-th type of resource Q i The following conditions must be met:
[0136]
[0137] Among them, K i Max The demand for the i-th resource type declared by the developers in the target application.
[0138] Z202 and Z203 add restrictions on scheduling periods, which are mainly used to distinguish the busyness of resource usage. In the busy period [5:00, 23:00], the schedulable amount of resources needs to be configured step by step to prevent a large resource pressure on the server. In the less busy period (23:00, 4:40], the corresponding K can be directly configured for the application. i Max Since there are more idle resources on the server during this period, the resource pressure on the server is the lowest, so the corresponding K can be directly configured for the application. i Max , to ensure timely and normal loading of the application and normal availability of the service.
[0139] Z300: Loads the target application based on the schedulable amount of each type of resource, and detects the usage rate of each type of resource in the server in real time during the loading process.
[0140] Specifically, the server is a server node in a K8s cluster.
[0141] Load based on the schedulable amount of each type of resource, including:
[0142] Z301: By adjusting the cgroup allocation of the task corresponding to the target application, corresponding resources are gradually allocated to the task to create and load the target application in the corresponding server.
[0143] Z400: When the usage rate of any type of resource is greater than the preset usage rate threshold, the loading task of the target application on the server is deleted.
[0144] Z500: Set a node cooling period for the server. During the node cooling period, the application corresponding to the offline task is prohibited from calling the server. The length of the node cooling period is negatively correlated with the current resource utilization rate of the server. For example, the node cooling period can be between 5 minutes and 10 minutes.
[0145] In this embodiment, when scheduling and allocating idle resources in the server, the current resource water level pressure of each resource in the server, that is, the utilization rate of the corresponding resource in the server, is considered at the same time. If the resource water level pressure in the server exceeds the preset utilization rate threshold after scheduling and allocating the corresponding amount of resources, the target application will be expelled from the server. In this way, the resource pressure of the server is released in time to ensure the normal and stable operation of the existing applications on the server.
[0146] At the same time, according to the schedulable amount of resources Q i From the calculation formula, we can see that in the early stage of resource allocation (i.e. P i <Y i 1 Time)Q i The resource demand of the target application is quickly met by exponential growth, so as to quickly complete the loading and running of the target application and provide the corresponding service in time. i 1 <P i ≤Y i 2 Time)Q i Slowly increase in a linear form to further meet the resource requirements of the target application while avoiding putting too much pressure on the server and reducing the possibility of server crashes. Finally, at the end of resource allocation (P i =Y i 2 When the server resource pressure reaches the highest level, Q i It is instantly reduced to half to quickly relieve the pressure on the server and expel the target application, thereby ensuring the normal operation of the server.
[0147] In addition, before S100, W100 and Z100, the scheduling method also includes:
[0148] S110: Obtaining a type tag of an application corresponding to the application creation request. Type tags include computing tags, application tags, and user configuration tags.
[0149] S120: If the type tag is a computing type tag, then obtain a task execution type tag corresponding to the application. The task execution type tag includes: an online task type tag and an offline task type tag.
[0150] S130: If the task execution type tag is an online task type tag, a creation request for a computing application corresponding to the application in W100 is generated.
[0151] S140: If the task execution type tag is an offline task type tag, a creation request for a computing application corresponding to the application in Z100 is generated.
[0152] At the same time, when the computing cluster cannot meet the creation conditions of computing applications or the application cluster cannot meet the creation conditions of service applications, a corresponding creation request in Z100 will be generated to call the idle resources in other idle clusters to successfully create and load the application.
[0153] S150: If the type tag is an application tag, a creation request for the service application corresponding to the application in S100 is generated.
[0154] After the screening and diversion processing from S110 to S150, each application can be more appropriately and accurately diverted to different server scheduling processing solutions in the present invention to ensure that the application can be loaded and used normally.
[0155] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0156] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation 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 USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0157] In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
[0158] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as a system, method or program product. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as a "circuit", "module" or "system".
[0159] The electronic device according to this embodiment of the present invention is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0160] The electronic device is presented in the form of a general-purpose computing device. The components of the electronic device may include, but are not limited to: the at least one processor mentioned above, the at least one storage device mentioned above, and a bus connecting different system components (including storage devices and processors).
[0161] The storage stores program codes, which can be executed by the processor, so that the processor executes the steps according to various exemplary embodiments of the present invention described in the above “Exemplary Method” section of this specification.
[0162] The memory may include readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory, and may further include read only memory (ROM).
[0163] The storage may also include a program / utility having a set (at least one) of program modules, such program modules including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0164] The bus may represent one or more of several types of bus structures including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus architectures.
[0165] The electronic device may also communicate with one or more external devices (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may communicate with one or more devices that enable a user to interact with the electronic device, and / or may communicate with any device (e.g., routers, modems, etc.) that enables the electronic device to communicate with one or more other computing devices. Such communication may be performed through an input / output (I / O) interface. Furthermore, the electronic device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter. The network adapter communicates with other modules of the electronic device through a bus. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0166] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation 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 USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0167] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible implementations, various aspects of the present invention may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of the present invention described in the above "Exemplary Method" section of the present specification.
[0168] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with 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.
[0169] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0170] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0171] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0172] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to an exemplary embodiment of the present invention, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0173] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0174] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A scheduling method based on server idle resources, It is characterized in that The method comprises the following steps: In response to a scheduling request of a target application to a server, obtaining margin information of each type of resource in the server; Perform scheduling amplitude configuration processing on the margin information of each type of resources to generate a schedulable amount of each type of resources; Loading the target application according to the schedulable amount of each type of resource, and detecting the utilization rate of each type of resource in the server in real time during the loading process; When the usage rate of any type of resource is greater than a preset usage rate threshold, deleting the loading task of the target application on the server; The scheduling amplitude configuration process includes: According to the configuration duration and the resource utilization rate of the server, the schedulable amount of each type of resource is generated; among which, the schedulable amount of the i-th type of resource Q i The following conditions must be met: Among them, Q i d is the unit scheduling resource quantity of the i-th type of resource; t is the configuration duration; P i is the resource utilization rate of the i-th type of resource in the server; Y i 1 Y is the first usage threshold of the i-th type of resource; i 2 Y is the second usage rate threshold of the i-th type of resource; i 2 >Y i 1 ;Q i Y2 P i =Y i 2 The schedulable amount of the i-th type of resources when .
2. The method according to claim 1, It is characterized in that After deleting the loading task of the target application on the server, the method further includes: A node cooling period is set for the server, and during the node cooling period, a call request to the server by an application corresponding to an offline task is prohibited; and the length of the node cooling period is negatively correlated with a current resource utilization rate of the server.
3. The method according to claim 1, It is characterized in that Before responding to the scheduling request of the target application to the server, the method further includes: Obtaining a type tag of an application corresponding to the application creation request; the type tag includes a computing tag, an application tag, and a user configuration tag; If the type tag is a computing tag, then obtaining a task execution type tag corresponding to the application; the task execution type tag includes: an online task type tag and an offline task type tag; If the task execution type tag is an offline task type tag, a scheduling request of the target application to the server is generated.
4. The method according to claim 3, It is characterized in that If the target application is a computing application corresponding to the offline task, the scheduling amplitude configuration process further includes: If the generation time of the target application's scheduling request to the server is within [5:00, 23:00], then the schedulable amount of each type of resource is generated according to the configuration duration and the resource utilization rate of the server; where the schedulable amount of the i-th type of resource Q i The following conditions must be met:
5. The method according to claim 3, It is characterized in that If the target application is a computing application corresponding to the offline task, the scheduling amplitude configuration process further includes: If the generation time of the scheduling request of the target application to the server is within (23:00, 4:40], then the schedulable amount of each type of resource is generated according to the configuration duration and the resource utilization rate of the server; wherein the schedulable amount Q of the i-th type of resource is i The following conditions must be met: Among them, K i Max The demand for the i-th resource type declared by the developers in the target application.
6. The method according to claim 1, It is characterized in that Obtaining the remaining information of each type of resource in the server, including: Obtain the remaining information of the memory, disk, CPU and GPU in the server.
7. The method according to claim 6, It is characterized in that The remaining amount information of each type of resource in the server is the remaining amount after deducting the online occupied amount and the reserved amount of resources from the total amount of each type of resource in the server.
8. The method according to claim 1, It is characterized in that The server is a server node in the K8s cluster; Load based on the schedulable amount of each type of resource, including: By adjusting the cgroup allocation of the task corresponding to the target application, corresponding resources are gradually allocated to the task, so as to create and load the target application in the corresponding server.
9. A non-transitory computer-readable storage medium storing a computer program, It is characterized in that When the computer program is executed by a processor, the scheduling method based on idle resources of a server as described in any one of claims 1 to 8 is implemented.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the scheduling method based on idle resources of the server is implemented as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Resource adjustment method and device, electronic equipment and storage medium
CN114780201A
Calculation task scheduling method and device, electronic equipment and storage medium
CN115080197A
Task scheduling method and device and Kubernetes scheduler
CN115454589A
Resource scheduling method and device, cloud platform, equipment and storage medium
CN115794337A
Resource scheduling method of service cluster, storage medium and electronic equipment
CN117311999A
