Resource management method and device, equipment and storage medium
By obtaining the workload of the server cluster and determining the weighted value of the distribution rate when the business increment is greater than or equal to the set threshold, the problem of DPM being unable to effectively evaluate the workload when the business increases suddenly is solved, thereby improving business stability and continuity. effect.
Patent Information
- Application Number
- CN202311242276.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-25
- Publication Date
- 2024-10-18
AI Technical Summary
DPM cannot effectively assess workloads when business surges, resulting in low business continuity.
By obtaining the workload of the server cluster when the business increment is greater than or equal to the first set threshold, if the workload is greater than or equal to the second set threshold, determine the weighted value of the server resource allocation rate, and based on the weighted value, target utilization Determine the number of idle servers to start based on the rate and work resources to start the idle servers in the server cluster.
Effectively evaluate workloads, avoid multiple cycles of evaluation and startup, and improve business stability and continuity.
Smart Images

Figure CN118796408A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a resource management method, apparatus, device and storage medium. Background Art
[0002] Currently, with the vSphere Distributed Power Management (DPM) feature, clusters can turn hosts on and off based on cluster resource utilization, thereby reducing their power consumption. DPM monitors the memory and CPU resource requirements of all virtual machines in the cluster and compares them to the total available resources of all hosts in the cluster. If enough extra capacity is found, DPM puts one or more hosts into standby mode, migrates their virtual machines to other hosts, and then powers off the standby hosts. Conversely, when capacity is considered insufficient, DPM powers on those hosts, exits standby mode, and migrates virtual machines to them.
[0003] However, the business will be affected during the time from server startup to completion. At the same time, when the business suddenly increases from a low point to a high point, especially when the resource demand of a single server is greater than 100%, the resources of a single server are exhausted and the business performance is affected. At this time, DPM calculates resources according to 100% of the workload of a single server. The number of startups calculated according to 100% of the workload will be less than the overall startup demand, requiring multiple cyclic evaluations and cyclic startups, and the workload cannot be effectively evaluated, resulting in low business continuity. Summary of the invention
[0004] The embodiments of the present application provide a resource management method, apparatus, device and storage medium to solve the problem that DPM cannot effectively evaluate workload when business suddenly increases, resulting in low business continuity.
[0005] In a first aspect, an embodiment of the present application provides a resource management method, including:
[0006] When the service increment is greater than or equal to a first set threshold, obtaining a first workload of the server cluster;
[0007] If the first workload is greater than or equal to a second set threshold, determining a weighted value of the allocation rate of the server resources; the second set threshold is determined based on a target utilization rate and a target tolerance rate of resources in the server cluster;
[0008] Determine a first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster;
[0009] The idle servers in the server cluster are started based on the first startup quantity.
[0010] In one embodiment, determining the weighted value of the allocation rate of the server resources includes:
[0011] Determining virtual resources of each server based on the number of virtual machines of each server and the working resources of each of the virtual machines;
[0012] A first quotient value between the virtual resources of each server and the working resources of each server is obtained, and the first quotient value is used as a weighted value of the allocation rate of each server.
[0013] In one embodiment, determining the first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster includes:
[0014] Determining resource consumption of each server based on the working resources, workload and the weighted value of the allocation rate of each server;
[0015] Determine the initial startup quantity of each server based on the resource consumption of each server and the working resources of each server;
[0016] A second quotient of the initial startup quantity and the target utilization rate is obtained, and the first startup quantity is determined based on the second quotient.
[0017] In one embodiment, before determining the first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster, the method further includes:
[0018] If the weighted value of the allocation rate is less than or equal to a third set threshold, determining a second startup number of idle servers based on the target utilization rate, the working resources and the workload of each server, and starting the idle servers in the server cluster based on the second startup number;
[0019] If the allocation rate weighted value is greater than the third set threshold, the step of determining the first startup number of unloaded servers based on the allocation rate weighted value, the target utilization, and the working resources and workload of each server in the server cluster is executed.
[0020] In one embodiment, starting the idle servers in the server cluster based on the first startup quantity includes:
[0021] Obtaining the remaining number of unloaded servers in the server cluster;
[0022] If the first startup number is less than or equal to the remaining number, starting the idle server based on the first startup number;
[0023] If the first startup quantity is greater than the remaining quantity, the unloaded servers are started based on the remaining quantity.
[0024] In one embodiment, the method further comprises:
[0025] When the service increment is less than the first set threshold, obtaining the maximum load increment of the server cluster within the server startup time;
[0026] Determining a target tolerance resource load range based on the working resources of each server in the server cluster and the target tolerance rate;
[0027] If the maximum load increment is greater than the maximum value in the target tolerant resource load range, a third startup quantity of the unloaded servers is determined.
[0028] In one embodiment, determining the third startup number of the idle servers includes:
[0029] Obtaining a difference between a third workload of each server within the server startup time and the target tolerance rate;
[0030] Obtaining a first product of the working resources of each server and the difference, and a second product of the working resources of each server and the target tolerance rate;
[0031] A third quotient of the first product and the second product is obtained, and the third power-on quantity is determined based on the third quotient.
[0032] In a second aspect, an embodiment of the present application provides a resource management device, including:
[0033] An acquisition module, configured to acquire a first workload of the server cluster when a service increment is greater than or equal to a first set threshold;
[0034] An allocation rate weighted value determination module, configured to determine an allocation rate weighted value of server resources if the first workload is greater than or equal to a second set threshold; the second set threshold is determined based on a target utilization rate and a target tolerance rate of resources in the server cluster;
[0035] A startup quantity determination module, configured to determine a first startup quantity of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster;
[0036] A resource management module is used to start up unloaded servers in the server cluster based on the first startup quantity.
[0037] In a third aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory storing a computer program, wherein the processor implements the steps of the resource management method described in the first aspect when executing the program.
[0038] In a fourth aspect, an embodiment of the present application provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the resource management method described in the first aspect are implemented.
[0039] The resource management method, apparatus, device and storage medium provided in the embodiments of the present application obtain the first workload of the server cluster when the business increment is greater than or equal to the first set threshold; if the first workload is greater than or equal to the second set threshold, determine the weighted value of the allocation rate of the server resources; the second set threshold is determined based on the target utilization and target tolerance rate of the resources in the server cluster; based on the weighted value of the allocation rate, the target utilization, and the working resources and workload of each server in the server cluster, determine the first startup number of idle servers; and start the idle servers in the server cluster based on the first startup number. The present application effectively evaluates the workload by using the weighted value of the allocation rate, avoids multiple cyclic evaluations and cyclic startups, and thus improves business stability and continuity. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] Figure 1 This is one of the flowcharts of the resource management method provided in the embodiment of the present application;
[0042] Figure 2 This is the second flow chart of the resource management method provided in the embodiment of the present application;
[0043] Figure 3 is a schematic diagram of the structure of a resource management device provided in an embodiment of the present application;
[0044] Figure 4 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0046] Figure 1 This is one of the flowcharts of the resource management method provided in the embodiment of the present application. Figure 1 , the embodiment of the present application provides a resource management method, which may include:
[0047] S100, when the service increment is greater than or equal to a first set threshold, obtaining a first workload of the server cluster;
[0048] It should be noted that a server cluster refers to a collection of computing resources that combines multiple independent servers (physical or virtual) together to achieve high availability, load balancing and fault tolerance through some form of cluster management software.
[0049] When the service increment is greater than or equal to the first set threshold, that is, when the service volume of the data center increases suddenly, it is necessary to obtain the first workload of the server cluster. The first set threshold is used to determine that when the service increment of the data center reaches a certain level, it is considered to be a sudden increase in service volume. The threshold can be determined based on information such as service requirements, system performance, and historical data.
[0050] For example, various monitoring tools can be used to monitor the operating status and load of the server cluster, such as Nagios, Zabbix, OpenNMS, etc. These monitoring tools can collect and analyze various indicators, such as CPU utilization, memory usage, network bandwidth usage, etc., to evaluate the workload of the server cluster.
[0051] Optionally, the software running on the server usually records log files, which contain a lot of information about system performance and load. By analyzing the log files, you can get more detailed server cluster workload data. For example, for web servers, Apache and Nginx usually record the processing time and response status of each request.
[0052] Optionally, various performance testing tools can be used to simulate server performance under different workloads, such as JMeter, LoadRunner, Siege, etc. By performing stress testing and performance testing on the server cluster, you can obtain performance data of the system under actual load.
[0053] S200, if the first workload is greater than or equal to a second set threshold, determining a weighted value of an allocation rate of server resources;
[0054] When a data center experiences a sudden increase in business during busy hours, the resources of a single server may be exhausted, affecting business performance. When using DPM to calculate resources, if the number of machines to be powered on is calculated based on 100% of the workload of a single server resource, the number of machines to be powered on may be less than the overall demand, requiring multiple cycles of evaluation and power-on operations, and the workload cannot be effectively evaluated.
[0055] For example, assuming that the number of idle servers (i.e. the number of servers in use) is calculated as follows:
[0056] M m =[∑(S×P)]÷S÷X; (1)
[0057] In formula (1), S is the working resource of a single server, P is the workload, X is the target utilization, and M is the target utilization. m The number of idle servers that are powered on. The server's working resources include CPU, memory, storage space, network bandwidth, graphics card and other resources; the server's workload refers to the computing and resource requirements required for the applications, services or tasks running on the server, which represents the workload and pressure that the server is currently processing. The workload includes computing load, memory load, storage load and network load.
[0058] Assume that there are 10 servers, the working resource of a single server is 10GHz, the workload is 50%, and the total server resource consumption is 50GHz. The number of servers calculated based on the total of 50GHz is 50÷10=5, which is equivalent to the target utilization rate of 63%. The actual number of servers in use is 5÷63%=8. However, according to the above calculation formula (1), the maximum value of P is 100%. If the actual workload of the virtual machine on the actual host is greater than 100%, then after some standby servers are powered on, the virtual resources will be migrated to the idle host. DPM will re-evaluate the number of servers in use according to the calculation formula (1) after 5 minutes, and the standby servers still need to be powered on. This cycle will repeat until the optimal target utilization rate is reached.
[0059] Based on this, in order to effectively evaluate the workload, the embodiment of the present application increases the resource allocation rate weighted value K to effectively evaluate the workload.
[0060] It should be noted that the second set threshold is determined based on the target utilization and target tolerance rate of the resources in the server cluster. Among them, the target utilization rate refers to the expected overall host target utilization rate set in DPM, which indicates the resource utilization target that the system administrator hopes the server cluster will achieve. Optionally, by default, the target utilization rate is 63%. The target tolerance rate refers to the tolerance range of the host target utilization rate set in DPM, which indicates the degree to which the system can accept the host target utilization rate deviates from the target utilization rate. Optionally, by default, the target tolerance rate is 18%.
[0061] If the first workload is greater than or equal to the second set threshold, a weighted value of the allocation rate of the server resources is determined. Specifically, based on the number of virtual machines of each server and the working resources of each virtual machine, the virtual resources of each server are determined; a first quotient value of the virtual resources of each server and the working resources of each server is obtained, and the first quotient value is used as the weighted value of the allocation rate of each server.
[0062] For example, if the first workload < target utilization X + target tolerance Y, the allocation rate weighted value K is not used; if the first workload >= target utilization X + target tolerance Y, the allocation rate weighted value K is used.
[0063] The calculation method of the allocation rate weighted value K is:
[0064] K = ∑ virtual resources ÷ S; (2)
[0065] In formula (2), S is the working resources of a single server, and ∑ virtual resources is the sum of the working resources of each virtual machine. For example, the number of virtual machines*the working resources of each virtual machine=the total virtual resources.
[0066] For example, suppose a server host has 10 CPUs, which are divided into 5 virtual machines, each with 4 CPUs. Then the total virtual resources are 4×5, and K=4×5÷10=2.
[0067] It can be understood that the allocation rate weighted value K is the allocation rate weighted factor, and the larger the K, the greater the impact of the allocation rate on the allocation of computing resources. By setting the allocation rate weighted value reasonably, the stability and reliability of the system can be ensured while the computing resources are used as efficiently as possible.
[0068] S300, determining a first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster;
[0069] After determining the weighted value of the allocation rate, the first startup number of the idle servers is determined based on the weighted value of the allocation rate, the target utilization rate, and the working resources and workload of each server in the server cluster. Specifically, based on the working resources, workload, and weighted value of the allocation rate of each server, the resource consumption of each server is determined; based on the resource consumption of each server and the working resources of each server, the initial startup number of each server is determined; a second quotient value of the initial startup number and the target utilization rate is obtained, and the first startup number is determined based on the second quotient value.
[0070] For example, for servers of the same model, the corresponding working resources and workloads are the same, so the calculation formula for the first startup quantity is:
[0071] M=[∑S×P×K)]÷S÷X; (3)
[0072] In formula (3), S is the working resource of a single server, P is the workload, X is the target utilization, K is the weighted value of the allocation rate, and M is the first startup number. Among them, ∑(S×P×K) is the resource consumption, and [∑(S×P×K)]÷S is the initial startup number.
[0073] For example, suppose there are 10 servers, the weighted value of the allocation rate of a single server is 2, the working resource is 10 GHz, the workload is 100%, and the server resource consumption is originally 100 GHz. After weighting by formula (3), it becomes 200 GHz as follows:
[0074] Based on formula (1), the server resource consumption is: ∑(10×1)=100;
[0075] Based on formula (3), the server resource consumption is: ∑(10×1×2)=200;
[0076] The total number of servers calculated by 100GHz is 100÷10=10, which is equivalent to a target utilization rate of 63%. The actual number of servers in use is 10÷63%=16, and 6 servers need to be powered on. The total number of servers calculated by 200GHz is 200÷10=20, which is equivalent to a target utilization rate of 63%. The actual number of servers in use is 20÷63%=32, and 22 servers need to be powered on. Based on this, according to the K allocation rate weighted calculation formula, the optimal target utilization rate will be reached at one time from starting 6 servers to starting 22 servers, avoiding the performance impact of multiple cycles of powering on.
[0077] Optionally, for servers of different models, it is necessary to calculate the number of booted servers corresponding to each server. Assuming that there are n servers of different models in the server cluster, the calculation formula of M is:
[0078] M n =(Sn ×P n ×K)÷S n ÷X; (4)
[0079] M=M1+M2+M3...+M n ; (5)
[0080] In formula (4), S n is the working resource of the nth server, P n is the workload of the nth server, X is the target utilization, K is the weighted value of the allocation rate, and M n is the number of startup machines corresponding to the nth server. In formula (5), M is the first startup number.
[0081] S400: Start up unloaded servers in the server cluster based on the first startup quantity.
[0082] After determining the first startup number, the idle servers in the server cluster are started based on the first startup number. Specifically, the remaining number of idle servers in the server cluster is obtained; if the first startup number is less than or equal to the remaining number, the idle servers are started based on the first startup number; if the first startup number is greater than the remaining number, the idle servers are started based on the remaining number.
[0083] For example, the number of servers to be powered on is determined based on the actual number of idle servers in the server cluster to ensure that the available resource limit is not exceeded, and an appropriate power-on quantity strategy is selected based on the specific situation.
[0084] Start-up quantity situation 1: When the first startup quantity is less than or equal to the remaining number of idle servers, the idle servers are started according to the first startup quantity.
[0085] Start-up quantity situation 2: When the first startup quantity is greater than the remaining number of idle servers, the idle servers are started according to the remaining number.
[0086] The resource management method provided in the embodiment of the present application obtains the first workload of the server cluster when the business increment is greater than or equal to the first set threshold; if the first workload is greater than or equal to the second set threshold, the weighted value of the allocation rate of the server resources is determined; the second set threshold is determined based on the target utilization rate and the target tolerance rate of the resources in the server cluster; based on the weighted value of the allocation rate, the target utilization rate, and the working resources and workload of each server in the server cluster, the first startup number of idle servers is determined; based on the first startup number, the idle servers in the server cluster are started. The embodiment of the present application effectively evaluates the workload by using the weighted value of the allocation rate, avoids multiple cyclic evaluations and cyclic startups, and thus improves business stability and continuity.
[0087] Based on the above embodiment, before determining the first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster, the method further includes:
[0088] S500, if the weighted value of the allocation rate is less than or equal to a third set threshold, determining a second startup number of idle servers based on the target utilization rate, the working resources and the workload of each server, and starting the idle servers in the server cluster based on the second startup number;
[0089] S600, if the allocation rate weighted value is greater than the third set threshold, execute the step of determining the first startup number of unloaded servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster.
[0090] After calculating the allocation rate weighted value K, it is necessary to further determine the size of the allocation rate weighted value K. If the allocation rate weighted value is less than or equal to the third set threshold, such as K<=1, it means that the resource demand of the virtual machine does not exceed the resources that the host machine can provide, that is, the resources of the host machine can fully meet the needs of all virtual machines. At this time, there is no need to use K to calculate the number of idle servers to be powered on. That is, directly based on the target utilization, the working resources and workload of each server, determine the second number of idle servers to be powered on, and power on the idle servers in the server cluster based on the second number of powered on. For example, the second number of idle servers to be powered on is calculated based on formula (1).
[0091] If the weighted value of the allocation rate is greater than the third set threshold, such as K>1, it means that the resource demand of the virtual machine exceeds the resources that the host machine can provide, resulting in the host machine being unable to meet the resource demand of all virtual machines, thereby causing performance degradation, extended response time, or other performance issues. At this time, it is necessary to use K to calculate the number of idle servers that are powered on, for example, to calculate the second number of idle servers powered on based on formula (3).
[0092] The embodiment of the present application determines whether the allocation rate weighted value K is greater than 1. If K<=1, the allocation rate weighted value is not used. If K>1, the allocation rate weighted value is used. Based on this, the resource requirements of the virtual machine are met and the business stability and continuity are improved.
[0093] Based on the above embodiment, the method further includes:
[0094] S700, when the service increment is less than a first set threshold, obtaining a maximum load increment of the server cluster within the server startup time;
[0095] S800, determining a target tolerance resource load range based on the working resources of each server in the server cluster and the target tolerance rate;
[0096] S900: If the maximum load increment is greater than the maximum value in the target tolerant resource load range, determine a third startup quantity of the unloaded servers.
[0097] It should be noted that DPM uses the average resource utilization of the 5-minute virtual machine workload as the basis for judging power-on, and the average resource utilization of the 40-minute virtual machine workload as the basis for judging standby. That is, if the 5-minute virtual machine workload exceeds 81%, DPM evaluates the server in standby state to power on; if the 40-minute virtual machine workload is less than 45%, DPM evaluates server migration and integration, and some servers are on standby. However, the startup completion time of a physical server is generally 15 minutes, and the business is affected during this startup time. Based on this, in order to solve the problem of server startup time, the embodiment of the present application controls the number of servers in the cluster according to the maximum load growth in a historical time period equal to the startup time, and the target tolerance resource load range.
[0098] When the service increment is less than the first set threshold, that is, when the service volume of the data center does not suddenly increase, the maximum load increment of the server cluster within the server startup time is obtained, and based on the working resources of each server in the server cluster and the target tolerance rate, the target tolerance resource load range is determined, and then it is determined whether the maximum load increment is greater than the maximum value in the target tolerance resource load range. If so, the third startup number of unloaded servers is determined. Specifically, the difference between the third workload of each server within the server startup time and the target tolerance rate is obtained; the first product of the working resources of each server and the difference is obtained, and the second product of the working resources of each server and the target tolerance rate is obtained; the third quotient of the first product and the second product is obtained, and the third startup number is determined based on the third quotient.
[0099] For example, calculate the maximum load growth value A1 (i.e. the maximum load increment) of the server cluster's historical production load over 15 minutes:
[0100] A1=Max{[∑S×P) t+15 ]-[∑(S×P) t ]}; (6)
[0101] In formula (6), S is the working resources of a single server and P is the workload.
[0102] Calculate the target tolerable resource load range A2:
[0103] A2=∑S×Y); (7)
[0104] In formula (7), S is the working resources of a single server, and Y is the target tolerance rate.
[0105] Based on formula (6) and formula (7), the maximum load growth value A1 within 15 minutes and the target tolerance resource load range A2 are calculated respectively.
[0106] If A1<=A2, the server performance will not be affected for 15 minutes;
[0107] If A1>A2, the problem of the server's performance being affected by 15 minutes will occur. At this time, if the number of unloaded servers is increased, because the workload P of the newly added servers is 0, A1 remains unchanged and A2 increases by ∑(S×Y). Therefore, the optimal number of servers is calculated through the load, which can avoid the problem of the server starting up for 15 minutes and affecting performance.
[0108] Assuming there are N servers, A1>A2, then the number of servers to be added is calculated as follows:
[0109]
[0110] Among them, p t+15 -p t is the third workload, Y is the target tolerance rate, and S is the working resources of a single server.
[0111] According to formula (8), as long as there are N+N1 servers in the cluster, the problem of the server starting up in 15 minutes affecting performance can be avoided.
[0112] The embodiment of the present application calculates the maximum load growth A1 of the server cluster in a historical time period equal to the server startup time based on the server startup time. At the same time, the target tolerance resource load range A2 is calculated based on the server resources and the target tolerance rate. When A1>A2, the number of servers required to be added is calculated based on A1 and A2, so that by adding this number of servers in the cluster, the impact of the startup time on the business can be avoided, and the business stability and continuity can be improved.
[0113] In order to further analyze and explain the resource management provided in the embodiment of the present application, refer to Figure 2 And the following examples.
[0114] DPM monitoring, detection, and management equipment is mainly divided into two parts, one part controls the number of clusters, and the other part controls the effective load evaluation.
[0115] (1) Cluster quantity control, divided into three components:
[0116] Cluster quantity detection: collect the number of existing servers in the cluster.
[0117] DPM cluster performance testing: Long-term statistics on cluster performance are collected, the maximum load growth within 15 minutes is collected, and effective calculations are performed based on the number of existing servers in the cluster.
[0118] DPM start-stop device: determines whether to start or stop DPM operation based on the results of effective calculation.
[0119] (2) Payload assessment control, divided into two components:
[0120] Performance testing: Collect the workload of virtual machines in the cluster every 5 minutes.
[0121] DPM effective evaluation: Use the allocation ratio to evaluate the workload and determine whether it is necessary to start or shut down servers to meet the load requirements.
[0122] The above components work together to achieve monitoring, detection and management of distributed power management. Cluster quantity control ensures that the number of servers in the cluster is suitable for the current load requirements, while effective load assessment control decides whether to start or shut down the server by evaluating the load situation to maintain a balance in resource utilization.
[0123] The DPM monitoring, detection, and management equipment provided in the embodiments of the present application can help optimize resource utilization, reduce energy consumption, and ensure that the cluster maintains an efficient and stable operating state while meeting performance requirements. At the same time, by dynamically adjusting the number of clusters and starting and stopping servers, energy savings and performance optimization can be achieved.
[0124] The resource management device provided in an embodiment of the present application is described below. The resource management device described below and the resource management method described above can be referenced to each other.
[0125] refer to Figure 3 , Figure 3 It is a structural diagram of the resource management device provided in the embodiment of the present application. The resource management device provided in the embodiment of the present application includes an acquisition module 301, an allocation rate weighted value determination module 302, a startup quantity determination module 303 and a resource management module 304.
[0126] An acquisition module 301 is used to acquire a first workload of a server cluster when a service increment is greater than or equal to a first set threshold;
[0127] An allocation rate weighted value determination module 302 is used to determine the allocation rate weighted value of the server resources if the first workload is greater than or equal to a second set threshold; the second set threshold is determined based on a target utilization rate and a target tolerance rate of resources in the server cluster;
[0128] A startup number determination module 303, configured to determine a first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster;
[0129] The resource management module 304 is configured to start up unloaded servers in the server cluster based on the first startup quantity.
[0130] The resource management device provided in the embodiment of the present application obtains the first workload of the server cluster when the business increment is greater than or equal to the first set threshold; if the first workload is greater than or equal to the second set threshold, the weighted value of the allocation rate of the server resources is determined; the second set threshold is determined based on the target utilization rate and the target tolerance rate of the resources in the server cluster; based on the weighted value of the allocation rate, the target utilization rate, and the working resources and workload of each server in the server cluster, the first startup number of idle servers is determined; based on the first startup number, the idle servers in the server cluster are started. The embodiment of the present application effectively evaluates the workload by using the weighted value of the allocation rate, avoids multiple cyclic evaluations and cyclic startups, and thus improves business stability and continuity.
[0131] In one embodiment, the allocation rate weighted value determination module 302 is specifically configured to:
[0132] Determining virtual resources of each server based on the number of virtual machines of each server and the working resources of each of the virtual machines;
[0133] A first quotient value between the virtual resources of each server and the working resources of each server is obtained, and the first quotient value is used as a weighted value of the allocation rate of each server.
[0134] In one embodiment, the startup quantity determination module 303 is specifically used to:
[0135] Determining resource consumption of each server based on the working resources, workload and the weighted value of the allocation rate of each server;
[0136] Determine the initial startup quantity of each server based on the resource consumption of each server and the working resources of each server;
[0137] A second quotient of the initial startup quantity and the target utilization rate is obtained, and the first startup quantity is determined based on the second quotient.
[0138] In one embodiment, the startup quantity determination module 303 is further used to:
[0139] If the weighted value of the allocation rate is less than or equal to a third set threshold, determining a second startup number of idle servers based on the target utilization rate, the working resources and the workload of each server, and starting the idle servers in the server cluster based on the second startup number;
[0140] If the allocation rate weighted value is greater than the third set threshold, the step of determining the first startup number of unloaded servers based on the allocation rate weighted value, the target utilization, and the working resources and workload of each server in the server cluster is executed.
[0141] In one embodiment, the resource management module 304 is specifically configured to:
[0142] Obtaining the remaining number of unloaded servers in the server cluster;
[0143] If the first startup number is less than or equal to the remaining number, starting the idle server based on the first startup number;
[0144] If the first startup quantity is greater than the remaining quantity, the unloaded servers are started based on the remaining quantity.
[0145] In one embodiment, the resource management module 304 is further configured to:
[0146] When the service increment is less than the first set threshold, obtaining the maximum load increment of the server cluster within the server startup time;
[0147] Determining a target tolerance resource load range based on the working resources of each server in the server cluster and the target tolerance rate;
[0148] If the maximum load increment is greater than the maximum value in the target tolerant resource load range, a third startup quantity of the unloaded servers is determined.
[0149] In one embodiment, the resource management module 304 is further configured to:
[0150] Obtaining a difference between a third workload of each server within the server startup time and the target tolerance rate;
[0151] Obtaining a first product of the working resources of each server and the difference, and a second product of the working resources of each server and the target tolerance rate;
[0152] A third quotient of the first product and the second product is obtained, and the third power-on quantity is determined based on the third quotient.
[0153] Figure 4 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 4 As shown, the electronic device may include: a processor 410, a communication interface 420, a memory 430 and a communication bus 440, wherein the processor 410, the communication interface 420 and the memory 430 communicate with each other through the communication bus 440. The processor 410 may call a computer program in the memory 430 to execute the steps of the resource management method, for example including:
[0154] When the service increment is greater than or equal to a first set threshold, obtaining a first workload of the server cluster;
[0155] If the first workload is greater than or equal to a second set threshold, determining a weighted value of the allocation rate of the server resources; the second set threshold is determined based on a target utilization rate and a target tolerance rate of resources in the server cluster;
[0156] Determine a first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster;
[0157] The idle servers in the server cluster are started based on the first startup quantity.
[0158] In addition, the logic instructions in the above-mentioned memory 430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk.
[0159] On the other hand, an embodiment of the present application further provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the resource management method provided in the above embodiments are implemented, for example, including:
[0160] When the service increment is greater than or equal to a first set threshold, obtaining a first workload of the server cluster;
[0161] If the first workload is greater than or equal to a second set threshold, determining a weighted value of the allocation rate of the server resources; the second set threshold is determined based on a target utilization rate and a target tolerance rate of resources in the server cluster;
[0162] Determine a first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster;
[0163] The idle servers in the server cluster are started based on the first startup quantity.
[0164] On the other hand, an embodiment of the present application further provides a computer program product, the computer program product including a computer program, the computer program may be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform the steps of the resource management method provided in the above embodiments, for example, including:
[0165] When the service increment is greater than or equal to a first set threshold, obtaining a first workload of the server cluster;
[0166] If the first workload is greater than or equal to a second set threshold, determining a weighted value of the allocation rate of the server resources; the second set threshold is determined based on a target utilization rate and a target tolerance rate of resources in the server cluster;
[0167] Determine a first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster;
[0168] The idle servers in the server cluster are started based on the first startup quantity.
[0169] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0170] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0171] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A resource management method, characterized in that: include: When the service increment is greater than or equal to a first set threshold, obtaining a first workload of the server cluster; If the first workload is greater than or equal to a second set threshold, determining a weighted value of the allocation rate of the server resources; The second set threshold is determined based on a target utilization rate and a target tolerance rate of resources in the server cluster; Determine a first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster; The idle servers in the server cluster are started based on the first startup quantity.
2. The resource management method according to claim 1, characterized in that: The step of determining the weighted value of the allocation rate of the server resources comprises: Determining virtual resources of each server based on the number of virtual machines of each server and the working resources of each of the virtual machines; A first quotient value between the virtual resources of each server and the working resources of each server is obtained, and the first quotient value is used as a weighted value of the allocation rate of each server.
3. The resource management method according to claim 1, characterized in that: The determining a first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster includes: Determining resource consumption of each server based on the working resources, workload and the weighted value of the allocation rate of each server; Determine the initial startup quantity of each server based on the resource consumption of each server and the working resources of each server; A second quotient of the initial startup quantity and the target utilization rate is obtained, and the first startup quantity is determined based on the second quotient.
4. The resource management method according to claim 1, characterized in that: Before determining the first startup number of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster, the method further includes: If the weighted value of the allocation rate is less than or equal to a third set threshold, determining a second startup number of idle servers based on the target utilization rate, the working resources and the workload of each server, and starting the idle servers in the server cluster based on the second startup number; If the allocation rate weighted value is greater than the third set threshold, the step of determining the first startup number of unloaded servers based on the allocation rate weighted value, the target utilization, and the working resources and workload of each server in the server cluster is executed.
5. The resource management method according to claim 1, characterized in that: The step of starting up the idle servers in the server cluster based on the first startup quantity includes: Obtaining the remaining number of unloaded servers in the server cluster; If the first startup number is less than or equal to the remaining number, starting the idle server based on the first startup number; If the first startup quantity is greater than the remaining quantity, the unloaded servers are started based on the remaining quantity.
6. The resource management method according to claim 1, characterized in that: The method further comprises: When the service increment is less than the first set threshold, obtaining the maximum load increment of the server cluster within the server startup time; Determining a target tolerance resource load range based on the working resources of each server in the server cluster and the target tolerance rate; If the maximum load increment is greater than the maximum value in the target tolerant resource load range, a third startup quantity of the unloaded servers is determined.
7. The resource management method according to claim 6, characterized in that: The determining a third startup quantity of the idle servers includes: Obtaining a difference between a third workload of each server within the server startup time and the target tolerance rate; Obtaining a first product of the working resources of each server and the difference, and a second product of the working resources of each server and the target tolerance rate; A third quotient of the first product and the second product is obtained, and the third power-on quantity is determined based on the third quotient.
8. A resource management device, characterized in that: include: An acquisition module, configured to acquire a first workload of the server cluster when a service increment is greater than or equal to a first set threshold; an allocation rate weighted value determination module, configured to determine an allocation rate weighted value of server resources if the first workload is greater than or equal to a second set threshold; The second set threshold is determined based on a target utilization rate and a target tolerance rate of resources in the server cluster; A startup quantity determination module, configured to determine a first startup quantity of idle servers based on the allocation rate weighted value, the target utilization rate, and the working resources and workload of each server in the server cluster; A resource management module is used to start up unloaded servers in the server cluster based on the first startup quantity.
9. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the steps of the resource management method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the resource management method according to any one of claims 1 to 7 are implemented.
