WO2015101091A1 - Distributed resource scheduling method and device - Google Patents
Distributed resource scheduling method and device Download PDFInfo
- Publication number
- WO2015101091A1 WO2015101091A1 PCT/CN2014/089636 CN2014089636W WO2015101091A1 WO 2015101091 A1 WO2015101091 A1 WO 2015101091A1 CN 2014089636 W CN2014089636 W CN 2014089636W WO 2015101091 A1 WO2015101091 A1 WO 2015101091A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- server
- resource usage
- scheduling
- usage rate
- virtual machine
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5083—Techniques for rebalancing the load in a distributed system
- G06F9/5088—Techniques for rebalancing the load in a distributed system involving task migration
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L9/00—Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
- H04L9/40—Network security protocols
Definitions
- the present invention relates to resource scheduling technologies, and in particular, to a distributed resource scheduling method and apparatus.
- each server in a server cluster generally includes multiple virtual machines running different types of services.
- compute nodes such as a compute node.
- QoS Quality of Service
- the virtual machine in which 15 desktop cloud virtual machines are compiled, and 25 cloud virtual machines are compiled.
- a distributed resource scheduling program (Distributed Resource) is adopted.
- Scheduler maximizes the resource utilization in the cluster. For example, DRS migrates the overloaded virtual machine to a server with low load. At this time, the resource usage of the overloaded virtual machine is improved, and the original server is used.
- the resource occupancy rate of the virtual machine has also been improved, and the overall resource occupancy rate of the cluster has been improved.
- the embodiment of the invention provides a distributed resource scheduling method and device, which can guarantee the service quality of each service virtual machine in each server during distributed resource scheduling.
- a distributed resource scheduling method including:
- obtaining according to the resource usage rate of the service virtual machine of the same type in each server, a first standard deviation of the resource usage rate of the same type of service virtual machine in each server by using a predetermined obtaining step, where the obtaining step is: Acquiring an average resource usage rate of the same type of service virtual machine in each server according to the resource usage rate of the same type of service virtual machine in each server, and according to resource usage of the same type of service virtual machine in each server Rate and the average resource usage rate, obtaining a first standard deviation of resource usage rates of the same type of service virtual machine in each server;
- the distributed cluster is The same type of service virtual machine of any server in the system is balancedly dispatched to other servers of the distributed cluster system;
- the method further compares the second standard deviation acquired after the balanced scheduling at least once, and before performing the balance scheduling corresponding to the minimum second standard deviation, the method further Includes:
- the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the next balanced scheduling is greater than or equal to the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling.
- the second standard deviation, or the next balance scheduling, and the cumulative number of times of the balanced scheduling exceeds the first set threshold, then the performing the obtaining step and the next balancing scheduling are stopped.
- a distributed resource scheduling method including:
- obtaining step is: acquiring the resource according to the resource usage rate of each server The average resource usage of the distributed cluster system, and the third standard deviation of the resource usage rate of the distributed cluster system is obtained according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system;
- the third standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the scheduling threshold of the resource usage rate of the distributed cluster system, balancing any service virtual machine in each server to the In other servers of the distributed cluster system;
- the method further compares the fourth standard deviation acquired after the balanced scheduling at least once, before performing the balance scheduling corresponding to the minimum fourth standard deviation, include:
- the fourth standard deviation of the resource usage rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the resource usage rate of the distributed cluster system after performing the current balanced scheduling.
- the fourth standard deviation, or the next balance scheduling after the cumulative number of the balanced scheduling exceeds the first set threshold, or after the service virtual machine is balancedly dispatched from any first server to any second server,
- the change in the total amount of each type of service virtual machine in any one of the first servers or any of the second servers is greater than a second set threshold, and/or any of the first servers or any of the second If the change of the resources of the first service server in the server is greater than the third set threshold, the obtaining step and the next balanced scheduling are stopped.
- a distributed resource scheduling apparatus including:
- a first acquiring unit configured to acquire resource usage rates of the same type of service virtual machines in each server in the distributed cluster system
- a second acquiring unit configured to acquire, according to a resource usage rate of the same type of service virtual machine in each server, a first standard deviation of resource usage rates of the same type of service virtual machine in each server by using a predetermined acquisition manner Obtaining, according to the resource usage rate of the same type of service virtual machine in each server, obtaining an average resource usage rate of the same type of service virtual machine in each server, and according to the same in each server The resource usage rate of the type service virtual machine and the average resource usage rate, and obtaining a first standard deviation of resource usage rates of the same type of service virtual machine in each server;
- a first scheduling unit configured to: when a first standard deviation of resource usage rates of the same type of service virtual machines in the servers is greater than or equal to a scheduling threshold of resource usage rates of the same type of service virtual machines in each server And balancing the same type of service virtual machines of any one of the servers in the distributed cluster system to other servers of the distributed cluster system;
- a third acquiring unit configured to obtain resource usage rates of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling
- a fourth acquiring unit configured to acquire, according to the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system, the same type in each server The second standard deviation of the resource usage of the business virtual machine;
- a first comparing unit configured to compare the second standard deviation acquired after the balancing scheduling at least once
- a first execution unit configured to perform the balance scheduling corresponding to the minimum of the second standard deviation.
- the first execution unit is further configured to:
- the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the next balanced scheduling is greater than or equal to the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling.
- the second standard deviation of the second type, or the next balance scheduling if the cumulative number of the balanced scheduling exceeds the first set threshold, the second criterion for stopping the resource utilization rate of the same type of service virtual machine in each server is stopped. Poor acquisition and next balanced scheduling.
- a distributed resource scheduling apparatus including:
- a fifth obtaining unit configured to acquire, according to a proportion of resources of each type of service virtual machines in each server in the distributed cluster system, and a resource usage rate of each type of service virtual machine in each server, Server resource usage rate;
- a sixth obtaining unit configured to acquire, according to the resource usage rate of each server, a third standard deviation of the resource usage rate of the distributed cluster system by using a predetermined acquisition manner, where the obtaining manner is: according to each server
- the resource usage rate obtains the average resource usage rate of the distributed cluster system, and acquires resource usage of the distributed cluster system according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system.
- a second scheduling unit configured to: when the third standard deviation of resource usage of the distributed cluster system is greater than or equal to a scheduling threshold of resource usage of the distributed cluster system, any service in each server Virtual machine balancing is dispatched to other servers of the distributed cluster system;
- a seventh acquiring unit configured to obtain resource usage rates of servers in the distributed cluster system after the balanced scheduling
- An eighth obtaining unit configured to acquire, according to the resource usage rate of each server in the distributed cluster system after the balanced scheduling, the fourth standard of resource utilization rate of the distributed cluster system after the balanced scheduling by using the predetermined acquiring manner difference;
- a second comparing unit configured to compare the fourth standard deviation acquired after the balanced scheduling at least once
- a second execution unit configured to perform the balance scheduling corresponding to the minimum of the fourth standard deviation.
- the second execution unit is further configured to:
- the fourth standard deviation of the resource usage rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the fourth standard deviation of the resource usage rate of the distributed cluster system after the current balancing scheduling, or the next time Balanced scheduling, after the cumulative number of times of the balanced scheduling exceeds a first set threshold, or after the service virtual machine is balancedly dispatched from any first server to any second server, any of the first servers or offices.
- the change of the total amount of the service virtual machines in any of the second servers is greater than the second set threshold, and/or the service virtual machines occupying any of the first servers or any of the second servers If the change of the resources of any of the first servers is greater than the third set threshold, the resource usage rate acquisition and the next balanced scheduling of the distributed cluster system after the balanced scheduling are stopped.
- the technical solution of the distributed resource scheduling method and device provided by the embodiment of the present invention is adopted according to the type of the service virtual machine in each server in the distributed cluster system, or according to the server of the various service virtual machines in each server.
- the proportion of resources is distributed resource scheduling, which can guarantee the service quality of each service virtual machine in each server.
- FIG. 1 is a schematic flowchart of a distributed resource scheduling method according to an embodiment of the present disclosure
- FIG. 2 is a schematic flowchart of another distributed resource scheduling method according to an embodiment of the present invention.
- FIG. 3 is a schematic flowchart of still another distributed resource scheduling method according to an embodiment of the present disclosure.
- FIG. 4 is a schematic flowchart diagram of still another distributed resource scheduling method according to an embodiment of the present disclosure.
- FIG. 5 is a schematic structural diagram of a distributed resource scheduling apparatus according to an embodiment of the present disclosure.
- FIG. 6 is a schematic structural diagram of another distributed resource scheduling apparatus according to an embodiment of the present disclosure.
- FIG. 7 is a schematic structural diagram of a distributed resource scheduling device according to an embodiment of the present disclosure.
- FIG. 8 is a schematic structural diagram of another distributed resource scheduling device according to an embodiment of the present invention.
- FIG. 1 is a schematic flowchart diagram of a distributed resource scheduling method according to an embodiment of the present invention. The method includes the following steps:
- Step S101 Obtain a resource usage rate of a service virtual machine of the same type in each server in the distributed cluster system.
- a server cluster of virtualization or cloud computing includes multiple servers, each of which includes multiple virtual machines, which can run different types of services, called business virtual machines.
- the DRS technology is used to allocate resources of the server cluster.
- the system allocates certain resources to each server, and each server allocates corresponding resources to each virtual machine. Therefore, the server cluster is also called a distributed cluster system, and the resources here are Refers to central processing unit (CPU), memory, and input/output (I/O) control, storage, and input/output resources.
- the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system is obtained by acquiring a monitor in each server, and the monitor monitors the type of service virtual in the server.
- the resource usage rate of the device is reported to the DRS, or the DRS requests the monitor to use the resource usage rate of the virtual machine of the type.
- the number of times the resource usage rate of the service virtual machine of the type is obtained from the monitor may be one time or multiple times.
- the resource usage rate herein may be a usage rate of a certain resource, or may be a weighted value of resource usage rates of various resources such as CPU, memory, and I/O.
- Each of the servers in the distributed cluster system has one or more types of service virtual machines, for example, a desktop cloud virtual machine and a compiled cloud virtual machine.
- resources of the same type of virtual machine in each server are respectively obtained according to the service type. Usage rate.
- DRS allocates certain CPU, memory and I/O resources to the servers 1, 2 and 3 in the cluster. Each server allocates certain internal virtual machines. For CPU, memory, and I/O resources, taking CPU resource allocation as an example, DRS allocates CPU resources of number A to server 1, allocates CPU resources of quantity B to server 2, and allocates CPU resources of number C to server 3.
- the server 1 allocates CPU resources of A1, A2, A3, and A4 to the two desktop cloud virtual machines and the two compiled cloud virtual machines respectively, and takes the resource usage rate of the desktop cloud virtual machine as an example, and two in the server 1
- the resource utilization rate of the desktop cloud virtual machine is 30% and 40%, respectively, and the resource utilization rate of the CPU of the desktop cloud virtual machine in the server 1 is (30%*A1+40%*A2)/(A1+A2), Then calculate the total memory of the desktop cloud virtual machine in server 1 in the same way.
- the resource usage rate of the I/O, and then the total CPU, memory, and I/O resource usage rate are weighted, and the resource usage rate of the desktop cloud virtual machine of the server 1 is obtained, and the servers 2 and 3 are obtained by analogy.
- Resource usage of the desktop cloud virtual machine At the same time, the resource usage rate of the compiled cloud virtual machine in each server can also be obtained in the same manner.
- Step S102 Acquire, according to a resource usage rate of the same type of service virtual machine in each server, a first standard deviation of resource usage rates of the same type of service virtual machine in each server by using a predetermined obtaining step, where the obtaining The step is: obtaining an average resource usage rate of the same type of service virtual machine in each server according to the resource usage rate of the same type of service virtual machine in each server, and according to the same type of service virtual machine in each server The resource usage rate and the average resource usage rate obtain a first standard deviation of resource usage rates of the same type of service virtual machine in each server.
- the DRS technology is used to ensure the maximum resource utilization in the cluster. Therefore, the standard deviation between the resource usage rate of the same type of service virtual machine in each server in the cluster and the average resource usage rate of the same type of service virtual machine in each server is calculated.
- the standard deviation is used for the degree of dispersion of the reaction data, and its calculation formula is as shown in formula (1):
- the standard deviation acquisition step it is first necessary to obtain the average resource usage rate of the same type of service virtual machine in each server.
- the resource usage rate of the same type of service virtual machine in each server has been obtained in step S101, and the average resource usage rate of the same type of service virtual machine in each server can be obtained according to the existing calculation manner. For example, in the previous example, if there are three servers, the resource usage rate of the same type of service virtual machine in each server is obtained and divided by the number of servers, that is, the average resource usage rate is obtained.
- Step S103 when the first standard deviation of the resource usage rate of the same type of service virtual machine in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machine in each server, The same type of service virtual machine of any server in the distributed cluster system is balancedly dispatched to other servers of the distributed cluster system.
- the system can determine whether the resource usage of the type of service virtual machine in each server is unbalanced, and the larger the standard deviation, the imbalance rate is indicated. The higher. It should be noted that, since there are multiple types of service virtual machines in each server, the standard deviation of the average resource usage rate obtained from each of the same types of service virtual machines in each server is calculated, and the standard deviation obtained is obtained. The result may be that the resource usage of one type of business virtual machine is balanced, while the resource usage of another type of business virtual machine is out of balance.
- the scheduling is triggered when the first standard deviation of the resource usage rate of the same type of service virtual machine in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machine in each server.
- the recursive scheduling process may be performed in a recursive scheduling process by balancing the same type of service virtual machines of any server in the distributed cluster system to other servers of the distributed cluster system.
- Step S104 The resource usage rate of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling is obtained.
- Step S105 according to the foregoing in each server in the distributed cluster system after the balanced scheduling
- the resource usage rate of the service virtual machine of the same type is obtained by the predetermined obtaining step, and the second standard deviation of the resource usage rate of the same type of service virtual machine in each server is obtained.
- the impact of the scheduling virtual machine on the imbalance rate is obtained, that is, the standard deviation of the resource usage rate of the same type of service virtual machine in each server after the balanced scheduling is re-acquired.
- the resource usage rate of the same type of service virtual machine in each server changes, firstly, the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling is obtained. Then, according to the predetermined standard deviation obtaining step, the standard deviation of the resource usage rate of the same type of service virtual machine in each server after the round balancing scheduling is obtained.
- Step S106 Compare the second standard deviation acquired after the balanced scheduling at least once, and perform the minimum balanced scheduling corresponding to the second standard deviation.
- a plurality of rounds of the above-mentioned balanced scheduling may be performed, and a certain policy may be used for scheduling, for example, the overloaded service virtual machine is scheduled to other servers, which is not limited in the embodiment of the present invention.
- distributed resource scheduling is performed for the same type of service virtual machine in each server
- distributed resource scheduling of each type of service virtual machine in each server may be separately performed, if resources of a certain type of service virtual machine The distributed resource scheduling is performed using equalization.
- the distributed resource scheduling according to the type of the service virtual machine in each server in the distributed cluster system can ensure the service quality of each service virtual machine in each server. .
- FIG. 2 is a schematic flowchart diagram of another distributed resource scheduling method according to an embodiment of the present invention.
- the method is different from the previous embodiment in that step S206 is further included: if the resource usage rate of the same type of service virtual machine in each server is performed after the next balanced scheduling is performed.
- the second standard deviation is greater than or equal to the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling, or the next balancing schedule is performed, and the cumulative number of the balanced scheduling is exceeded.
- the threshold is set, the acquisition step and the next balanced scheduling are stopped.
- Recursive scheduling is used to make the scheduling efficiency the highest, and the recursive exit condition is set in the recursive scheduling, that is, the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the next balanced scheduling is greater than or equal to Performing the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling, or ending the next balancing scheduling, and stopping the cumulative number of the balancing scheduling exceeding the first set threshold, then stopping The acquisition step and the next balanced scheduling are performed. This helps to stop the above acquisition steps and balance scheduling in time, obtain the minimum standard deviation, and perform the balanced scheduling corresponding to the minimum standard deviation.
- FIG. 3 is a schematic flowchart diagram of still another distributed resource scheduling method according to an embodiment of the present invention. The method includes the following steps:
- Step S301 Acquire resource usage of each server according to a proportion of resources of each server in each server in the distributed cluster system, and a resource usage rate of each type of service virtual machine in each server. rate.
- each server there are one or more types of service virtual machines in each server. For example, there are desktop cloud virtual machines and compiled cloud virtual machines. DRS allocates certain operations, storage, and input/output to each server in the cluster. Resources, each server allocates the resources it obtains to its internal types of business virtual machines in a certain proportion. Ensure that the total amount and proportion of resources of different types of service virtual machines in each server remain stable, and the service quality of various service virtual machines in each server can be guaranteed.
- the DRS allocates certain CPU, memory, and I/O resources to the servers 1, 2, and 3 in the cluster. Each server allocates a certain CPU to each internal virtual machine. For example, the CPU and the I/O resources are allocated to the CPU 1 by the DRS. The DRS allocates the CPU resources of the number A to the server 1 and allocates the quantity B to the server 2. CPU resources are allocated to the server 3 with a CPU resource of C.
- the server 1 allocates CPU resources of A1, A2, A3, and A4 to the two desktop cloud virtual machines and the two compiled cloud virtual machines respectively.
- the resource utilization rate of the desktop cloud virtual machine is 30% and 40% respectively, and the resource utilization rates of the two compiled cloud virtual machines in the server 1 are 40% and 50%, respectively, and the resource utilization rate of the CPU of the server 1 is obtained ( 30%*A1+40%*A2+40%*A3+50%A4)/(A1+A2+A3+A4), and then calculate the memory and I/ of each type of virtual machine in server 1 in the same way.
- the resource usage rate of O is weighted by the CPU, memory, and I/O resource usage of the server 1, and the resource usage rate of the server 1 is obtained, and the calculations of the servers 2 and 3 are deduced by analogy.
- Step S302 Obtain a third standard deviation of the resource usage rate of the distributed cluster system by using a predetermined acquisition step according to the resource usage rate of each server, where the obtaining step is: according to the resource usage rate of each server Acquiring an average resource usage rate of the distributed cluster system, and acquiring a third resource utilization rate of the distributed cluster system according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system. Standard deviation.
- the difference from the foregoing embodiment is that, for all kinds of service virtual machines in each server, the resource usage rate of each server and the average resource usage rate of the entire distributed cluster system are obtained in the same manner as the foregoing embodiment, and then According to formula (1), the standard deviation of resource utilization rate of the distributed cluster system is obtained.
- Step S303 when the third standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the scheduling threshold of the resource usage rate of the distributed cluster system, balance scheduling of any service virtual machine in each server. To other servers in the distributed cluster system.
- the scheduling threshold of the system's resource usage triggers balanced scheduling.
- the object of balanced scheduling can be any business virtual machine in each server.
- Step S304 the resource usage rate of each server in the distributed cluster system after the balanced scheduling is obtained.
- Step S305 According to the resource usage rate of each server in the distributed cluster system after the balanced scheduling, obtain the fourth standard deviation of the resource usage rate of the distributed cluster system after the balanced scheduling by using the predetermined obtaining step.
- Step S306 comparing the fourth standard deviation acquired after the balanced scheduling at least once, and performing the minimum balanced scheduling corresponding to the fourth standard deviation.
- Step S304-step S306 is similar to step S104-step S106 of the foregoing embodiment, and is not described here again. The difference is that, for each type of service virtual machine in each server, the obtained distributed cluster system is obtained. The standard deviation of resource usage.
- distributed resource scheduling can be performed according to the ratio of the resources of the servers in which the various service virtual machines occupy the server, so that the services of the service virtual machines in each server can be guaranteed. quality.
- FIG. 4 is a schematic flowchart diagram of still another distributed resource scheduling method according to an embodiment of the present invention.
- the method is different from the previous embodiment in that step S406 is further included: the fourth standard deviation of the resource usage rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the distribution after the current balancing scheduling is performed.
- the total amount of the various service virtual machines in any one of the first servers or any of the second servers is greater than a second set threshold, and/or any of the first If the change of the resources of the first service server of the server or the any of the second servers is greater than the third set threshold, the obtaining step and the next balanced scheduling are stopped.
- Recursive scheduling can be used to make the scheduling efficiency the highest, and the recursive exit condition is set in the recursive scheduling. That is, after the next balanced scheduling, the fourth standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the current balancing scheduling.
- the server balances the scheduling to any of the second servers the total amount of the various service virtual machines in any one of the first servers or any of the second servers is greater than a second set threshold, and/or the Stopping the obtaining step and the next balancing when the change of the resources of the first server or the any of the second servers in the first server is greater than the third set threshold.
- Scheduling This helps to stop the above acquisition steps and balance scheduling in time, to obtain the minimum standard deviation, and to perform the minimum The standard deviation corresponds to the balanced scheduling.
- FIG. 5 is a schematic structural diagram of a distributed resource scheduling apparatus according to an embodiment of the present invention.
- the device 1000 includes:
- the first obtaining unit 11 is configured to acquire resource usage rates of the same type of service virtual machines in each server in the distributed cluster system.
- a server cluster of virtualization or cloud computing includes multiple servers, each of which includes multiple virtual machines, which can run different types of services, called business virtual machines.
- the DRS technology is used to allocate resources of the server cluster.
- the system allocates certain resources to each server, and each server allocates corresponding resources to each virtual machine. Therefore, the server cluster is also called a distributed cluster system, and the resources here are Refers to central processing unit (CPU), memory, and input/output (I/O) control, storage, and input/output resources.
- the first obtaining unit 11 obtains the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system, and the obtaining manner may be: setting a monitor in each server, and the monitor monitoring the type of service virtual in the server
- the resource usage rate of the device is reported to the DRS, or the DRS requests the monitor to use the resource usage rate of the virtual machine of the type.
- the number of times the resource usage rate of the service virtual machine of the type is obtained from the monitor may be one time or multiple times.
- the resource usage rate herein may be a usage rate of a certain resource, or may be a weighted value of resource usage rates of various resources such as CPU, memory, and I/O.
- Each of the servers in the distributed cluster system has one or more types of service virtual machines, for example, a desktop cloud virtual machine and a compiled cloud virtual machine.
- resources of the same type of virtual machine in each server are respectively obtained according to the service type. Usage rate.
- DRS allocates certain CPU, memory and I/O resources to the servers 1, 2 and 3 in the cluster. Each server allocates certain internal virtual machines. CPU, memory, and I/O resources. Taking CPU resource allocation as an example, DRS allocates CPU resources of number A to server 1, and allocates the number of servers to server 2.
- the resource usage rate of the cloud virtual machine in the server 1 is 30% and 40% respectively, and the resource utilization rate of the CPU of the desktop cloud virtual machine in the server 1 is obtained (30%). *A1+40%*A2)/(A1+A2), and then calculate the total memory and I/O resource usage rate of the desktop cloud virtual machine in server 1 in the same way, and then the total CPU and memory.
- the resource usage rate of the I/O is weighted, the resource usage rate of the desktop cloud virtual machine of the server 1 is obtained, and the resource usage rate of the desktop cloud virtual machine of the servers 2 and 3 is obtained by analogy.
- the resource usage rate of the compiled cloud virtual machine in each server can also be obtained in the same manner.
- the second obtaining unit 12 is configured to acquire, according to a resource usage rate of the same type of service virtual machine in each server, a first standard of resource utilization rate of the same type of service virtual machine in each server by using a predetermined acquisition manner.
- the obtaining manner is: obtaining an average resource usage rate of the same type of service virtual machine in each server according to a resource usage rate of the same type of service virtual machine in each server, and according to the The resource usage rate of the same type of service virtual machine and the average resource usage rate obtain the first standard deviation of the resource usage rate of the same type of service virtual machine in each server.
- the second obtaining unit 12 obtains the resource usage rate of the same type of service virtual machine in each server in the cluster and the average resource usage of the same type of service virtual machine in each server.
- the standard deviation of the rate, the standard deviation is used for the degree of dispersion of the reaction data, and the calculation formula is as shown in the formula (1).
- the second obtaining unit 12 first needs to obtain the average resource usage rate of the same type of service virtual machine in each server.
- the first obtaining unit 11 has acquired the resource usage rate of the same type of service virtual machine in each server, and the second obtaining unit 12 can obtain the average resource usage rate of the same type of service virtual machine in each server according to the existing calculation manner. For example, in the previous example, if there are three servers, the resource usage rate of the same type of service virtual machine in each server is obtained and divided by the number of servers, that is, the average resource usage rate is obtained.
- the second obtaining unit 12 obtains the same type of service virtuality in each server according to formula (1).
- the first scheduling unit 13 is configured to: when a first standard deviation of resource usage rates of the same type of service virtual machines in the servers is greater than or equal to a scheduling threshold of resource usage rates of the same type of service virtual machines in the servers The same type of service virtual machine of any one of the servers in the distributed cluster system is balancedly dispatched to other servers of the distributed cluster system.
- the system can determine whether the resource usage of the type of service virtual machine in each server is unbalanced, and the larger the standard deviation, the imbalance rate is indicated. The higher. It should be noted that, since there are multiple types of service virtual machines in each server, the standard deviation of the average resource usage rate obtained from each of the same types of service virtual machines in each server is calculated, and the standard deviation obtained is obtained. The result may be that the resource usage of one type of business virtual machine is balanced, while the resource usage of another type of business virtual machine is out of balance.
- the first scheduling unit 13 triggers Scheduling.
- the recursive scheduling process may be performed in a recursive scheduling process by balancing the same type of service virtual machines of any server in the distributed cluster system to other servers of the distributed cluster system.
- the third obtaining unit 14 is configured to obtain resource usage rates of the same type of service virtual machines in each server in the distributed cluster system after the balanced scheduling.
- the fourth obtaining unit 15 is configured to acquire, according to the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system, the same acquisition manner to obtain the same in each server.
- the fourth obtaining unit 15 acquires the influence of the scheduling virtual machine on the imbalance rate, that is, the fourth obtaining unit 15 re-acquires the standard deviation of the resource usage rate of the same type of service virtual machine in each server after the balanced scheduling.
- the resource usage rate of the same type of service virtual machine in each server changes.
- the third obtaining unit 14 acquires the same type of service virtuality in each server in the distributed cluster system after the balanced scheduling.
- the resource usage rate of the machine, and then the fourth obtaining unit 15 acquires the same in each server after the round balance scheduling according to the predetermined standard deviation acquisition manner.
- a first comparing unit 16 configured to compare the second standard deviation acquired after the balancing scheduling at least once
- the first executing unit 17 is configured to perform the balance scheduling corresponding to the minimum of the second standard deviation.
- a plurality of rounds of the above-mentioned balanced scheduling may be performed, and a certain policy may be used for scheduling, for example, the overloaded service virtual machine is scheduled to other servers, which is not limited in the embodiment of the present invention.
- the first execution unit 17 finally performs the balanced scheduling corresponding to the minimum standard deviation, that is, the balanced scheduling for obtaining the minimum standard deviation is to which one or which virtual machines are scheduled to which server or servers, and the balanced scheduling is performed. .
- distributed resource scheduling is performed for the same type of service virtual machine in each server
- distributed resource scheduling of each type of service virtual machine in each server may be separately performed, if resources of a certain type of service virtual machine The distributed resource scheduling is performed using equalization.
- a distributed resource scheduling apparatus can ensure the service quality of each service virtual machine in each server by performing distributed resource scheduling according to the type of the service virtual machine in each server in the distributed cluster system. .
- the first execution unit 17 may be further configured to: after performing the next balanced scheduling, the second standard deviation of the resource usage rate of the same type of service virtual machine in each server is greater than or equal to the current balance scheduling And stopping, according to the second standard deviation of the resource usage rate of the same type of service virtual machine in each server, or ending the next balanced scheduling, if the cumulative number of the balanced scheduling exceeds the first set threshold, stopping executing the servers The acquisition of the second standard deviation of the resource usage rate of the same type of service virtual machine and the next balanced scheduling.
- Recursive scheduling can be used to make the scheduling efficiency the highest, and the recursive exit condition is set in the recursive scheduling, that is, if the same type of service virtual machine in each server is used after the next balanced scheduling
- the second standard deviation of the resource usage rate is greater than or equal to the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling, or the next balancing scheduling is performed, and the balanced scheduling is performed.
- the first execution unit 17 stops performing the acquisition of the second standard deviation of the resource usage rate of the same type of service virtual machine in each server and the next balanced scheduling. This helps to stop the above acquisition steps and balance scheduling in time, obtain the minimum standard deviation, and perform the balanced scheduling corresponding to the minimum standard deviation.
- FIG. 6 is a schematic structural diagram of another distributed resource scheduling apparatus according to an embodiment of the present invention.
- the device 2000 includes:
- the fifth obtaining unit 21 is configured to obtain, according to a proportion of resources of each type of service virtual machines in each server in the distributed cluster system, and a resource usage rate of each type of service virtual machine in each server, Resource usage of each server.
- each server there are one or more types of service virtual machines in each server. For example, there are desktop cloud virtual machines and compiled cloud virtual machines. DRS allocates certain operations, storage, and input/output to each server in the cluster. Resources, each server allocates the resources it obtains to its internal types of business virtual machines in a certain proportion. Ensure that the total amount and proportion of resources of different types of service virtual machines in each server remain stable, and the service quality of various service virtual machines in each server can be guaranteed.
- the DRS allocates certain CPU, memory, and I/O resources to the servers 1, 2, and 3 in the cluster. Each server allocates a certain CPU to each internal virtual machine. For example, the memory resource and the I/O resource are allocated to the server 1 by the CPU resource allocation.
- the DRS allocates the CPU resource of the number A to the server 1, the CPU resource of the quantity B to the server 2, and the CPU resource of the number C to the server 3.
- the resource utilization rates of the two desktop cloud virtual machines in server 1 are 30% and 40 respectively.
- the resource usage rate of the two compiled cloud virtual machines in the server 1 is 40% and 50%, respectively, and the resource utilization rate of the CPU of the server 1 is obtained (30%*A1+40%*A2+).
- the sixth obtaining unit 22 is configured to acquire, according to the resource usage rate of each server, a third standard deviation of the resource usage rate of the distributed cluster system by using a predetermined acquisition manner, where the obtaining step is: according to the foregoing
- the resource usage rate of the server acquires the average resource usage rate of the distributed cluster system, and acquires the resources of the distributed cluster system according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system.
- the third standard deviation of usage is configured to acquire, according to the resource usage rate of each server, a third standard deviation of the resource usage rate of the distributed cluster system by using a predetermined acquisition manner, where the obtaining step is: according to the foregoing
- the resource usage rate of the server acquires the average resource usage rate of the distributed cluster system, and acquires the resources of the distributed cluster system according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system.
- the third standard deviation of usage is: according to the foregoing
- the difference from the foregoing embodiment is that, for all kinds of service virtual machines in each server, the resource usage rate of each server and the average resource usage rate of the entire distributed cluster system are obtained in the same manner as the foregoing embodiment, and then The sixth obtaining unit 22 obtains the standard deviation of the resource usage rate of the distributed cluster system according to the formula (1).
- a second scheduling unit 23 configured to: when the third standard deviation of resource usage of the distributed cluster system is greater than or equal to a scheduling threshold of resource usage of the distributed cluster system, The business virtual machine is balancedly dispatched to other servers of the distributed cluster system.
- the scheduling threshold of the resource usage rate of the system the second scheduling unit 23 triggers the balancing scheduling.
- the object of balanced scheduling can be any business virtual machine in each server.
- the seventh obtaining unit 24 is configured to obtain resource usage rates of servers in the distributed cluster system after the balanced scheduling.
- the eighth obtaining unit 25 is configured to acquire, according to the resource usage rate of each server in the distributed cluster system after the balanced scheduling, the fourth resource usage rate of the distributed cluster system after the balanced scheduling by using the predetermined acquiring manner Standard deviation.
- a second comparison unit 26 configured to compare the fourth standard deviation acquired after the balance scheduling at least once
- the second executing unit 27 is configured to perform the balance scheduling corresponding to the minimum of the fourth standard deviation.
- the functions of the seventh obtaining unit 24, the eighth obtaining unit 25, the second comparing unit 26, and the second executing unit 27 are respectively the third obtaining unit 14, the fourth obtaining unit 15, the first comparing unit 16, and the third embodiment of the foregoing embodiment.
- the function of an execution unit 17 is similar, and is not described here again. The difference is that for each type of service virtual machine in each server, the standard deviation of the resource usage rate of the distributed cluster system is obtained.
- the distributed resource scheduling apparatus can ensure the service of each service virtual machine in each server by performing distributed resource scheduling according to the proportion of the resources of the servers in which the various service virtual machines occupy the server. quality.
- the second execution unit 27 is further configured to: after the next balanced scheduling, the fourth standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the distributed after the current balancing scheduling
- the resource usage rate of the distributed cluster system after the balancing scheduling is stopped after the change of the resources of the any one of the first server in the second server is greater than the third set threshold. Acquisition and next balanced scheduling.
- Recursive scheduling can be used to make the scheduling efficiency the highest, and the recursive exit condition is set in the recursive scheduling. That is, after the next balanced scheduling, the fourth standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the current balancing scheduling.
- the server balances the scheduling to any of the second servers the total amount of the various service virtual machines in any one of the first servers or any of the second servers is greater than a second set threshold, and/or the A variety of service virtual machines in a first server or any of the second servers account for a large change in resources of any of the first servers
- the second executing unit 27 stops acquiring the resource usage rate of the distributed cluster system and the next balanced scheduling after the balancing scheduling. This helps to stop the above acquisition steps and balance scheduling in time, obtain the minimum standard deviation, and perform the balanced scheduling corresponding to the minimum standard deviation.
- FIG. 7 is a schematic structural diagram of a distributed resource scheduling device according to an embodiment of the present invention.
- the device 3000 of the embodiment includes a processor 31, a memory 32, an input device 33, an output device 34, and a bus system 35. :
- the processor 31 controls the operation of the device 3000, which may also be referred to as a Central Processing Unit (CPU).
- Processor 31 may be an integrated circuit chip with signal processing capabilities.
- the processor 31 can also be a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or the like. Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
- the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
- Memory 32 can include read only memory and random access memory and provides instructions and data to processor 31. A portion of memory 32 may also include non-volatile random access memory (NVRAM).
- NVRAM non-volatile random access memory
- bus system 35 which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc.
- ISA Industry Standard Architecture
- PCI Peripheral Component Interconnect
- EISA Extended Industry Standard Architecture
- the bus may be one or more physical lines, and when it is a plurality of physical lines, it may be divided into an address bus, a data bus, a control bus, and the like.
- the processor 31, the memory 32, and the input device 33 and the output device 34 may also be directly connected through a communication line.
- the input device 33 can be implemented as a mouse, a keyboard, a microphone, etc.
- the output device 34 can be embodied as a display, an audio device, and a video device.
- the input device 33 and the output device 34 can also implement their functions through an input and output device, such as being made touchable. screen.
- the processor 31 reads the computer program in the memory 32 to perform the following steps:
- obtaining according to the resource usage rate of the service virtual machine of the same type in each server, a first standard deviation of the resource usage rate of the same type of service virtual machine in each server by using a predetermined obtaining step, where the obtaining step is: Acquiring an average resource usage rate of the same type of service virtual machine in each server according to the resource usage rate of the same type of service virtual machine in each server, and according to resource usage of the same type of service virtual machine in each server Rate and the average resource usage rate, obtaining a first standard deviation of resource usage rates of the same type of service virtual machine in each server;
- the distributed cluster is The same type of service virtual machine of any server in the system is balancedly dispatched to other servers of the distributed cluster system;
- the processor 31 performs the minimum standard deviation of the second standard deviation corresponding to the second standard deviation obtained after performing the balancing scheduling at least once. , also perform the following steps:
- the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the next balanced scheduling is greater than or equal to the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling.
- the second standard deviation, or the next balance scheduling if the cumulative number of the balanced scheduling exceeds the first set threshold, the execution of the obtaining step is stopped. The next balance is scheduled.
- the computer program included in the processor 31 provided by the embodiment of the present invention may also be implemented as a first acquiring unit, a second acquiring unit, a first scheduling unit, a third acquiring unit, a fourth acquiring unit, a first comparing unit, and the first Executing units, the functions implemented by these units may be referred to the foregoing embodiments, and are not described herein again.
- the distributed resource scheduling device can ensure the service quality of each service virtual machine in each server by performing distributed resource scheduling according to the type of the service virtual machine in each server in the distributed cluster system. .
- FIG. 8 is a schematic structural diagram of another distributed resource scheduling device according to an embodiment of the present invention.
- the device 4000 of the embodiment includes a processor 41, a memory 42, an input device 43, an output device 44, and a bus system 45. among them:
- the processor 41 controls the operation of the device 4000, which may also be referred to as a Central Processing Unit (CPU).
- Processor 41 may be an integrated circuit chip with signal processing capabilities.
- the processor 41 can also be a general-purpose processor, a digital signal processing (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or the like. Programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
- the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
- Memory 42 may include read only memory and random access memory and provides instructions and data to processor 41. A portion of the memory 42 may also include non-volatile random access memory (NVRAM).
- NVRAM non-volatile random access memory
- bus system 45 which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an extended industry standard architecture (Extended Industry Standard Architecture, EISA) bus, etc.
- the bus may be one or more physical lines, and when it is a plurality of physical lines, it may be divided into an address bus, a data bus, a control bus, and the like.
- the processor 41, the memory 42 and the input The incoming device 43 and the output device 44 can also be directly connected via a communication line.
- the input device 43 can be implemented as a mouse, a keyboard, a microphone, etc.
- the output device 44 can be embodied as a display, an audio device, and a video device.
- the input device 43 and the output device 44 can also implement their functions through an input and output device, such as a touchable screen.
- the processor 41 reads the computer program in the memory 42 to perform the following steps:
- obtaining step is: acquiring the resource usage rate according to the resource usage of each server The average resource usage of the distributed cluster system, and the first standard deviation of the resource usage rate of the distributed cluster system is obtained according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system;
- the processor 41 before the step of comparing the second standard deviation acquired after the balance scheduling is performed at least once, performs the step of balancing the balance corresponding to the second standard deviation. Also perform the following steps:
- the cumulative number of times the balanced scheduling is performed exceeds After setting the threshold, or balancing the service virtual machine from any first server to any second server, the service virtual machine of any one of the first server or any of the second servers.
- the change of the total amount is greater than the second set threshold, and/or the change of the resources of the first server or the any of the second servers in the service virtual machine of any one of the first servers is greater than
- the threshold is set third, the obtaining step and the next balanced scheduling are stopped.
- the computer program included in the processor 41 provided by the embodiment of the present invention may also be implemented as a fifth obtaining unit, a sixth obtaining unit, a second scheduling unit, a seventh obtaining unit, an eighth obtaining unit, a second comparing unit, and a second Executing units, the functions implemented by these units may be referred to the foregoing embodiments, and are not described herein again.
- the distributed resource scheduling device can ensure the service of each service virtual machine in each server by performing distributed resource scheduling according to the proportion of the resources of the servers in which the various service virtual machines occupy the server. quality.
- Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another.
- a storage medium may be any available media that can be accessed by a computer.
- the computer readable medium may include a random access memory (RAM), a read-only memory (ROM), and an electrically erasable programmable read-only memory (Electrically Erasable Programmable).
- EEPROM Electrically erasable programmable read-only memory
- CD-ROM Compact Disc Read-Only Memory
- Any connection may suitably be a computer readable medium.
- the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, Then coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, wireless and microwave are included in the fixing of the associated medium.
- DSL Digital Subscriber Line
- a disk and a disc include a compact disc (CD), a laser disc, a compact disc, a digital versatile disc (DVD), a floppy disk, and a Blu-ray disc, wherein the disc is usually magnetically copied, and the disc is The laser is used to optically replicate the data. Combinations of the above should also be included within the scope of the computer readable media.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer And Data Communications (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
本申请要求于2013年12月31日提交中国专利局、申请号为201310751965.X、发明名称为“一种分布式资源调度方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese Patent Application No. 201310751965.X, filed on Dec. 31, 2013, entitled "Distributed Resource Scheduling Method and Apparatus", the entire contents of which are incorporated by reference. In this application.
本发明涉及资源调度技术,尤其涉及一种分布式资源调度方法及装置。The present invention relates to resource scheduling technologies, and in particular, to a distributed resource scheduling method and apparatus.
在虚拟化或云计算的解决方案里,服务器集群中的每个服务器一般包括运行不同类型业务的多个虚拟机,当不同类型的业务部署在同一个服务器即计算节点时,比如一个计算节点同时有桌面云虚拟机和编译业务虚拟机,需要考虑如何保证各自的服务质量,确保各虚拟机的资源占用不相互干扰,并能最大化的利用集群资源。In a virtualization or cloud computing solution, each server in a server cluster generally includes multiple virtual machines running different types of services. When different types of services are deployed on the same server, ie, compute nodes, such as a compute node. There are desktop cloud virtual machines and compiled business virtual machines. You need to consider how to ensure the quality of their respective services, ensure that the resources of each virtual machine do not interfere with each other, and maximize the utilization of cluster resources.
在现有技术中,采用服务质量技术(Quality of Service,QoS)保证同一个计算节点不同类型业务的服务质量,它要求不同类型虚拟机的总量和比例保持稳定,比如一个计算节点有40个虚拟机,其中桌面云虚拟机15个,编译云虚拟机25个,通过设置虚拟机份额高、中、低,确保高份额的虚拟机获取相当份额的资源;采用分布式资源调度程序(Distributed Resource Scheduler,DRS),使集群内的资源利用率最大化,比如,DRS将重载的虚拟机迁移到负载低的服务器中,此时重载虚拟机的资源占用率得到了改善,同时原服务器其它虚拟机的资源占用率也得到了改善,集群整体的资源占用率得到了提升。In the prior art, Quality of Service (QoS) is used to guarantee the quality of service of different types of services of the same computing node. It requires that the total amount and proportion of different types of virtual machines remain stable, for example, 40 computing nodes. The virtual machine, in which 15 desktop cloud virtual machines are compiled, and 25 cloud virtual machines are compiled. By setting the virtual machine shares to be high, medium, and low, a high share of the virtual machine is obtained to obtain a considerable share of resources; a distributed resource scheduling program (Distributed Resource) is adopted. Scheduler (DRS) maximizes the resource utilization in the cluster. For example, DRS migrates the overloaded virtual machine to a server with low load. At this time, the resource usage of the overloaded virtual machine is improved, and the original server is used. The resource occupancy rate of the virtual machine has also been improved, and the overall resource occupancy rate of the cluster has been improved.
然而,启动DRS后,若虚拟机迁移至其它的服务器,则会使服务器内的不同类型的业务虚拟机比例失衡,从而,启动DRS后,如何保证各服务 器内各业务虚拟机的服务质量是目前迫切需要解决的问题。However, after the DRS is started, if the virtual machine is migrated to another server, the proportion of different types of service virtual machines in the server will be unbalanced. Therefore, how to guarantee each service after starting DRS The service quality of each business virtual machine in the device is an urgent problem to be solved.
发明内容Summary of the invention
本发明实施例提供了一种分布式资源调度方法及装置,可以在分布式资源调度时,保证各服务器内各业务虚拟机的服务质量。The embodiment of the invention provides a distributed resource scheduling method and device, which can guarantee the service quality of each service virtual machine in each server during distributed resource scheduling.
第一方面,提供了一种分布式资源调度方法,包括:In a first aspect, a distributed resource scheduling method is provided, including:
获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率;Obtaining the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system;
根据所述各服务器内的同一类型业务虚拟机的资源使用率,通过预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差,所述获取步骤为:根据所述各服务器内的同一类型业务虚拟机的资源使用率获取所述各服务器内的同一类型业务虚拟机的平均资源使用率,并根据所述各服务器内的同一类型业务虚拟机的资源使用率以及所述平均资源使用率,获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差;And obtaining, according to the resource usage rate of the service virtual machine of the same type in each server, a first standard deviation of the resource usage rate of the same type of service virtual machine in each server by using a predetermined obtaining step, where the obtaining step is: Acquiring an average resource usage rate of the same type of service virtual machine in each server according to the resource usage rate of the same type of service virtual machine in each server, and according to resource usage of the same type of service virtual machine in each server Rate and the average resource usage rate, obtaining a first standard deviation of resource usage rates of the same type of service virtual machine in each server;
当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,将所述分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中;And when the first standard deviation of the resource usage rate of the same type of service virtual machine in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machine in each server, the distributed cluster is The same type of service virtual machine of any server in the system is balancedly dispatched to other servers of the distributed cluster system;
获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率;Obtaining a resource usage rate of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling;
根据所述平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,通过所述预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差;And obtaining the resource usage rate of the same type of service virtual machine in each server by using the predetermined obtaining step according to the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system after the balance scheduling Second standard deviation;
比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度。Comparing the second standard deviation acquired after the balanced scheduling at least once, performing the minimum balanced scheduling corresponding to the second standard deviation.
在第一种可能的实现方式中,所述比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度之前,所述方法还包括: In a first possible implementation manner, the method further compares the second standard deviation acquired after the balanced scheduling at least once, and before performing the balance scheduling corresponding to the minimum second standard deviation, the method further Includes:
若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述获取步骤及下一次的平衡调度。The second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the next balanced scheduling is greater than or equal to the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling The second standard deviation, or the next balance scheduling, and the cumulative number of times of the balanced scheduling exceeds the first set threshold, then the performing the obtaining step and the next balancing scheduling are stopped.
第二方面,提供了一种分布式资源调度方法,包括:In a second aspect, a distributed resource scheduling method is provided, including:
根据分布式集群系统中各服务器内各类业务虚拟机占所述各服务器的资源的比例和所述各服务器内各类业务虚拟机的资源使用率,获取所述各服务器的资源使用率;Obtaining a resource usage rate of each server according to a proportion of resources of each server in each server in the distributed cluster system and a resource usage rate of each type of service virtual machine in each server;
根据所述各服务器的资源使用率,通过预定的获取步骤获取所述分布式集群系统的资源使用率的第三标准差,所述获取步骤为:根据所述各服务器的资源使用率获取所述分布式集群系统的平均资源使用率,并根据所述各服务器的资源使用率以及所述分布式集群系统的平均资源使用率,获取所述分布式集群系统的资源使用率的第三标准差;Acquiring, according to the resource usage rate of each server, a third standard deviation of the resource usage rate of the distributed cluster system by using a predetermined obtaining step, where the obtaining step is: acquiring the resource according to the resource usage rate of each server The average resource usage of the distributed cluster system, and the third standard deviation of the resource usage rate of the distributed cluster system is obtained according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system;
当所述分布式集群系统的资源使用率的第三标准差大于或等于所述分布式集群系统的资源使用率的调度阈值时,将所述各服务器内任一业务虚拟机平衡调度至所述分布式集群系统的其他服务器中;When the third standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the scheduling threshold of the resource usage rate of the distributed cluster system, balancing any service virtual machine in each server to the In other servers of the distributed cluster system;
获取平衡调度后分布式集群系统中各服务器的资源使用率;Obtaining the resource usage rate of each server in the distributed cluster system after the balanced scheduling;
根据所述平衡调度后分布式集群系统中各服务器的资源使用率,通过所述预定的获取步骤获取所述平衡调度后分布式集群系统的资源使用率的第四标准差;And obtaining, according to the resource usage rate of each server in the distributed cluster system after the balanced scheduling, the fourth standard deviation of the resource usage rate of the distributed cluster system after the balanced scheduling by using the predetermined obtaining step;
比较至少一次所述平衡调度后获取的所述第四标准差,执行最小的所述第四标准差对应的所述平衡调度。Comparing the fourth standard deviation acquired after the balanced scheduling at least once, performing the minimum balanced scheduling corresponding to the fourth standard deviation.
在第一种可能的实现方式中,所述比较至少一次所述平衡调度后获取的所述第四标准差,执行最小的所述第四标准差对应的所述平衡调度之前,所述方法还包括:In a first possible implementation manner, the method further compares the fourth standard deviation acquired after the balanced scheduling at least once, before performing the balance scheduling corresponding to the minimum fourth standard deviation, include:
若进行下一次平衡调度后所述分布式集群系统的资源使用率的第四标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的 第四标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则停止执行所述获取步骤及下一次的平衡调度。If the fourth standard deviation of the resource usage rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the resource usage rate of the distributed cluster system after performing the current balanced scheduling The fourth standard deviation, or the next balance scheduling, after the cumulative number of the balanced scheduling exceeds the first set threshold, or after the service virtual machine is balancedly dispatched from any first server to any second server, The change in the total amount of each type of service virtual machine in any one of the first servers or any of the second servers is greater than a second set threshold, and/or any of the first servers or any of the second If the change of the resources of the first service server in the server is greater than the third set threshold, the obtaining step and the next balanced scheduling are stopped.
第三方面,提供了一种分布式资源调度装置,包括:In a third aspect, a distributed resource scheduling apparatus is provided, including:
第一获取单元,用于获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率;a first acquiring unit, configured to acquire resource usage rates of the same type of service virtual machines in each server in the distributed cluster system;
第二获取单元,用于根据所述各服务器内的同一类型业务虚拟机的资源使用率,通过预定的获取方式获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差,所述获取方式为:根据所述各服务器内的同一类型业务虚拟机的资源使用率获取所述各服务器内的同一类型业务虚拟机的平均资源使用率,并根据所述各服务器内的同一类型业务虚拟机的资源使用率以及所述平均资源使用率,获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差;a second acquiring unit, configured to acquire, according to a resource usage rate of the same type of service virtual machine in each server, a first standard deviation of resource usage rates of the same type of service virtual machine in each server by using a predetermined acquisition manner Obtaining, according to the resource usage rate of the same type of service virtual machine in each server, obtaining an average resource usage rate of the same type of service virtual machine in each server, and according to the same in each server The resource usage rate of the type service virtual machine and the average resource usage rate, and obtaining a first standard deviation of resource usage rates of the same type of service virtual machine in each server;
第一调度单元,用于当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,将所述分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中;a first scheduling unit, configured to: when a first standard deviation of resource usage rates of the same type of service virtual machines in the servers is greater than or equal to a scheduling threshold of resource usage rates of the same type of service virtual machines in each server And balancing the same type of service virtual machines of any one of the servers in the distributed cluster system to other servers of the distributed cluster system;
第三获取单元,用于获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率;a third acquiring unit, configured to obtain resource usage rates of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling;
第四获取单元,用于根据所述平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,通过所述预定的获取方式获取所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差;a fourth acquiring unit, configured to acquire, according to the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system, the same type in each server The second standard deviation of the resource usage of the business virtual machine;
第一比较单元,用于比较至少一次所述平衡调度后获取的所述第二标准差;a first comparing unit, configured to compare the second standard deviation acquired after the balancing scheduling at least once;
第一执行单元,用于执行最小的所述第二标准差对应的所述平衡调度。 a first execution unit, configured to perform the balance scheduling corresponding to the minimum of the second standard deviation.
在第一种可能的实现方式中,所述第一执行单元还用于:In a first possible implementation, the first execution unit is further configured to:
若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差的获取及下一次的平衡调度。The second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the next balanced scheduling is greater than or equal to the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling The second standard deviation of the second type, or the next balance scheduling, if the cumulative number of the balanced scheduling exceeds the first set threshold, the second criterion for stopping the resource utilization rate of the same type of service virtual machine in each server is stopped. Poor acquisition and next balanced scheduling.
第四方面,提供了一种分布式资源调度装置,包括:In a fourth aspect, a distributed resource scheduling apparatus is provided, including:
第五获取单元,用于根据分布式集群系统中各服务器内各类业务虚拟机占所述各服务器的资源的比例和所述各服务器内各类业务虚拟机的资源使用率,获取所述各服务器的资源使用率;a fifth obtaining unit, configured to acquire, according to a proportion of resources of each type of service virtual machines in each server in the distributed cluster system, and a resource usage rate of each type of service virtual machine in each server, Server resource usage rate;
第六获取单元,用于根据所述各服务器的资源使用率,通过预定的获取方式获取所述分布式集群系统的资源使用率的第三标准差,所述获取方式为:根据所述各服务器的资源使用率获取所述分布式集群系统的平均资源使用率,并根据所述各服务器的资源使用率以及所述分布式集群系统的平均资源使用率,获取所述分布式集群系统的资源使用率的第三标准差;a sixth obtaining unit, configured to acquire, according to the resource usage rate of each server, a third standard deviation of the resource usage rate of the distributed cluster system by using a predetermined acquisition manner, where the obtaining manner is: according to each server The resource usage rate obtains the average resource usage rate of the distributed cluster system, and acquires resource usage of the distributed cluster system according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system. The third standard deviation of the rate;
第二调度单元,用于当所述分布式集群系统的资源使用率的第三标准差大于或等于所述分布式集群系统的资源使用率的调度阈值时,将所述各服务器内任一业务虚拟机平衡调度至所述分布式集群系统的其他服务器中;a second scheduling unit, configured to: when the third standard deviation of resource usage of the distributed cluster system is greater than or equal to a scheduling threshold of resource usage of the distributed cluster system, any service in each server Virtual machine balancing is dispatched to other servers of the distributed cluster system;
第七获取单元,用于获取平衡调度后分布式集群系统中各服务器的资源使用率;a seventh acquiring unit, configured to obtain resource usage rates of servers in the distributed cluster system after the balanced scheduling;
第八获取单元,用于根据所述平衡调度后分布式集群系统中各服务器的资源使用率,通过所述预定的获取方式获取所述平衡调度后分布式集群系统的资源使用率的第四标准差;An eighth obtaining unit, configured to acquire, according to the resource usage rate of each server in the distributed cluster system after the balanced scheduling, the fourth standard of resource utilization rate of the distributed cluster system after the balanced scheduling by using the predetermined acquiring manner difference;
第二比较单元,用于比较至少一次所述平衡调度后获取的所述第四标准差;a second comparing unit, configured to compare the fourth standard deviation acquired after the balanced scheduling at least once;
第二执行单元,用于执行最小的所述第四标准差对应的所述平衡调度。 a second execution unit, configured to perform the balance scheduling corresponding to the minimum of the fourth standard deviation.
在第一种可能的实现方式中,所述第二执行单元还用于:In a first possible implementation, the second execution unit is further configured to:
若进行下一次平衡调度后所述分布式集群系统的资源使用率的第四标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第四标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则停止执行所述平衡调度后分布式集群系统的资源使用率的获取及下一次的平衡调度。If the fourth standard deviation of the resource usage rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the fourth standard deviation of the resource usage rate of the distributed cluster system after the current balancing scheduling, or the next time Balanced scheduling, after the cumulative number of times of the balanced scheduling exceeds a first set threshold, or after the service virtual machine is balancedly dispatched from any first server to any second server, any of the first servers or offices The change of the total amount of the service virtual machines in any of the second servers is greater than the second set threshold, and/or the service virtual machines occupying any of the first servers or any of the second servers If the change of the resources of any of the first servers is greater than the third set threshold, the resource usage rate acquisition and the next balanced scheduling of the distributed cluster system after the balanced scheduling are stopped.
采用本发明实施例提供的一种分布式资源调度方法及装置的技术方案,通过按照分布式集群系统中各服务器内业务虚拟机的类型,或按照各服务器内各类业务虚拟机占所在服务器的资源比例进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。The technical solution of the distributed resource scheduling method and device provided by the embodiment of the present invention is adopted according to the type of the service virtual machine in each server in the distributed cluster system, or according to the server of the various service virtual machines in each server. The proportion of resources is distributed resource scheduling, which can guarantee the service quality of each service virtual machine in each server.
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图1为本发明实施例提供的一种分布式资源调度方法的流程示意图;FIG. 1 is a schematic flowchart of a distributed resource scheduling method according to an embodiment of the present disclosure;
图2为本发明实施例提供的另一种分布式资源调度方法的流程示意图;2 is a schematic flowchart of another distributed resource scheduling method according to an embodiment of the present invention;
图3为本发明实施例提供的又一种分布式资源调度方法的流程示意图;FIG. 3 is a schematic flowchart of still another distributed resource scheduling method according to an embodiment of the present disclosure;
图4为本发明实施例提供的又一种分布式资源调度方法的流程示意图;FIG. 4 is a schematic flowchart diagram of still another distributed resource scheduling method according to an embodiment of the present disclosure;
图5为本发明实施例提供的一种分布式资源调度装置的结构示意图;FIG. 5 is a schematic structural diagram of a distributed resource scheduling apparatus according to an embodiment of the present disclosure;
图6为本发明实施例提供的另一种分布式资源调度装置的结构示意图;FIG. 6 is a schematic structural diagram of another distributed resource scheduling apparatus according to an embodiment of the present disclosure;
图7为本发明实施例提供的一种分布式资源调度设备的结构示意图; FIG. 7 is a schematic structural diagram of a distributed resource scheduling device according to an embodiment of the present disclosure;
图8为本发明实施例提供的另一种分布式资源调度设备的结构示意图。FIG. 8 is a schematic structural diagram of another distributed resource scheduling device according to an embodiment of the present invention.
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
请参阅图1,为本发明实施例提供的一种分布式资源调度方法的流程示意图。该方法包括以下步骤:FIG. 1 is a schematic flowchart diagram of a distributed resource scheduling method according to an embodiment of the present invention. The method includes the following steps:
步骤S101,获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率。Step S101: Obtain a resource usage rate of a service virtual machine of the same type in each server in the distributed cluster system.
在虚拟化或云计算的服务器集群中包括有多个服务器,每个服务器中又包括多个虚拟机,这多个虚拟机可以运行不同类型的业务,称为业务虚拟机。采用DRS技术对服务器集群的资源进行分配,系统给每个服务器分配一定的资源,每个服务器又给其各虚拟机分配相应的资源,因此该服务器集群又称为分布式集群系统,这里的资源指中央处理器(Central Processing Unit,CPU)、内存和输入/输出(Input/Output,I/O)等控制、存储和输入/输出资源。A server cluster of virtualization or cloud computing includes multiple servers, each of which includes multiple virtual machines, which can run different types of services, called business virtual machines. The DRS technology is used to allocate resources of the server cluster. The system allocates certain resources to each server, and each server allocates corresponding resources to each virtual machine. Therefore, the server cluster is also called a distributed cluster system, and the resources here are Refers to central processing unit (CPU), memory, and input/output (I/O) control, storage, and input/output resources.
在本步骤中,获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率,获取的方式可以为:在每个服务器中设置监控器,监控器监控该服务器内该类型业务虚拟机的资源使用率,并上报给DRS,或者DRS向监控器请求该类型虚拟机的资源使用率,从监控器获取该类型业务虚拟机的资源使用率的次数可以为一次,也可以为多次。这里的资源使用率可以是某一种资源的使用率,也可以是各种资源例如CPU、内存和I/O等的资源使用率的加权值。In this step, the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system is obtained by acquiring a monitor in each server, and the monitor monitors the type of service virtual in the server. The resource usage rate of the device is reported to the DRS, or the DRS requests the monitor to use the resource usage rate of the virtual machine of the type. The number of times the resource usage rate of the service virtual machine of the type is obtained from the monitor may be one time or multiple times. . The resource usage rate herein may be a usage rate of a certain resource, or may be a weighted value of resource usage rates of various resources such as CPU, memory, and I/O.
分布式集群系统中各服务器内有一种或多种类型的业务虚拟机,例如,有桌面云虚拟机和编译云虚拟机,本实施例根据业务类型分别获取各服务器内同一类型的虚拟机的资源使用率。 Each of the servers in the distributed cluster system has one or more types of service virtual machines, for example, a desktop cloud virtual machine and a compiled cloud virtual machine. In this embodiment, resources of the same type of virtual machine in each server are respectively obtained according to the service type. Usage rate.
例如,集群内有三个服务器,服务器1内有桌面云虚拟机2个、编译云虚拟机2个,服务器2内有桌面云虚拟机3个、编译云虚拟机2个,服务器3内有桌面云虚拟机1个、编译云虚拟机2个,DRS给集群内的服务器1、2、3分别分配一定的CPU、内存和I/O资源,各个服务器又给其内部的各类型的虚拟机分配一定的CPU、内存和I/O资源,以CPU资源分配为例,DRS给服务器1分配数量为A的CPU资源,给服务器2分配数量为B的CPU资源,给服务器3分配数量为C的CPU资源,服务器1给其内的2个桌面云虚拟机和2个编译云虚拟机分别分配A1、A2、A3和A4的CPU资源,以桌面云虚拟机的资源使用率为例,服务器1内2个桌面云虚拟机的资源使用率分别为30%和40%,则得到服务器1内桌面云虚拟机的CPU的资源使用率为(30%*A1+40%*A2)/(A1+A2),然后再以同样的方式分别计算服务器1内桌面云虚拟机的总的内存和I/O的资源使用率,再将总的CPU、内存和I/O的资源使用率进行加权计算,得到服务器1的桌面云虚拟机的资源使用率,以此类推获取服务器2和3的桌面云虚拟机的资源使用率。同时,还可以按照同样的方式获取各服务器内编译云虚拟机的资源使用率。For example, there are three servers in the cluster. There are two desktop cloud virtual machines and two virtual cloud virtual machines in the server 1. There are three desktop cloud virtual machines, two virtual cloud virtual machines, and a desktop cloud in the server 3. One virtual machine and two virtual machines are compiled. DRS allocates certain CPU, memory and I/O resources to the servers 1, 2 and 3 in the cluster. Each server allocates certain internal virtual machines. For CPU, memory, and I/O resources, taking CPU resource allocation as an example, DRS allocates CPU resources of number A to server 1, allocates CPU resources of quantity B to server 2, and allocates CPU resources of number C to server 3. The server 1 allocates CPU resources of A1, A2, A3, and A4 to the two desktop cloud virtual machines and the two compiled cloud virtual machines respectively, and takes the resource usage rate of the desktop cloud virtual machine as an example, and two in the server 1 The resource utilization rate of the desktop cloud virtual machine is 30% and 40%, respectively, and the resource utilization rate of the CPU of the desktop cloud virtual machine in the server 1 is (30%*A1+40%*A2)/(A1+A2), Then calculate the total memory of the desktop cloud virtual machine in server 1 in the same way. And the resource usage rate of the I/O, and then the total CPU, memory, and I/O resource usage rate are weighted, and the resource usage rate of the desktop cloud virtual machine of the server 1 is obtained, and the servers 2 and 3 are obtained by analogy. Resource usage of the desktop cloud virtual machine. At the same time, the resource usage rate of the compiled cloud virtual machine in each server can also be obtained in the same manner.
步骤S102,根据所述各服务器内的同一类型业务虚拟机的资源使用率,通过预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差,所述获取步骤为:根据所述各服务器内的同一类型业务虚拟机的资源使用率获取所述各服务器内的同一类型业务虚拟机的平均资源使用率,并根据所述各服务器内的同一类型业务虚拟机的资源使用率以及所述平均资源使用率,获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差。Step S102: Acquire, according to a resource usage rate of the same type of service virtual machine in each server, a first standard deviation of resource usage rates of the same type of service virtual machine in each server by using a predetermined obtaining step, where the obtaining The step is: obtaining an average resource usage rate of the same type of service virtual machine in each server according to the resource usage rate of the same type of service virtual machine in each server, and according to the same type of service virtual machine in each server The resource usage rate and the average resource usage rate obtain a first standard deviation of resource usage rates of the same type of service virtual machine in each server.
采用DRS技术保证集群内的资源利用率最大化,因此,计算集群内各个服务器内的同一类型业务虚拟机的资源使用率与各个服务器内的同一类型业务虚拟机的平均资源使用率的标准差,标准差用于反应数据的离散程度,其计算公式如公式(1)所示:The DRS technology is used to ensure the maximum resource utilization in the cluster. Therefore, the standard deviation between the resource usage rate of the same type of service virtual machine in each server in the cluster and the average resource usage rate of the same type of service virtual machine in each server is calculated. The standard deviation is used for the degree of dispersion of the reaction data, and its calculation formula is as shown in formula (1):
在公式(1)中,xi是各个服务器内的同一类型业务虚拟机的资源使用率; μ是各个服务器内的同一类型业务虚拟机的平均资源使用率,N是集群中的服务器个数,σ为标准差。In formula (1), x i is the resource usage rate of the same type of service virtual machine in each server; μ is the average resource usage rate of the same type of service virtual machine in each server, and N is the number of servers in the cluster. σ is the standard deviation.
根据标准差的获取步骤,首先需要获取各个服务器内的同一类型业务虚拟机的平均资源使用率。在步骤S101中已经获取各个服务器内的同一类型业务虚拟机的资源使用率,可以根据现有的计算方式获取各个服务器内的同一类型业务虚拟机的平均资源使用率。例如前面的示例中,有三个服务器,则将获取的各服务器内同一类型业务虚拟机的资源使用率取和再除以服务器的个数,即得到该平均资源使用率。According to the standard deviation acquisition step, it is first necessary to obtain the average resource usage rate of the same type of service virtual machine in each server. The resource usage rate of the same type of service virtual machine in each server has been obtained in step S101, and the average resource usage rate of the same type of service virtual machine in each server can be obtained according to the existing calculation manner. For example, in the previous example, if there are three servers, the resource usage rate of the same type of service virtual machine in each server is obtained and divided by the number of servers, that is, the average resource usage rate is obtained.
然后,根据公式(1)获取各服务器内的同一类型业务虚拟机的资源使用率的标准差。Then, according to formula (1), the standard deviation of resource utilization rates of the same type of service virtual machine in each server is obtained.
步骤S103,当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,将所述分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中。Step S103, when the first standard deviation of the resource usage rate of the same type of service virtual machine in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machine in each server, The same type of service virtual machine of any server in the distributed cluster system is balancedly dispatched to other servers of the distributed cluster system.
通过比较获取的标准差与各服务器内的同一类型业务虚拟机的资源使用率的调度阈值,系统可以判断各个服务器内的该类型业务虚拟机的资源使用是否失衡,标准差越大,表示失衡率越高。需要说明的是,由于各服务器内有多种类型的业务虚拟机,则对各服务器内每一相同类型的业务虚拟机分别计算其与获取的平均资源使用率的标准差,获取的标准差的结果可以是某一类型的业务虚拟机的资源使用均衡,而另一类型的业务虚拟机的资源使用率失衡。By comparing the obtained standard deviation with the scheduling threshold of the resource usage rate of the same type of service virtual machine in each server, the system can determine whether the resource usage of the type of service virtual machine in each server is unbalanced, and the larger the standard deviation, the imbalance rate is indicated. The higher. It should be noted that, since there are multiple types of service virtual machines in each server, the standard deviation of the average resource usage rate obtained from each of the same types of service virtual machines in each server is calculated, and the standard deviation obtained is obtained. The result may be that the resource usage of one type of business virtual machine is balanced, while the resource usage of another type of business virtual machine is out of balance.
当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,触发调度。调度过程中可以按照递归调度,递归调度过程中是将分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中。The scheduling is triggered when the first standard deviation of the resource usage rate of the same type of service virtual machine in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machine in each server. During the scheduling process, the recursive scheduling process may be performed in a recursive scheduling process by balancing the same type of service virtual machines of any server in the distributed cluster system to other servers of the distributed cluster system.
步骤S104,获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率。Step S104: The resource usage rate of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling is obtained.
步骤S105,根据所述平衡调度后分布式集群系统中各服务器内的所述 同一类型业务虚拟机的资源使用率,通过所述预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差。Step S105, according to the foregoing in each server in the distributed cluster system after the balanced scheduling The resource usage rate of the service virtual machine of the same type is obtained by the predetermined obtaining step, and the second standard deviation of the resource usage rate of the same type of service virtual machine in each server is obtained.
每一轮平衡调度后,获取调度虚拟机对失衡率的影响,即重新获取平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差。After each round of balanced scheduling, the impact of the scheduling virtual machine on the imbalance rate is obtained, that is, the standard deviation of the resource usage rate of the same type of service virtual machine in each server after the balanced scheduling is re-acquired.
由于每一轮平衡调度后,各服务器内同一类型的业务虚拟机的资源使用率发生变化,首先要获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,然后再按照预定的标准差的获取步骤获取该轮平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差。After each round of balanced scheduling, the resource usage rate of the same type of service virtual machine in each server changes, firstly, the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling is obtained. Then, according to the predetermined standard deviation obtaining step, the standard deviation of the resource usage rate of the same type of service virtual machine in each server after the round balancing scheduling is obtained.
步骤S106,比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度。Step S106: Compare the second standard deviation acquired after the balanced scheduling at least once, and perform the minimum balanced scheduling corresponding to the second standard deviation.
进行多轮上述的平衡调度,平衡调度时可以采取一定的策略进行调度,例如将重载的业务虚拟机调度至其它服务器,本发明实施例不作限定,在进行多轮上述的平衡调度中,记录每一轮平衡调度获取的该轮平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差,然后比较多轮平衡调度后获取的多个标准差,选出最小的标准差,最终执行该最小的标准差对应的平衡调度,即获取该最小标准差进行的平衡调度是将哪个或哪几个虚拟机调度至哪个或哪几个服务器,则执行该平衡调度。A plurality of rounds of the above-mentioned balanced scheduling may be performed, and a certain policy may be used for scheduling, for example, the overloaded service virtual machine is scheduled to other servers, which is not limited in the embodiment of the present invention. The standard deviation of the resource usage rate of the same type of service virtual machine in each server after the round-balanced scheduling obtained by each round of balanced scheduling, and then comparing the multiple standard deviations obtained after multiple rounds of balanced scheduling, and selecting the minimum standard deviation, Finally, the balanced scheduling corresponding to the minimum standard deviation is performed, that is, the balance scheduling obtained by acquiring the minimum standard deviation is to which one or which virtual machines are scheduled to which server or servers, and the balancing scheduling is performed.
需要说明的是,由于是针对各服务器内同一类型业务虚拟机进行的分布式资源调度,可以分别进行各服务器内每一类业务虚拟机的分布式资源调度,如果某一类型业务虚拟机的资源使用均衡,则进行该分布式资源调度。It should be noted that, because distributed resource scheduling is performed for the same type of service virtual machine in each server, distributed resource scheduling of each type of service virtual machine in each server may be separately performed, if resources of a certain type of service virtual machine The distributed resource scheduling is performed using equalization.
可见,根据本发明实施例提供的一种分布式资源调度方法,通过按照分布式集群系统中各服务器内业务虚拟机的类型进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that, according to the distributed resource scheduling method provided by the embodiment of the present invention, the distributed resource scheduling according to the type of the service virtual machine in each server in the distributed cluster system can ensure the service quality of each service virtual machine in each server. .
请参阅图2,为本发明实施例提供的另一种分布式资源调度方法的流程示意图。该方法与前述实施例的不同之处在于,还包括步骤S206:若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的 第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述获取步骤及下一次的平衡调度。FIG. 2 is a schematic flowchart diagram of another distributed resource scheduling method according to an embodiment of the present invention. The method is different from the previous embodiment in that step S206 is further included: if the resource usage rate of the same type of service virtual machine in each server is performed after the next balanced scheduling is performed The second standard deviation is greater than or equal to the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling, or the next balancing schedule is performed, and the cumulative number of the balanced scheduling is exceeded. Once the threshold is set, the acquisition step and the next balanced scheduling are stopped.
采用递归调度可使得调度效率最高,在递归调度中设置递归退出的条件,即若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述获取步骤及下一次的平衡调度。这样有助于及时停止上述获取步骤和平衡调度,获得最小的标准差,执行该最小的标准差对应的平衡调度。Recursive scheduling is used to make the scheduling efficiency the highest, and the recursive exit condition is set in the recursive scheduling, that is, the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the next balanced scheduling is greater than or equal to Performing the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling, or ending the next balancing scheduling, and stopping the cumulative number of the balancing scheduling exceeding the first set threshold, then stopping The acquisition step and the next balanced scheduling are performed. This helps to stop the above acquisition steps and balance scheduling in time, obtain the minimum standard deviation, and perform the balanced scheduling corresponding to the minimum standard deviation.
请参阅图3,为本发明实施例提供的又一种分布式资源调度方法的流程示意图。该方法包括以下步骤:FIG. 3 is a schematic flowchart diagram of still another distributed resource scheduling method according to an embodiment of the present invention. The method includes the following steps:
步骤S301,根据分布式集群系统中各服务器内各类业务虚拟机占所述各服务器的资源的比例和所述各服务器内各类业务虚拟机的资源使用率,获取所述各服务器的资源使用率。Step S301: Acquire resource usage of each server according to a proportion of resources of each server in each server in the distributed cluster system, and a resource usage rate of each type of service virtual machine in each server. rate.
分布式集群系统中各服务器内有一种或多种类型的业务虚拟机,例如,有桌面云虚拟机和编译云虚拟机,DRS给集群内每个服务器分配有一定的运算、存储和输入/输出资源,各个服务器又其将其获得的资源按照一定的比例分配给其内部的各类型的业务虚拟机。保证各服务器内不同类型业务虚拟机的资源的总量和比例保持稳定,即可保证各服务器内各类业务虚拟机的服务质量。In a distributed cluster system, there are one or more types of service virtual machines in each server. For example, there are desktop cloud virtual machines and compiled cloud virtual machines. DRS allocates certain operations, storage, and input/output to each server in the cluster. Resources, each server allocates the resources it obtains to its internal types of business virtual machines in a certain proportion. Ensure that the total amount and proportion of resources of different types of service virtual machines in each server remain stable, and the service quality of various service virtual machines in each server can be guaranteed.
例如,集群内有三个服务器,服务器1内有桌面云虚拟机2个、编译云虚拟机2个,服务器2内有桌面云虚拟机3个、编译云虚拟机2个,服务器3内有桌面云虚拟机1个、编译云虚拟机2个,DRS给集群内的服务器1、2、3分别分配一定的CPU、内存和I/O资源,各个服务器又给其内部的各虚拟机分配一定的CPU、内存和I/O资源,以CPU资源分配为例,DRS给服务器1分配数量为A的CPU资源,给服务器2分配数量为B的 CPU资源,给服务器3分配数量为C的CPU资源,服务器1给其内的2个桌面云虚拟机和2个编译云虚拟机分别分配A1、A2、A3和A4的CPU资源,服务器1内2个桌面云虚拟机的资源使用率分别为30%和40%,服务器1内2个编译云虚拟机的资源使用率分别为40%和50%,则得到服务器1的CPU的资源使用率为(30%*A1+40%*A2+40%*A3+50%A4)/(A1+A2+A3+A4),然后再以同样的方式分别计算服务器1内各类虚拟机的内存和I/O的资源使用率,再将服务器1的CPU、内存和I/O的资源使用率进行加权计算,得到服务器1的资源使用率,服务器2和3的计算以此类推。For example, there are three servers in the cluster. There are two desktop cloud virtual machines and two virtual cloud virtual machines in the server 1. There are three desktop cloud virtual machines, two virtual cloud virtual machines, and a desktop cloud in the server 3. One virtual machine and two virtual machines are compiled. The DRS allocates certain CPU, memory, and I/O resources to the servers 1, 2, and 3 in the cluster. Each server allocates a certain CPU to each internal virtual machine. For example, the CPU and the I/O resources are allocated to the CPU 1 by the DRS. The DRS allocates the CPU resources of the number A to the server 1 and allocates the quantity B to the server 2. CPU resources are allocated to the server 3 with a CPU resource of C. The server 1 allocates CPU resources of A1, A2, A3, and A4 to the two desktop cloud virtual machines and the two compiled cloud virtual machines respectively. The resource utilization rate of the desktop cloud virtual machine is 30% and 40% respectively, and the resource utilization rates of the two compiled cloud virtual machines in the server 1 are 40% and 50%, respectively, and the resource utilization rate of the CPU of the server 1 is obtained ( 30%*A1+40%*A2+40%*A3+50%A4)/(A1+A2+A3+A4), and then calculate the memory and I/ of each type of virtual machine in server 1 in the same way. The resource usage rate of O is weighted by the CPU, memory, and I/O resource usage of the server 1, and the resource usage rate of the server 1 is obtained, and the calculations of the servers 2 and 3 are deduced by analogy.
步骤S302,根据所述各服务器的资源使用率,通过预定的获取步骤获取所述分布式集群系统的资源使用率的第三标准差,所述获取步骤为:根据所述各服务器的资源使用率获取所述分布式集群系统的平均资源使用率,并根据所述各服务器的资源使用率以及所述分布式集群系统的平均资源使用率,获取所述分布式集群系统的资源使用率的第三标准差。Step S302: Obtain a third standard deviation of the resource usage rate of the distributed cluster system by using a predetermined acquisition step according to the resource usage rate of each server, where the obtaining step is: according to the resource usage rate of each server Acquiring an average resource usage rate of the distributed cluster system, and acquiring a third resource utilization rate of the distributed cluster system according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system. Standard deviation.
与前述实施例不同的是,由于针对的是各服务器内各类业务虚拟机,所以,按照前述实施例相同的方式获取各服务器的资源使用率以及整个分布式集群系统的平均资源使用率,然后,按照公式(1)获取分布式集群系统的资源使用率的标准差。The difference from the foregoing embodiment is that, for all kinds of service virtual machines in each server, the resource usage rate of each server and the average resource usage rate of the entire distributed cluster system are obtained in the same manner as the foregoing embodiment, and then According to formula (1), the standard deviation of resource utilization rate of the distributed cluster system is obtained.
步骤S303,当所述分布式集群系统的资源使用率的第三标准差大于或等于所述分布式集群系统的资源使用率的调度阈值时,将所述各服务器内任一业务虚拟机平衡调度至所述分布式集群系统的其他服务器中。Step S303, when the third standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the scheduling threshold of the resource usage rate of the distributed cluster system, balance scheduling of any service virtual machine in each server. To other servers in the distributed cluster system.
将获取的分布式集群系统的资源使用率的标准差与该分布式集群系统的资源使用率的调度阈值进行比较,如果该分布式集群系统的资源使用率的标准差大于或等于该分布式集群系统的资源使用率的调度阈值,则触发平衡调度。平衡调度的对象可以是各服务器内任一业务虚拟机。Comparing the standard deviation of the resource usage rate of the obtained distributed cluster system with the scheduling threshold of the resource usage rate of the distributed cluster system, if the standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the distributed cluster The scheduling threshold of the system's resource usage triggers balanced scheduling. The object of balanced scheduling can be any business virtual machine in each server.
步骤S304,获取平衡调度后分布式集群系统中各服务器的资源使用率。Step S304, the resource usage rate of each server in the distributed cluster system after the balanced scheduling is obtained.
步骤S305,根据所述平衡调度后分布式集群系统中各服务器的资源使用率,通过所述预定的获取步骤获取所述平衡调度后分布式集群系统的资源使用率的第四标准差。 Step S305: According to the resource usage rate of each server in the distributed cluster system after the balanced scheduling, obtain the fourth standard deviation of the resource usage rate of the distributed cluster system after the balanced scheduling by using the predetermined obtaining step.
步骤S306,比较至少一次所述平衡调度后获取的所述第四标准差,执行最小的所述第四标准差对应的所述平衡调度。Step S306, comparing the fourth standard deviation acquired after the balanced scheduling at least once, and performing the minimum balanced scheduling corresponding to the fourth standard deviation.
步骤S304-步骤S306与前述实施例的步骤S104-步骤S106分别类似,在此不再赘述,所不同的是,针对的是各服务器内各类业务虚拟机,获取的是该分布式集群系统的资源使用率的标准差。Step S304-step S306 is similar to step S104-step S106 of the foregoing embodiment, and is not described here again. The difference is that, for each type of service virtual machine in each server, the obtained distributed cluster system is obtained. The standard deviation of resource usage.
可见,根据本发明实施例提供的一种分布式资源调度方法,通过按照各服务器内各类业务虚拟机占所在服务器的资源比例进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that, according to the distributed resource scheduling method provided by the embodiment of the present invention, distributed resource scheduling can be performed according to the ratio of the resources of the servers in which the various service virtual machines occupy the server, so that the services of the service virtual machines in each server can be guaranteed. quality.
请参阅图4,为本发明实施例提供的又一种分布式资源调度方法的流程示意图。该方法与前述实施例的不同之处在于,还包括步骤S406:若进行下一次平衡调度后所述分布式集群系统的资源使用率的第四标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第四标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则停止执行所述获取步骤及下一次的平衡调度。FIG. 4 is a schematic flowchart diagram of still another distributed resource scheduling method according to an embodiment of the present invention. The method is different from the previous embodiment in that step S406 is further included: the fourth standard deviation of the resource usage rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the distribution after the current balancing scheduling is performed. The fourth standard deviation of the resource usage rate of the cluster system, or the next balanced scheduling, the cumulative number of the balanced scheduling exceeds the first set threshold, or the service virtual machine is balancedly scheduled from any first server. After any second server, the total amount of the various service virtual machines in any one of the first servers or any of the second servers is greater than a second set threshold, and/or any of the first If the change of the resources of the first service server of the server or the any of the second servers is greater than the third set threshold, the obtaining step and the next balanced scheduling are stopped.
采用递归调度可使得调度效率最高,在递归调度中设置递归退出的条件,即若进行下一次平衡调度后所述分布式集群系统的资源使用率的第四标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第四标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则停止执行所述获取步骤及下一次的平衡调度。这样有助于及时停止上述获取步骤和平衡调度,获得最小的标准差,执行该最小 的标准差对应的平衡调度。Recursive scheduling can be used to make the scheduling efficiency the highest, and the recursive exit condition is set in the recursive scheduling. That is, after the next balanced scheduling, the fourth standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the current balancing scheduling. The fourth standard deviation of the resource usage rate of the distributed cluster system, or the next balanced scheduling, the cumulative number of times of the balanced scheduling exceeds a first set threshold, or the service virtual machine is from any first After the server balances the scheduling to any of the second servers, the total amount of the various service virtual machines in any one of the first servers or any of the second servers is greater than a second set threshold, and/or the Stopping the obtaining step and the next balancing when the change of the resources of the first server or the any of the second servers in the first server is greater than the third set threshold. Scheduling. This helps to stop the above acquisition steps and balance scheduling in time, to obtain the minimum standard deviation, and to perform the minimum The standard deviation corresponds to the balanced scheduling.
请参阅图5,为本发明实施例提供的一种分布式资源调度装置的结构示意图。该装置1000包括:FIG. 5 is a schematic structural diagram of a distributed resource scheduling apparatus according to an embodiment of the present invention. The
第一获取单元11,用于获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率。The first obtaining
在虚拟化或云计算的服务器集群中包括有多个服务器,每个服务器中又包括多个虚拟机,这多个虚拟机可以运行不同类型的业务,称为业务虚拟机。采用DRS技术对服务器集群的资源进行分配,系统给每个服务器分配一定的资源,每个服务器又给其各虚拟机分配相应的资源,因此该服务器集群又称为分布式集群系统,这里的资源指中央处理器(Central Processing Unit,CPU)、内存和输入/输出(Input/Output,I/O)等控制、存储和输入/输出资源。A server cluster of virtualization or cloud computing includes multiple servers, each of which includes multiple virtual machines, which can run different types of services, called business virtual machines. The DRS technology is used to allocate resources of the server cluster. The system allocates certain resources to each server, and each server allocates corresponding resources to each virtual machine. Therefore, the server cluster is also called a distributed cluster system, and the resources here are Refers to central processing unit (CPU), memory, and input/output (I/O) control, storage, and input/output resources.
第一获取单元11获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率,获取的方式可以为:在每个服务器中设置监控器,监控器监控该服务器内该类型业务虚拟机的资源使用率,并上报给DRS,或者DRS向监控器请求该类型虚拟机的资源使用率,从监控器获取该类型业务虚拟机的资源使用率的次数可以为一次,也可以为多次。这里的资源使用率可以是某一种资源的使用率,也可以是各种资源例如CPU、内存和I/O等的资源使用率的加权值。The first obtaining
分布式集群系统中各服务器内有一种或多种类型的业务虚拟机,例如,有桌面云虚拟机和编译云虚拟机,本实施例根据业务类型分别获取各服务器内同一类型的虚拟机的资源使用率。Each of the servers in the distributed cluster system has one or more types of service virtual machines, for example, a desktop cloud virtual machine and a compiled cloud virtual machine. In this embodiment, resources of the same type of virtual machine in each server are respectively obtained according to the service type. Usage rate.
例如,集群内有三个服务器,服务器1内有桌面云虚拟机2个、编译云虚拟机2个,服务器2内有桌面云虚拟机3个、编译云虚拟机2个,服务器3内有桌面云虚拟机1个、编译云虚拟机2个,DRS给集群内的服务器1、2、3分别分配一定的CPU、内存和I/O资源,各个服务器又给其内部的各类型的虚拟机分配一定的CPU、内存和I/O资源,以CPU资源分配为例,DRS给服务器1分配数量为A的CPU资源,给服务器2分配数量为 B的CPU资源,给服务器3分配数量为C的CPU资源,服务器1给其内的2个桌面云虚拟机和2个编译云虚拟机分别分配A1、A2、A3和A4的CPU资源,以桌面云虚拟机的资源使用率为例,服务器1内2个桌面云虚拟机的资源使用率分别为30%和40%,则得到服务器1内桌面云虚拟机的CPU的资源使用率为(30%*A1+40%*A2)/(A1+A2),然后再以同样的方式分别计算服务器1内桌面云虚拟机的总的内存和I/O的资源使用率,再将总的CPU、内存和I/O的资源使用率进行加权计算,得到服务器1的桌面云虚拟机的资源使用率,以此类推获取服务器2和3的桌面云虚拟机的资源使用率。同时,还可以按照同样的方式获取各服务器内编译云虚拟机的资源使用率。For example, there are three servers in the cluster. There are two desktop cloud virtual machines and two virtual cloud virtual machines in the server 1. There are three desktop cloud virtual machines, two virtual cloud virtual machines, and a desktop cloud in the server 3. One virtual machine and two virtual machines are compiled. DRS allocates certain CPU, memory and I/O resources to the servers 1, 2 and 3 in the cluster. Each server allocates certain internal virtual machines. CPU, memory, and I/O resources. Taking CPU resource allocation as an example, DRS allocates CPU resources of number A to server 1, and allocates the number of servers to server 2. CPU resources of B, allocate CPU resources of C to server 3, and server 1 allocates CPU resources of A1, A2, A3, and A4 to the two desktop cloud virtual machines and two compiled cloud virtual machines respectively. For example, the resource usage rate of the cloud virtual machine in the server 1 is 30% and 40% respectively, and the resource utilization rate of the CPU of the desktop cloud virtual machine in the server 1 is obtained (30%). *A1+40%*A2)/(A1+A2), and then calculate the total memory and I/O resource usage rate of the desktop cloud virtual machine in server 1 in the same way, and then the total CPU and memory. The resource usage rate of the I/O is weighted, the resource usage rate of the desktop cloud virtual machine of the server 1 is obtained, and the resource usage rate of the desktop cloud virtual machine of the servers 2 and 3 is obtained by analogy. At the same time, the resource usage rate of the compiled cloud virtual machine in each server can also be obtained in the same manner.
第二获取单元12,用于根据所述各服务器内的同一类型业务虚拟机的资源使用率,通过预定的获取方式获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差,所述获取方式为:根据所述各服务器内的同一类型业务虚拟机的资源使用率获取所述各服务器内的同一类型业务虚拟机的平均资源使用率,并根据所述各服务器内的同一类型业务虚拟机的资源使用率以及所述平均资源使用率,获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差。The second obtaining
采用DRS技术保证集群内的资源利用率最大化,因此,第二获取单元12获取集群内各个服务器内的同一类型业务虚拟机的资源使用率与各个服务器内的同一类型业务虚拟机的平均资源使用率的标准差,标准差用于反应数据的离散程度,其计算公式如公式(1)所示。The DRS technology is used to ensure the maximum resource utilization in the cluster. Therefore, the second obtaining
根据标准差的计算公式,第二获取单元12首先需要获取各个服务器内的同一类型业务虚拟机的平均资源使用率。第一获取单元11已经获取各个服务器内的同一类型业务虚拟机的资源使用率,第二获取单元12可以根据现有的计算方式获取各个服务器内的同一类型业务虚拟机的平均资源使用率。例如前面的示例中,有三个服务器,则将获取的各服务器内同一类型业务虚拟机的资源使用率取和再除以服务器的个数,即得到该平均资源使用率。According to the calculation formula of the standard deviation, the second obtaining
然后,第二获取单元12根据公式(1)获取各服务器内的同一类型业务虚
拟机的资源使用率的标准差。Then, the second obtaining
第一调度单元13,用于当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,将所述分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中。The
通过比较获取的标准差与各服务器内的同一类型业务虚拟机的资源使用率的调度阈值,系统可以判断各个服务器内的该类型业务虚拟机的资源使用是否失衡,标准差越大,表示失衡率越高。需要说明的是,由于各服务器内有多种类型的业务虚拟机,则对各服务器内每一相同类型的业务虚拟机分别计算其与获取的平均资源使用率的标准差,获取的标准差的结果可以是某一类型的业务虚拟机的资源使用均衡,而另一类型的业务虚拟机的资源使用率失衡。By comparing the obtained standard deviation with the scheduling threshold of the resource usage rate of the same type of service virtual machine in each server, the system can determine whether the resource usage of the type of service virtual machine in each server is unbalanced, and the larger the standard deviation, the imbalance rate is indicated. The higher. It should be noted that, since there are multiple types of service virtual machines in each server, the standard deviation of the average resource usage rate obtained from each of the same types of service virtual machines in each server is calculated, and the standard deviation obtained is obtained. The result may be that the resource usage of one type of business virtual machine is balanced, while the resource usage of another type of business virtual machine is out of balance.
当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,第一调度单元13触发调度。调度过程中可以按照递归调度,递归调度过程中是将分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中。When the first standard deviation of the resource usage rate of the same type of service virtual machine in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machine in each server, the
第三获取单元14,用于获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率。The third obtaining
第四获取单元15,用于根据所述平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,通过所述预定的获取方式获取所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差。The fourth obtaining
每一轮平衡调度后,第四获取单元15获取调度虚拟机对失衡率的影响,即第四获取单元15重新获取平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差。After each round of balancing, the fourth obtaining
由于每一轮平衡调度后,各服务器内同一类型的业务虚拟机的资源使用率发生变化,首先第三获取单元14要获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,然后第四获取单元15再按照预定的标准差的获取方式获取该轮平衡调度后各服务器内的同一
类型业务虚拟机的资源使用率的标准差。After each round of balanced scheduling, the resource usage rate of the same type of service virtual machine in each server changes. First, the third obtaining
第一比较单元16,用于比较至少一次所述平衡调度后获取的所述第二标准差;a first comparing
第一执行单元17,用于执行最小的所述第二标准差对应的所述平衡调度。The first executing
进行多轮上述的平衡调度,平衡调度时可以采取一定的策略进行调度,例如将重载的业务虚拟机调度至其它服务器,本发明实施例不作限定,在进行多轮上述的平衡调度中,记录每一轮平衡调度获取的该轮平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差,然后比较多轮平衡调度后获取的多个标准差,选出最小的标准差,第一执行单元17最终执行该最小的标准差对应的平衡调度,即获取该最小标准差进行的平衡调度是将哪个或哪几个虚拟机调度至哪个或哪几个服务器,则执行该平衡调度。A plurality of rounds of the above-mentioned balanced scheduling may be performed, and a certain policy may be used for scheduling, for example, the overloaded service virtual machine is scheduled to other servers, which is not limited in the embodiment of the present invention. The standard deviation of the resource usage rate of the same type of service virtual machine in each server after the round-balanced scheduling obtained by each round of balanced scheduling, and then comparing the multiple standard deviations obtained after multiple rounds of balanced scheduling, and selecting the minimum standard deviation, The
需要说明的是,由于是针对各服务器内同一类型业务虚拟机进行的分布式资源调度,可以分别进行各服务器内每一类业务虚拟机的分布式资源调度,如果某一类型业务虚拟机的资源使用均衡,则进行该分布式资源调度。It should be noted that, because distributed resource scheduling is performed for the same type of service virtual machine in each server, distributed resource scheduling of each type of service virtual machine in each server may be separately performed, if resources of a certain type of service virtual machine The distributed resource scheduling is performed using equalization.
可见,根据本发明实施例提供的一种分布式资源调度装置,通过按照分布式集群系统中各服务器内业务虚拟机的类型进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that a distributed resource scheduling apparatus according to an embodiment of the present invention can ensure the service quality of each service virtual machine in each server by performing distributed resource scheduling according to the type of the service virtual machine in each server in the distributed cluster system. .
作为一种实施方式,第一执行单元17还可以用于若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差的获取及下一次的平衡调度。As an implementation manner, the
采用递归调度可使得调度效率最高,在递归调度中设置递归退出的条件,即若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的
资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则第一执行单元17停止执行所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差的获取及下一次的平衡调度。这样有助于及时停止上述获取步骤和平衡调度,获得最小的标准差,执行该最小的标准差对应的平衡调度。Recursive scheduling can be used to make the scheduling efficiency the highest, and the recursive exit condition is set in the recursive scheduling, that is, if the same type of service virtual machine in each server is used after the next balanced scheduling
The second standard deviation of the resource usage rate is greater than or equal to the second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling, or the next balancing scheduling is performed, and the balanced scheduling is performed. When the accumulated number of times exceeds the first set threshold, the
请参阅图6,为本发明实施例提供的另一种分布式资源调度装置的结构示意图。该装置2000包括:FIG. 6 is a schematic structural diagram of another distributed resource scheduling apparatus according to an embodiment of the present invention. The
第五获取单元21,用于根据分布式集群系统中各服务器内各类业务虚拟机占所述各服务器的资源的比例和所述各服务器内各类业务虚拟机的资源使用率,获取所述各服务器的资源使用率。The fifth obtaining
分布式集群系统中各服务器内有一种或多种类型的业务虚拟机,例如,有桌面云虚拟机和编译云虚拟机,DRS给集群内每个服务器分配有一定的运算、存储和输入/输出资源,各个服务器又其将其获得的资源按照一定的比例分配给其内部的各类型的业务虚拟机。保证各服务器内不同类型业务虚拟机的资源的总量和比例保持稳定,即可保证各服务器内各类业务虚拟机的服务质量。In a distributed cluster system, there are one or more types of service virtual machines in each server. For example, there are desktop cloud virtual machines and compiled cloud virtual machines. DRS allocates certain operations, storage, and input/output to each server in the cluster. Resources, each server allocates the resources it obtains to its internal types of business virtual machines in a certain proportion. Ensure that the total amount and proportion of resources of different types of service virtual machines in each server remain stable, and the service quality of various service virtual machines in each server can be guaranteed.
例如,集群内有三个服务器,服务器1内有桌面云虚拟机2个、编译云虚拟机2个,服务器2内有桌面云虚拟机3个、编译云虚拟机2个,服务器3内有桌面云虚拟机1个、编译云虚拟机2个,DRS给集群内的服务器1、2、3分别分配一定的CPU、内存和I/O资源,各个服务器又给其内部的各虚拟机分配一定的CPU、内存和I/O资源,以CPU资源分配为例,DRS给服务器1分配数量为A的CPU资源,给服务器2分配数量为B的CPU资源,给服务器3分配数量为C的CPU资源,服务器1给其内的2个桌面云虚拟机和2个编译云虚拟机分别分配A1、A2、A3和A4的CPU资源,服务器1内2个桌面云虚拟机的资源使用率分别为30%和40%,服务器1内2个编译云虚拟机的资源使用率分别为40%和50%,则得到服务器1的CPU的资源使用率为(30%*A1+40%*A2+ 40%*A3+50%A4)/(A1+A2+A3+A4),然后再以同样的方式分别计算服务器1内各类虚拟机的内存和I/O的资源使用率,再将服务器1的CPU、内存和I/O的资源使用率进行加权计算,得到服务器1的资源使用率,服务器2和3的计算以此类推。For example, there are three servers in the cluster. There are two desktop cloud virtual machines and two virtual cloud virtual machines in the server 1. There are three desktop cloud virtual machines, two virtual cloud virtual machines, and a desktop cloud in the server 3. One virtual machine and two virtual machines are compiled. The DRS allocates certain CPU, memory, and I/O resources to the servers 1, 2, and 3 in the cluster. Each server allocates a certain CPU to each internal virtual machine. For example, the memory resource and the I/O resource are allocated to the server 1 by the CPU resource allocation. The DRS allocates the CPU resource of the number A to the server 1, the CPU resource of the quantity B to the server 2, and the CPU resource of the number C to the server 3. 1 Assign the CPU resources of A1, A2, A3, and A4 to the two desktop cloud virtual machines and the two compiled cloud virtual machines respectively. The resource utilization rates of the two desktop cloud virtual machines in server 1 are 30% and 40 respectively. %, the resource usage rate of the two compiled cloud virtual machines in the server 1 is 40% and 50%, respectively, and the resource utilization rate of the CPU of the server 1 is obtained (30%*A1+40%*A2+). 40%*A3+50%A4)/(A1+A2+A3+A4), and then calculate the memory and I/O resource usage of each type of virtual machine in server 1 in the same way, and then server 1 The CPU, memory, and I/O resource usage are weighted to obtain the resource usage of the server 1, and the calculations of the servers 2 and 3 are analogous.
第六获取单元22,用于根据所述各服务器的资源使用率,通过预定的获取方式获取所述分布式集群系统的资源使用率的第三标准差,所述获取步骤为:根据所述各服务器的资源使用率获取所述分布式集群系统的平均资源使用率,并根据所述各服务器的资源使用率以及所述分布式集群系统的平均资源使用率,获取所述分布式集群系统的资源使用率的第三标准差。The sixth obtaining
与前述实施例不同的是,由于针对的是各服务器内各类业务虚拟机,所以,按照前述实施例相同的方式获取各服务器的资源使用率以及整个分布式集群系统的平均资源使用率,然后,第六获取单元22再按照公式(1)获取分布式集群系统的资源使用率的标准差。The difference from the foregoing embodiment is that, for all kinds of service virtual machines in each server, the resource usage rate of each server and the average resource usage rate of the entire distributed cluster system are obtained in the same manner as the foregoing embodiment, and then The sixth obtaining
第二调度单元23,用于当所述分布式集群系统的资源使用率的第三标准差大于或等于所述分布式集群系统的资源使用率的调度阈值时,将所述各服务器内任一业务虚拟机平衡调度至所述分布式集群系统的其他服务器中。a
将获取的分布式集群系统的资源使用率的标准差与该分布式集群系统的资源使用率的调度阈值进行比较,如果该分布式集群系统的资源使用率的标准差大于或等于该分布式集群系统的资源使用率的调度阈值,则第二调度单元23触发平衡调度。平衡调度的对象可以是各服务器内任一业务虚拟机。Comparing the standard deviation of the resource usage rate of the obtained distributed cluster system with the scheduling threshold of the resource usage rate of the distributed cluster system, if the standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the distributed cluster The scheduling threshold of the resource usage rate of the system, the
第七获取单元24,用于获取平衡调度后分布式集群系统中各服务器的资源使用率。The seventh obtaining
第八获取单元25,用于根据所述平衡调度后分布式集群系统中各服务器的资源使用率,通过所述预定的获取方式获取所述平衡调度后分布式集群系统的资源使用率的第四标准差。The eighth obtaining
第二比较单元26,用于比较至少一次所述平衡调度后获取的所述第四标准差;
a
第二执行单元27,用于执行最小的所述第四标准差对应的所述平衡调度。The second executing
第七获取单元24、第八获取单元25、第二比较单元26、第二执行单元27的功能分别与前述实施例的第三获取单元14、第四获取单元15、第一比较单元16、第一执行单元17的功能类似,在此不再赘述,所不同的是,针对的是各服务器内各类业务虚拟机,获取的是该分布式集群系统的资源使用率的标准差。The functions of the seventh obtaining
可见,根据本发明实施例提供的一种分布式资源调度装置,通过按照各服务器内各类业务虚拟机占所在服务器的资源比例进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that the distributed resource scheduling apparatus according to the embodiment of the present invention can ensure the service of each service virtual machine in each server by performing distributed resource scheduling according to the proportion of the resources of the servers in which the various service virtual machines occupy the server. quality.
作为一种可行的实施方式,第二执行单元27还用于若进行下一次平衡调度后所述分布式集群系统的资源使用率的第四标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第四标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则停止执行所述平衡调度后分布式集群系统的资源使用率的获取及下一次的平衡调度。As a possible implementation manner, the
采用递归调度可使得调度效率最高,在递归调度中设置递归退出的条件,即若进行下一次平衡调度后所述分布式集群系统的资源使用率的第四标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第四标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大
于第三设定阈值,则第二执行单元27停止执行所述平衡调度后分布式集群系统的资源使用率的获取及下一次的平衡调度。这样有助于及时停止上述获取步骤和平衡调度,获得最小的标准差,执行该最小的标准差对应的平衡调度。Recursive scheduling can be used to make the scheduling efficiency the highest, and the recursive exit condition is set in the recursive scheduling. That is, after the next balanced scheduling, the fourth standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the current balancing scheduling. The fourth standard deviation of the resource usage rate of the distributed cluster system, or the next balanced scheduling, the cumulative number of times of the balanced scheduling exceeds a first set threshold, or the service virtual machine is from any first After the server balances the scheduling to any of the second servers, the total amount of the various service virtual machines in any one of the first servers or any of the second servers is greater than a second set threshold, and/or the A variety of service virtual machines in a first server or any of the second servers account for a large change in resources of any of the first servers
After the third setting threshold, the second executing
请参阅图7,为本发明实施例提供的一种分布式资源调度设备的结构示意图,本实施例的设备3000包括处理器31、存储器32、输入设备33、输出设备34以及总线系统35,其中:FIG. 7 is a schematic structural diagram of a distributed resource scheduling device according to an embodiment of the present invention. The
处理器31控制设备3000的操作,处理器31还可以称为中央处理单元(Central Processing Unit,CPU)。处理器31可能是一种集成电路芯片,具有信号的处理能力。处理器31还可以是通用处理器、数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The
存储器32可以包括只读存储器和随机存取存储器,并向处理器31提供指令和数据。存储器32的一部分还可以包括非易失性随机存取存储器(NVRAM)。
设备3000的各个组件通过总线系统35耦合在一起,该总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component Interconnect,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。所述总线可以是一条或多条物理线路,当是多条物理线路时可以分为地址总线、数据总线、控制总线等。在本发明的其它一些实施例中,处理器31、存储器32以及输入设备33、输出设备34也可以通过通信线路直接连接。The various components of
输入设备33可以具体实现为鼠标、键盘、麦克风等,而输出设备34可以具体实现为显示器、音频设备、视频设备。当然,输入设备33和输出设备34也可以通过一个输入输出设备来实现其功能,比如实现为可触摸的
屏幕。The
其中,处理器31读取存储器32中的计算机程序用以执行以下步骤:The
获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率;Obtaining the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system;
根据所述各服务器内的同一类型业务虚拟机的资源使用率,通过预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差,所述获取步骤为:根据所述各服务器内的同一类型业务虚拟机的资源使用率获取所述各服务器内的同一类型业务虚拟机的平均资源使用率,并根据所述各服务器内的同一类型业务虚拟机的资源使用率以及所述平均资源使用率,获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差;And obtaining, according to the resource usage rate of the service virtual machine of the same type in each server, a first standard deviation of the resource usage rate of the same type of service virtual machine in each server by using a predetermined obtaining step, where the obtaining step is: Acquiring an average resource usage rate of the same type of service virtual machine in each server according to the resource usage rate of the same type of service virtual machine in each server, and according to resource usage of the same type of service virtual machine in each server Rate and the average resource usage rate, obtaining a first standard deviation of resource usage rates of the same type of service virtual machine in each server;
当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,将所述分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中;And when the first standard deviation of the resource usage rate of the same type of service virtual machine in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machine in each server, the distributed cluster is The same type of service virtual machine of any server in the system is balancedly dispatched to other servers of the distributed cluster system;
获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率;Obtaining a resource usage rate of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling;
根据所述平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,通过所述预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差;And obtaining the resource usage rate of the same type of service virtual machine in each server by using the predetermined obtaining step according to the resource usage rate of the same type of service virtual machine in each server in the distributed cluster system after the balance scheduling Second standard deviation;
比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度。Comparing the second standard deviation acquired after the balanced scheduling at least once, performing the minimum balanced scheduling corresponding to the second standard deviation.
作为一种可行的实施方式,处理器31在执行所述比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度的步骤之前,还执行如下步骤:As a possible implementation manner, the
若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述获取步 骤及下一次的平衡调度。The second standard deviation of the resource usage rate of the same type of service virtual machine in each server after the next balanced scheduling is greater than or equal to the resource usage rate of the same type of service virtual machine in each server after the current balancing scheduling The second standard deviation, or the next balance scheduling, if the cumulative number of the balanced scheduling exceeds the first set threshold, the execution of the obtaining step is stopped. The next balance is scheduled.
本发明实施例提供的处理器31中包含的计算机程序还可以实现为第一获取单元、第二获取单元、第一调度单元、第三获取单元、第四获取单元、第一比较单元和第一执行单元,这些单元实现的功能可以参考前述实施例所述,在此不再赘述。The computer program included in the
可见,根据本发明实施例提供的一种分布式资源调度设备,通过按照分布式集群系统中各服务器内业务虚拟机的类型进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that the distributed resource scheduling device according to the embodiment of the present invention can ensure the service quality of each service virtual machine in each server by performing distributed resource scheduling according to the type of the service virtual machine in each server in the distributed cluster system. .
请参阅图8,为本发明实施例提供的另一种分布式资源调度设备的结构示意图,本实施例的设备4000包括处理器41、存储器42、输入设备43、输出设备44以及总线系统45,其中:FIG. 8 is a schematic structural diagram of another distributed resource scheduling device according to an embodiment of the present invention. The
处理器41控制设备4000的操作,处理器41还可以称为中央处理单元(Central Processing Unit,CPU)。处理器41可能是一种集成电路芯片,具有信号的处理能力。处理器41还可以是通用处理器、数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The
存储器42可以包括只读存储器和随机存取存储器,并向处理器41提供指令和数据。存储器42的一部分还可以包括非易失性随机存取存储器(NVRAM)。
设备4000的各个组件通过总线系统45耦合在一起,该总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component Interconnect,PCI)总线或扩展工业标准体系结构(Extended Industry Standard Architecture,EISA)总线等。所述总线可以是一条或多条物理线路,当是多条物理线路时可以分为地址总线、数据总线、控制总线等。在本发明的其它一些实施例中,处理器41、存储器42以及输
入设备43、输出设备44也可以通过通信线路直接连接。The various components of
输入设备43可以具体实现为鼠标、键盘、麦克风等,而输出设备44可以具体实现为显示器、音频设备、视频设备。当然,输入设备43和输出设备44也可以通过一个输入输出设备来实现其功能,比如实现为可触摸的屏幕。The
其中,处理器41读取存储器42中的计算机程序用以执行以下步骤:The
根据分布式集群系统中各服务器内各类业务虚拟机占所述各服务器的资源的比例和所述各服务器内各类业务虚拟机的资源使用率,获取所述各服务器的资源使用率;Obtaining a resource usage rate of each server according to a proportion of resources of each server in each server in the distributed cluster system and a resource usage rate of each type of service virtual machine in each server;
根据所述各服务器的资源使用率,通过预定的获取步骤获取所述分布式集群系统的资源使用率的第一标准差,所述获取步骤为:根据所述各服务器的资源使用率获取所述分布式集群系统的平均资源使用率,并根据所述各服务器的资源使用率以及所述分布式集群系统的平均资源使用率,获取所述分布式集群系统的资源使用率的第一标准差;Acquiring, according to the resource usage rate of each server, a first standard deviation of the resource usage rate of the distributed cluster system by using a predetermined obtaining step, where the obtaining step is: acquiring the resource usage rate according to the resource usage of each server The average resource usage of the distributed cluster system, and the first standard deviation of the resource usage rate of the distributed cluster system is obtained according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system;
当所述分布式集群系统的资源使用率的第一标准差大于或等于所述分布式集群系统的资源使用率的调度阈值时,将所述各服务器内任一业务虚拟机平衡调度至所述分布式集群系统的其他服务器中;When the first standard deviation of the resource usage rate of the distributed cluster system is greater than or equal to the scheduling threshold of the resource usage rate of the distributed cluster system, balancing any service virtual machines in each server to the In other servers of the distributed cluster system;
获取平衡调度后分布式集群系统中各服务器的资源使用率;Obtaining the resource usage rate of each server in the distributed cluster system after the balanced scheduling;
根据所述平衡调度后分布式集群系统中各服务器的资源使用率,通过所述预定的获取步骤获取所述平衡调度后分布式集群系统的资源使用率的第二标准差;Obtaining, according to the resource usage rate of each server in the distributed cluster system after the balanced scheduling, obtaining the second standard deviation of the resource usage rate of the distributed cluster system after the balanced scheduling by using the predetermined obtaining step;
比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度。Comparing the second standard deviation acquired after the balanced scheduling at least once, performing the minimum balanced scheduling corresponding to the second standard deviation.
作为一种可行的实施方式,处理器41在所述比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度的步骤之前,还执行如下步骤:As a possible implementation manner, before the step of comparing the second standard deviation acquired after the balance scheduling is performed at least once, the
若进行下一次平衡调度后所述分布式集群系统的资源使用率的第二标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过 第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则停止执行所述获取步骤及下一次的平衡调度。If the second standard deviation of the resource usage rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the second standard deviation of the resource usage rate of the distributed cluster system after the current balancing scheduling, or the next time Balanced scheduling, the cumulative number of times the balanced scheduling is performed exceeds After setting the threshold, or balancing the service virtual machine from any first server to any second server, the service virtual machine of any one of the first server or any of the second servers The change of the total amount is greater than the second set threshold, and/or the change of the resources of the first server or the any of the second servers in the service virtual machine of any one of the first servers is greater than When the threshold is set third, the obtaining step and the next balanced scheduling are stopped.
本发明实施例提供的处理器41中包含的计算机程序还可以实现为第五获取单元、第六获取单元、第二调度单元、第七获取单元、第八获取单元、第二比较单元和第二执行单元,这些单元实现的功能可以参考前述实施例所述,在此不再赘述。The computer program included in the
可见,根据本发明实施例提供的一种分布式资源调度设备,通过按照各服务器内各类业务虚拟机占所在服务器的资源比例进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that the distributed resource scheduling device according to the embodiment of the present invention can ensure the service of each service virtual machine in each server by performing distributed resource scheduling according to the proportion of the resources of the servers in which the various service virtual machines occupy the server. quality.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为根据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that, for the foregoing method embodiments, for the sake of simple description, they are all expressed as a series of action combinations, but those skilled in the art should understand that the present invention is not limited by the described action sequence. Because certain steps may be performed in other sequences or concurrently in accordance with the present invention. In addition, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the above embodiments, the descriptions of the various embodiments are different, and the details that are not detailed in a certain embodiment can be referred to the related descriptions of other embodiments.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本发明可以用硬件实现,或固件实现,或它们的组合方式来实现。当使用软件实现时,可以将上述功能存储在计算机可读介质中或作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是计算机能够存取的任何可用介质。以此为例但不限于:计算机可读介质可以包括随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他 光盘存储、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质。此外。任何连接可以适当的成为计算机可读介质。例如,如果软件是使用同轴电缆、光纤光缆、双绞线、数字用户线(Digital Subscriber Line,DSL)或者诸如红外线、无线电和微波之类的无线技术从网站、服务器或者其他远程源传输的,那么同轴电缆、光纤光缆、双绞线、DSL或者诸如红外线、无线和微波之类的无线技术包括在所属介质的定影中。如本发明所使用的,盘(Disk)和碟(disc)包括压缩光碟(CD)、激光碟、光碟、数字通用光碟(DVD)、软盘和蓝光光碟,其中盘通常磁性的复制数据,而碟则用激光来光学的复制数据。上面的组合也应当包括在计算机可读介质的保护范围之内。Through the description of the above embodiments, those skilled in the art can clearly understand that the present invention can be implemented in hardware, firmware implementation, or a combination thereof. When implemented in software, the functions described above may be stored in or transmitted as one or more instructions or code on a computer readable medium. Computer readable media includes both computer storage media and communication media including any medium that facilitates transfer of a computer program from one location to another. A storage medium may be any available media that can be accessed by a computer. For example, but not limited to, the computer readable medium may include a random access memory (RAM), a read-only memory (ROM), and an electrically erasable programmable read-only memory (Electrically Erasable Programmable). Read-Only Memory, EEPROM, Compact Disc Read-Only Memory (CD-ROM) or other Optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. Also. Any connection may suitably be a computer readable medium. For example, if the software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, Digital Subscriber Line (DSL), or wireless technologies such as infrared, radio, and microwave, Then coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, wireless and microwave are included in the fixing of the associated medium. As used in the present invention, a disk and a disc include a compact disc (CD), a laser disc, a compact disc, a digital versatile disc (DVD), a floppy disk, and a Blu-ray disc, wherein the disc is usually magnetically copied, and the disc is The laser is used to optically replicate the data. Combinations of the above should also be included within the scope of the computer readable media.
总之,以上所述仅为本发明技术方案的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。 In summary, the above description is only a preferred embodiment of the technical solution of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.
Claims (8)
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310751965.X | 2013-12-31 | ||
| CN201310751965.XA CN103763346B (en) | 2013-12-31 | 2013-12-31 | A kind of distributed resource scheduling method and device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2015101091A1 true WO2015101091A1 (en) | 2015-07-09 |
Family
ID=50530505
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2014/089636 Ceased WO2015101091A1 (en) | 2013-12-31 | 2014-10-28 | Distributed resource scheduling method and device |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN103763346B (en) |
| WO (1) | WO2015101091A1 (en) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113672345A (en) * | 2021-08-05 | 2021-11-19 | 浪潮云信息技术股份公司 | IO prediction-based cloud virtualization engine distributed resource scheduling method |
Families Citing this family (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103763346B (en) * | 2013-12-31 | 2017-07-25 | 华为技术有限公司 | A kind of distributed resource scheduling method and device |
| CN105893224B (en) * | 2015-01-26 | 2019-04-09 | 阿里巴巴集团控股有限公司 | A kind of resource measurement method and device |
| CN105159784B (en) * | 2015-10-10 | 2018-07-06 | 浪潮(北京)电子信息产业有限公司 | The dispositions method and system of a kind of virtual server |
| CN106100872B (en) * | 2016-05-31 | 2019-04-05 | 中国联合网络通信集团有限公司 | A kind of business continuance support method and device |
| CN108063784B (en) * | 2016-11-08 | 2022-01-25 | 阿里巴巴集团控股有限公司 | Method, device and system for distributing application cluster resources in cloud environment |
| CN107205028A (en) * | 2017-05-25 | 2017-09-26 | 郑州云海信息技术有限公司 | A kind of classification of service method and device |
| CN109936465A (en) * | 2017-12-15 | 2019-06-25 | 中国移动通信集团浙江有限公司 | A kind of cloud platform resource utilization evaluation method and device |
| CN109634714B (en) * | 2018-11-02 | 2023-10-31 | 北京奇虎科技有限公司 | An intelligent scheduling method and device |
| CN109542725B (en) * | 2018-11-15 | 2022-04-05 | 北京金山云网络技术有限公司 | Service quality monitoring method and device for distributed system and monitoring server |
| CN109936627A (en) * | 2019-02-21 | 2019-06-25 | 山东浪潮云信息技术有限公司 | A kind of automaticdata equalization methods and tool based on hadoop |
| CN115408098A (en) * | 2021-05-27 | 2022-11-29 | 华为云计算技术有限公司 | Resource scheduling method and device |
| CN113485847A (en) * | 2021-08-05 | 2021-10-08 | 杭州绿城信息技术有限公司 | Resource scheduling system based on big data |
| CN114090257B (en) * | 2021-11-24 | 2024-11-05 | 中国电信股份有限公司 | Virtual machine scheduling method, device, storage medium and equipment |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102244685A (en) * | 2011-08-11 | 2011-11-16 | 中国科学院软件研究所 | Distributed type dynamic cache expanding method and system supporting load balancing |
| CN103763346A (en) * | 2013-12-31 | 2014-04-30 | 华为技术有限公司 | Distributed resource scheduling method and device |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102567072B (en) * | 2010-12-20 | 2015-04-22 | 中国移动通信集团公司 | Resource allocation method, resource allocation device and resource allocation system |
| CN102185759A (en) * | 2011-04-12 | 2011-09-14 | 田文洪 | Multi-physical server load equalizing method and device capable of meeting requirement characteristic |
| CN103164283B (en) * | 2012-05-10 | 2018-08-10 | 上海兆民云计算科技有限公司 | Virtualization resource dynamic dispatching management method and system in a kind of virtual desktop system |
| CN102984762B (en) * | 2012-12-12 | 2016-05-25 | 中国联合网络通信集团有限公司 | IMS function assigning method and device |
-
2013
- 2013-12-31 CN CN201310751965.XA patent/CN103763346B/en active Active
-
2014
- 2014-10-28 WO PCT/CN2014/089636 patent/WO2015101091A1/en not_active Ceased
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102244685A (en) * | 2011-08-11 | 2011-11-16 | 中国科学院软件研究所 | Distributed type dynamic cache expanding method and system supporting load balancing |
| CN103763346A (en) * | 2013-12-31 | 2014-04-30 | 华为技术有限公司 | Distributed resource scheduling method and device |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113672345A (en) * | 2021-08-05 | 2021-11-19 | 浪潮云信息技术股份公司 | IO prediction-based cloud virtualization engine distributed resource scheduling method |
Also Published As
| Publication number | Publication date |
|---|---|
| CN103763346B (en) | 2017-07-25 |
| CN103763346A (en) | 2014-04-30 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN103763346B (en) | A kind of distributed resource scheduling method and device | |
| CN111176792B (en) | A resource scheduling method, device and related equipment | |
| US10733026B2 (en) | Automated workflow selection | |
| US10896065B2 (en) | Efficient critical thread scheduling for non privileged thread requests | |
| CN109729106B (en) | Method, system and computer program product for processing computing tasks | |
| CN110362402B (en) | Load balancing method, device, equipment and readable storage medium | |
| CN105743962A (en) | End-to-end datacenter performance control | |
| CN107818013A (en) | A kind of application scheduling method thereof and device | |
| US9417902B1 (en) | Managing resource bursting | |
| US20200272526A1 (en) | Methods and systems for automated scaling of computing clusters | |
| CN109960575B (en) | Computing power sharing method, system and related equipment | |
| CN108028806B (en) | Method and device for allocating virtual resources in Network Function Virtualization (NFV) network | |
| CN103116517B (en) | The method of adjustment of I/O passage and adjusting apparatus under virtual platform | |
| US20220318057A1 (en) | Resource Management for Preferred Applications | |
| CN106878389B (en) | Method and device for resource scheduling in cloud system | |
| CN110275760A (en) | Process suspending method based on virtual host processor and its related equipment | |
| US10579416B2 (en) | Thread interrupt offload re-prioritization | |
| CN116149846A (en) | Application performance optimization method, device, electronic equipment and storage medium | |
| CN114356547B (en) | Low-optimity blocking method and device based on processor virtualization environment | |
| US9218219B2 (en) | Managing virtual functions of an input/output adapter | |
| Ren et al. | Enabling Efficient {GPU} Communication over Multiple {NICs} with {FuseLink} | |
| US9213575B2 (en) | Methods and systems for energy management in a virtualized data center | |
| CN107634978B (en) | Resource scheduling method and device | |
| US10846125B2 (en) | Memory access optimization in a processor complex | |
| CN112685167B (en) | Resource use method, electronic device and computer program product |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14876197 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 14876197 Country of ref document: EP Kind code of ref document: A1 |