CN103763346B - A distributed resource scheduling method and device - Google Patents
A distributed resource scheduling method and device Download PDFInfo
- Publication number
- CN103763346B CN103763346B CN201310751965.XA CN201310751965A CN103763346B CN 103763346 B CN103763346 B CN 103763346B CN 201310751965 A CN201310751965 A CN 201310751965A CN 103763346 B CN103763346 B CN 103763346B
- Authority
- CN
- China
- Prior art keywords
- server
- resource utilization
- scheduling
- standard deviation
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 46
- 230000008859 change Effects 0.000 claims description 18
- 230000001186 cumulative effect Effects 0.000 claims description 18
- 239000006185 dispersion Substances 0.000 claims description 6
- 238000005303 weighing Methods 0.000 claims 2
- 230000000712 assembly Effects 0.000 claims 1
- 238000000429 assembly Methods 0.000 claims 1
- 238000012545 processing Methods 0.000 description 12
- 238000005516 engineering process Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 6
- 238000004590 computer program Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 4
- 238000013468 resource allocation Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 3
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR 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
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
技术领域technical field
本发明涉及资源调度技术,尤其涉及一种分布式资源调度方法及装置。The present invention relates to resource scheduling technology, in particular to a distributed resource scheduling method and device.
背景技术Background technique
在虚拟化或云计算的解决方案里,服务器集群中的每个服务器一般包括运行不同类型业务的多个虚拟机,当不同类型的业务部署在同一个服务器即计算节点时,比如一个计算节点同时有桌面云虚拟机和编译业务虚拟机,需要考虑如何保证各自的服务质量,确保各虚拟机的资源占用不相互干扰,并能最大化的利用集群资源。In virtualization or cloud computing solutions, 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, that is, a computing node, for example, a computing node simultaneously If there are desktop cloud virtual machines and compilation business virtual machines, it is necessary to consider how to ensure the respective service quality, ensure that the resource occupation of each virtual machine does not interfere with each other, and maximize the use of cluster resources.
在现有技术中,采用服务质量技术(Quality of Service,QoS)保证同一个计算节点不同类型业务的服务质量,它要求不同类型虚拟机的总量和比例保持稳定,比如一个计算节点有40个虚拟机,其中桌面云虚拟机15个,编译云虚拟机25个,通过设置虚拟机份额高、中、低,确保高份额的虚拟机获取相当份额的资源;采用分布式资源调度程序(Distributed Resource Scheduler,DRS),使集群内的资源利用率最大化,比如,DRS将重载的虚拟机迁移到负载低的服务器中,此时重载虚拟机的资源占用率得到了改善,同时原服务器其它虚拟机的资源占用率也得到了改善,集群整体的资源占用率得到了提升。In the existing technology, Quality of Service (QoS) technology is used to ensure the service quality of different types of services on the same computing node, which requires the total amount and proportion of different types of virtual machines to remain stable. For example, a computing node has 40 Virtual machines, including 15 desktop cloud virtual machines and 25 compiled cloud virtual machines, ensure that high-share virtual machines can obtain a considerable share of resources by setting the share of virtual machines to high, medium and low; using Distributed Resource Scheduler (Distributed Resource Scheduler, DRS), to maximize resource utilization in the cluster. For example, DRS migrates the overloaded virtual machine to a server with low load. At this time, the resource occupancy rate of the overloaded virtual machine is improved, and the original server other 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 starting DRS, if the virtual machine is migrated to another server, the proportion of different types of business virtual machines in the server will be unbalanced. Therefore, after starting DRS, how to ensure the service quality of each business virtual machine in each server is currently a problem. problems that urgently need to be resolved.
发明内容Contents of the invention
本发明实施例提供了一种分布式资源调度方法及装置,可以在分布式资源调度时,保证各服务器内各业务虚拟机的服务质量。Embodiments of the present invention provide a distributed resource scheduling method and device, which can ensure the service quality of each service virtual machine in each server during distributed resource scheduling.
第一方面,提供了一种分布式资源调度方法,包括:In the first aspect, a distributed resource scheduling method is provided, including:
获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率;Obtain the resource utilization rate of the same type of business virtual machines in each server in the distributed cluster system;
根据所述各服务器内的同一类型业务虚拟机的资源使用率,通过预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差,所述获取步骤为:根据所述各服务器内的同一类型业务虚拟机的资源使用率获取所述各服务器内的同一类型业务虚拟机的平均资源使用率,并根据所述各服务器内的同一类型业务虚拟机的资源使用率以及所述平均资源使用率,获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差;According to the resource utilization rate of the same type of service virtual machine in each server, the first standard deviation of the resource utilization rate of the same type of service virtual machine in each server is obtained through a predetermined acquisition step, and the acquisition step is: Obtain the average resource usage rate of the same type of service virtual machines in each server according to the resource usage rate of the same type of service virtual machines in each server, and obtain the resource usage rate of the same type of service virtual machines in each server rate and the average resource usage rate, and obtain the first standard deviation of the resource usage rates of the same type of service virtual machines in each server;
当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,将所述分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中;When the first standard deviation of the resource usage rates of the same type of service virtual machines in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machines in each server, the distributed cluster The same type of business virtual machine of any server in the system is balancedly dispatched to other servers in the distributed cluster system;
获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率;Obtain the resource utilization rate of the same type of business virtual machines in each server in the distributed cluster system after balanced scheduling;
根据所述平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,通过所述预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差;According to the resource utilization rate of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling, obtain the resource utilization rate of the same type of service virtual machine in each server through the predetermined acquisition step the second standard deviation of
比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度。Comparing the second standard deviation obtained after the balanced scheduling at least once, and executing the balanced scheduling corresponding to the smallest second standard deviation.
在第一种可能的实现方式中,所述比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度之前,所述方法还包括:In a first possible implementation manner, the method further includes comparing the second standard deviation obtained after the balanced scheduling at least once, and before executing the balanced scheduling corresponding to the smallest second standard deviation. include:
若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述获取步骤及下一次的平衡调度。If the second standard deviation of the resource utilization 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 utilization rate of the same type of service virtual machine in each server after the current balanced scheduling The second standard deviation of the second standard deviation, or as of the next balance scheduling, if the cumulative number of balanced scheduling exceeds the first set threshold, the acquisition step and the next balanced scheduling will be stopped.
第二方面,提供了一种分布式资源调度方法,包括:In the second aspect, a distributed resource scheduling method is provided, including:
根据分布式集群系统中各服务器内各类业务虚拟机占所述各服务器的资源的比例和所述各服务器内各类业务虚拟机的资源使用率,获取所述各服务器的资源使用率;According to the proportion of various service virtual machines in each server in the distributed cluster system to the resources of each server and the resource utilization rate of various service virtual machines in each server, the resource utilization rate of each server is obtained;
根据所述各服务器的资源使用率,通过预定的获取步骤获取所述分布式集群系统的资源使用率的第三标准差,所述获取步骤为:根据所述各服务器的资源使用率获取所述分布式集群系统的平均资源使用率,并根据所述各服务器的资源使用率以及所述分布式集群系统的平均资源使用率,获取所述分布式集群系统的资源使用率的第三标准差;According to the resource utilization rate of each server, the third standard deviation of the resource utilization rate of the distributed cluster system is acquired through a predetermined acquisition step, and the acquisition step is: acquiring the resource utilization rate of each server according to the the average resource usage rate of the distributed cluster system, and according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system, obtain the third standard deviation of the resource usage rate of the distributed cluster system;
当所述分布式集群系统的资源使用率的第三标准差大于或等于所述分布式集群系统的资源使用率的调度阈值时,将所述各服务器内任一业务虚拟机平衡调度至所述分布式集群系统的其他服务器中;When the third standard deviation of the resource utilization rate of the distributed cluster system is greater than or equal to the scheduling threshold of the resource utilization rate of the distributed cluster system, any service virtual machine in each server is balancedly scheduled to the In other servers of the distributed cluster system;
获取平衡调度后分布式集群系统中各服务器的资源使用率;Obtain the resource utilization rate of each server in the distributed cluster system after balanced scheduling;
根据所述平衡调度后分布式集群系统中各服务器的资源使用率,通过所述预定的获取步骤获取所述平衡调度后分布式集群系统的资源使用率的第四标准差;According to the resource usage rate of each server in the distributed cluster system after balanced scheduling, the fourth standard deviation of the resource usage rate of the distributed cluster system after balanced scheduling is obtained through the predetermined acquisition step;
比较至少一次所述平衡调度后获取的所述第四标准差,执行最小的所述第四标准差对应的所述平衡调度。Comparing the fourth standard deviation acquired after the balanced scheduling at least once, and executing the balanced scheduling corresponding to the smallest fourth standard deviation.
在第一种可能的实现方式中,所述比较至少一次所述平衡调度后获取的所述第四标准差,执行最小的所述第四标准差对应的所述平衡调度之前,所述方法还包括:In a first possible implementation manner, before comparing the fourth standard deviation acquired after the balanced scheduling at least once, before executing the balanced scheduling corresponding to the smallest fourth standard deviation, the method further 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 fourth standard deviation of the resource usage rate of the distributed cluster system after the current balanced scheduling, or until the next Balanced scheduling, the cumulative number of times the balanced scheduling is performed exceeds the first set threshold, or after the service virtual machine is balancedly scheduled from any first server to any second server, any one of the first servers or all The change of the total amount of various types of business virtual machines in any second server is greater than the second set threshold, and/or the proportion of various types of business virtual machines in any one of the first servers or the second server is If the resource change of any one of the first servers is greater than the third set threshold, the execution of the acquisition step and the next balance scheduling will be stopped.
第三方面,提供了一种分布式资源调度装置,包括:In a third aspect, a distributed resource scheduling device is provided, including:
第一获取单元,用于获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率;The first obtaining unit is used to obtain the resource utilization rate of the same type of business virtual machines in each server in the distributed cluster system;
第二获取单元,用于根据所述各服务器内的同一类型业务虚拟机的资源使用率,通过预定的获取方式获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差,所述获取方式为:根据所述各服务器内的同一类型业务虚拟机的资源使用率获取所述各服务器内的同一类型业务虚拟机的平均资源使用率,并根据所述各服务器内的同一类型业务虚拟机的资源使用率以及所述平均资源使用率,获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差;The second acquisition unit is configured to acquire the first standard deviation of the resource usage rates of the same type of service virtual machines in each server through a predetermined acquisition method according to the resource usage rates of the same type of service virtual machines in each server. , the obtaining method is: obtaining the average resource utilization rate of the same type of service virtual machine in each server according to the resource utilization rate of the same type of service virtual machine in each server, and according to the same resource utilization rate in each server The resource utilization rate of the type of service virtual machine and the average resource utilization rate are obtained by obtaining the first standard deviation of the resource utilization rate of the same type of service virtual machine in each server;
第一调度单元,用于当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,将所述分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中;The first scheduling unit is configured to: when the first standard deviation of the resource usage rates of the same type of service virtual machines in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machines in each server , balancing and scheduling the same type of service virtual machine of any server in the distributed cluster system to other servers in the distributed cluster system;
第三获取单元,用于获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率;The third obtaining unit is used to obtain the resource utilization rate of the same type of service virtual machine in each server in the distributed cluster system after balanced scheduling;
第四获取单元,用于根据所述平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,通过所述预定的获取方式获取所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差;The fourth acquisition unit is configured to acquire the same type of service virtual machines in each server through the predetermined acquisition method according to the resource utilization rate of the same type of service virtual machines in each server in the distributed cluster system after the balanced scheduling. The second standard deviation of the resource utilization rate of the business virtual machine;
第一比较单元,用于比较至少一次所述平衡调度后获取的所述第二标准差;a first comparison unit, configured to compare the second standard deviation obtained after at least one balance scheduling;
第一执行单元,用于执行最小的所述第二标准差对应的所述平衡调度。A first executing unit, configured to execute the balanced scheduling corresponding to the smallest second standard deviation.
在第一种可能的实现方式中,所述第一执行单元还用于:In a first possible implementation manner, the first execution unit is further configured to:
若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差的获取及下一次的平衡调度。If the second standard deviation of the resource utilization 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 utilization rate of the same type of service virtual machine in each server after the current balanced scheduling The second standard deviation of the second standard deviation, or as of the next balance scheduling, if the cumulative number of balanced scheduling exceeds the first set threshold, stop executing the second standard of the resource utilization rate of the same type of service virtual machine in each server Poor fetch and next balanced dispatch.
第四方面,提供了一种分布式资源调度装置,包括:In a fourth aspect, a distributed resource scheduling device is provided, including:
第五获取单元,用于根据分布式集群系统中各服务器内各类业务虚拟机占所述各服务器的资源的比例和所述各服务器内各类业务虚拟机的资源使用率,获取所述各服务器的资源使用率;The fifth acquiring unit is configured to acquire the resource utilization rate of each type of business virtual machine in each server according to the proportion of each type of business virtual machine in each server in the distributed cluster system to the resources of each server. server resource usage;
第六获取单元,用于根据所述各服务器的资源使用率,通过预定的获取方式获取所述分布式集群系统的资源使用率的第三标准差,所述获取方式为:根据所述各服务器的资源使用率获取所述分布式集群系统的平均资源使用率,并根据所述各服务器的资源使用率以及所述分布式集群系统的平均资源使用率,获取所述分布式集群系统的资源使用率的第三标准差;The sixth acquisition unit is configured to acquire the third standard deviation of the resource utilization rate of the distributed cluster system through a predetermined acquisition method according to the resource utilization rate of each server, and the acquisition method is: according to the resource utilization rate of each server Obtain the average resource utilization rate of the distributed cluster system, and obtain the resource utilization rate of the distributed cluster system according to the resource utilization rate of each server and the average resource utilization rate of the distributed cluster system The third standard deviation of the rate;
第二调度单元,用于当所述分布式集群系统的资源使用率的第三标准差大于或等于所述分布式集群系统的资源使用率的调度阈值时,将所述各服务器内任一业务虚拟机平衡调度至所述分布式集群系统的其他服务器中;The second scheduling unit is configured to schedule any service in each server when the third standard deviation of the resource utilization rate of the distributed cluster system is greater than or equal to the scheduling threshold The virtual machine is balanced and dispatched to other servers in the distributed cluster system;
第七获取单元,用于获取平衡调度后分布式集群系统中各服务器的资源使用率;The seventh obtaining unit is used to obtain the resource utilization rate of each server in the distributed cluster system after balanced scheduling;
第八获取单元,用于根据所述平衡调度后分布式集群系统中各服务器的资源使用率,通过所述预定的获取方式获取所述平衡调度后分布式集群系统的资源使用率的第四标准差;An eighth acquisition unit, configured to acquire the fourth criterion of the resource utilization rate of the distributed cluster system after balanced scheduling through the predetermined acquisition method according to the resource utilization rate of each server in the distributed cluster system after balanced scheduling Difference;
第二比较单元,用于比较至少一次所述平衡调度后获取的所述第四标准差;a second comparison unit, configured to compare the fourth standard deviation obtained after at least one balance scheduling;
第二执行单元,用于执行最小的所述第四标准差对应的所述平衡调度。The second executing unit is configured to execute the balanced scheduling corresponding to the smallest fourth standard deviation.
在第一种可能的实现方式中,所述第二执行单元还用于:In a first possible implementation manner, 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 balanced scheduling, or until the next Balanced scheduling, the cumulative number of times the balanced scheduling is performed exceeds the first set threshold, or after the service virtual machine is balancedly scheduled from any first server to any second server, any one of the first servers or all The change of the total amount of various types of business virtual machines in any second server is greater than the second set threshold, and/or the proportion of various types of business virtual machines in any one of the first servers or the second server is If the resource change of any one of the first servers is greater than the third set threshold, the acquisition of the resource utilization rate of the distributed cluster system after the balanced scheduling and the next balanced scheduling are stopped.
采用本发明实施例提供的一种分布式资源调度方法及装置的技术方案,通过按照分布式集群系统中各服务器内业务虚拟机的类型,或按照各服务器内各类业务虚拟机占所在服务器的资源比例进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。By adopting the technical solution of a distributed resource scheduling method and device provided by the embodiment of the present invention, according to the types of business virtual machines in each server in the distributed cluster system, or according to the types of business virtual machines in each server occupying the server where they are located, Distributed resource scheduling based on the resource ratio can guarantee the service quality of each business virtual machine in each server.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明实施例提供的一种分布式资源调度方法的流程示意图;FIG. 1 is a schematic flowchart of a distributed resource scheduling method provided by an embodiment of the present invention;
图2为本发明实施例提供的另一种分布式资源调度方法的流程示意图;FIG. 2 is a schematic flowchart of another distributed resource scheduling method provided by an embodiment of the present invention;
图3为本发明实施例提供的又一种分布式资源调度方法的流程示意图;FIG. 3 is a schematic flowchart of another distributed resource scheduling method provided by an embodiment of the present invention;
图4为本发明实施例提供的又一种分布式资源调度方法的流程示意图;FIG. 4 is a schematic flowchart of another distributed resource scheduling method provided by an embodiment of the present invention;
图5为本发明实施例提供的一种分布式资源调度装置的结构示意图;FIG. 5 is a schematic structural diagram of a distributed resource scheduling device provided by an embodiment of the present invention;
图6为本发明实施例提供的另一种分布式资源调度装置的结构示意图;FIG. 6 is a schematic structural diagram of another distributed resource scheduling device provided by an embodiment of the present invention;
图7为本发明实施例提供的一种分布式资源调度设备的结构示意图;FIG. 7 is a schematic structural diagram of a distributed resource scheduling device provided by an embodiment of the present invention;
图8为本发明实施例提供的另一种分布式资源调度设备的结构示意图。FIG. 8 is a schematic structural diagram of another distributed resource scheduling device provided by an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.
请参阅图1,为本发明实施例提供的一种分布式资源调度方法的流程示意图。该方法包括以下步骤:Please refer to FIG. 1 , which is a schematic flowchart of a distributed resource scheduling method provided by an embodiment of the present invention. The method includes the following steps:
步骤S101,获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率。Step S101 , acquiring resource usage rates of service virtual machines of the same type in each server in the distributed cluster system.
在虚拟化或云计算的服务器集群中包括有多个服务器,每个服务器中又包括多个虚拟机,这多个虚拟机可以运行不同类型的业务,称为业务虚拟机。采用DRS技术对服务器集群的资源进行分配,系统给每个服务器分配一定的资源,每个服务器又给其各虚拟机分配相应的资源,因此该服务器集群又称为分布式集群系统,这里的资源指中央处理器(Central Processing Unit,CPU)、内存和输入/输出(Input/Output,I/O)等控制、存储和输入/输出资源。A virtualized or cloud computing server cluster includes multiple servers, and each server includes multiple virtual machines, and these multiple virtual machines can run different types of services, which are called service virtual machines. DRS technology is used to allocate resources in server clusters. The system allocates certain resources to each server, and each server allocates corresponding resources to its virtual machines. Therefore, the server cluster is also called a distributed cluster system. The resources here Refers to control, storage, and input/output resources such as the central processing unit (Central Processing Unit, CPU), memory, and input/output (Input/Output, I/O).
在本步骤中,获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率,获取的方式可以为:在每个服务器中设置监控器,监控器监控该服务器内该类型业务虚拟机的资源使用率,并上报给DRS,或者DRS向监控器请求该类型虚拟机的资源使用率,从监控器获取该类型业务虚拟机的资源使用率的次数可以为一次,也可以为多次。这里的资源使用率可以是某一种资源的使用率,也可以是各种资源例如CPU、内存和I/O等的资源使用率的加权值。In this step, the resource utilization rate of the same type of business virtual machine in each server in the distributed cluster system can be obtained. The resource usage rate of the machine can be reported to DRS, or the DRS can request the resource usage rate of this type of virtual machine from the monitor, and the resource usage rate of this type of business virtual machine can be obtained from the monitor for one time or multiple times . Here, the resource usage rate may be the 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 server in the distributed cluster system has one or more types of business virtual machines, for example, there are desktop cloud virtual machines and compilation cloud virtual machines. This embodiment obtains the resources of the same type of virtual machines in each server according to the business 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. Server 1 has 2 desktop cloud virtual machines and 2 compiled cloud virtual machines. Server 2 has 3 desktop cloud virtual machines and 2 compiled cloud virtual machines. Server 3 has desktop cloud. 1 virtual machine and 2 compiled cloud virtual machines. DRS allocates certain CPU, memory, and I/O resources to servers 1, 2, and 3 in the cluster, and each server allocates certain resources to various types of virtual machines inside it. CPU, memory, and I/O resources. Taking CPU resource allocation as an example, DRS allocates CPU resources of quantity A to server 1, allocates CPU resources of quantity B to server 2, and allocates CPU resources of quantity C to server 3. , Server 1 allocates CPU resources of A1, A2, A3, and A4 to the 2 desktop cloud virtual machines and 2 compiled cloud virtual machines respectively. Taking the resource usage rate of the desktop cloud virtual machine as an example, the 2 desktop cloud virtual machines in server 1 The resource utilization rate of the desktop cloud virtual machine is 30% and 40% respectively, then the resource utilization rate of the CPU of the desktop cloud virtual machine in server 1 is (30%*A1+40%*A2)/(A1+A2), Then calculate the total memory and I/O resource usage of the desktop cloud virtual machine in Server 1 in the same way, and then perform weighted calculations on the total CPU, memory, and I/O resource usage to obtain Server 1 The resource usage of the desktop cloud virtual machine, and so on to obtain the resource usage of the desktop cloud virtual machines of servers 2 and 3. At the same time, the resource utilization rate of the compiled cloud virtual machine in each server can also be obtained in the same manner.
步骤S102,根据所述各服务器内的同一类型业务虚拟机的资源使用率,通过预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差,所述获取步骤为:根据所述各服务器内的同一类型业务虚拟机的资源使用率获取所述各服务器内的同一类型业务虚拟机的平均资源使用率,并根据所述各服务器内的同一类型业务虚拟机的资源使用率以及所述平均资源使用率,获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差。Step S102, according to the resource utilization rate of the same type of service virtual machine in each server, obtain the first standard deviation of the resource utilization rate of the same type of service virtual machine in each server through a predetermined acquisition step, the acquisition The steps are: according to the resource usage of the same type of service virtual machines in each server, the average resource usage of the same type of service virtual machines in each server is obtained, and according to the resource usage of the same type of service virtual machines in each of the servers and the average resource usage rate, and obtain the first standard deviation of the resource usage rates of the same type of service virtual machines in each server.
采用DRS技术保证集群内的资源利用率最大化,因此,计算集群内各个服务器内的同一类型业务虚拟机的资源使用率与各个服务器内的同一类型业务虚拟机的平均资源使用率的标准差,标准差用于反应数据的离散程度,其计算公式如公式(1)所示:The DRS technology is adopted to ensure the maximum utilization of resources in the cluster. Therefore, the standard deviation between the resource utilization of the same type of service virtual machines in each server in the cluster and the average resource utilization of the same type of service virtual machines in each server is calculated. The standard deviation is used to reflect the degree of dispersion of the data, and its calculation formula is shown in formula (1):
在公式(1)中,xi是各个服务器内的同一类型业务虚拟机的资源使用率;μ是各个服务器内的同一类型业务虚拟机的平均资源使用率,N是集群中的服务器个数,σ为标准差。In formula (1), x i is the resource utilization rate of the same type of business virtual machine in each server; μ is the average resource utilization rate of the same type of service virtual machine in each server, N is the number of servers in the cluster, σ is the standard deviation.
根据标准差的获取步骤,首先需要获取各个服务器内的同一类型业务虚拟机的平均资源使用率。在步骤S101中已经获取各个服务器内的同一类型业务虚拟机的资源使用率,可以根据现有的计算方式获取各个服务器内的同一类型业务虚拟机的平均资源使用率。例如前面的示例中,有三个服务器,则将获取的各服务器内同一类型业务虚拟机的资源使用率取和再除以服务器的个数,即得到该平均资源使用率。According to the step of obtaining the standard deviation, it is first necessary to obtain the average resource utilization rate of the same type of service virtual machines in each server. In step S101, the resource utilization rate of the same type of service virtual machine in each server has been obtained, and the average resource utilization rate of the same type of service virtual machine in each server can be obtained according to the existing calculation method. For example, in the preceding example, if there are three servers, the obtained resource utilization rates of the same type of service virtual machines in each server are summed and then divided by the number of servers to obtain the average resource utilization rate.
然后,根据公式(1)获取各服务器内的同一类型业务虚拟机的资源使用率的标准差。Then, according to the formula (1), the standard deviation of the resource utilization rate of the same type of service virtual machines in each server is obtained.
步骤S103,当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,将所述分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中。Step S103, when the first standard deviation of the resource utilization rate of the same type of service virtual machine in each server is greater than or equal to the scheduling threshold of the resource utilization rate of the same type of service virtual machine in each server, set the The same type of service virtual machine of any server in the distributed cluster system is balancedly scheduled to other servers in the distributed cluster system.
通过比较获取的标准差与各服务器内的同一类型业务虚拟机的资源使用率的调度阈值,系统可以判断各个服务器内的该类型业务虚拟机的资源使用是否失衡,标准差越大,表示失衡率越高。需要说明的是,由于各服务器内有多种类型的业务虚拟机,则对各服务器内每一相同类型的业务虚拟机分别计算其与获取的平均资源使用率的标准差,获取的标准差的结果可以是某一类型的业务虚拟机的资源使用均衡,而另一类型的业务虚拟机的资源使用率失衡。By comparing the obtained standard deviation with the scheduling threshold of the resource usage rate of the same type of business virtual machines in each server, the system can judge whether the resource usage of this type of business virtual machines in each server is unbalanced. The larger the standard deviation, the higher the imbalance rate. higher. It should be noted that since there are multiple types of business virtual machines in each server, the standard deviation of the obtained average resource usage rate is calculated for each same type of business virtual machine in each server, and the obtained standard deviation The result may be that the resource usage of a certain type of service virtual machine is balanced, while the resource usage of another type of service virtual machine is unbalanced.
当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,触发调度。调度过程中可以按照递归调度,递归调度过程中是将分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中。When the first standard deviation of resource usage rates of service virtual machines of the same type in each server is greater than or equal to a scheduling threshold of resource usage rates of service virtual machines of the same type in each server, scheduling is triggered. The scheduling process may follow recursive scheduling. In the recursive scheduling process, the same type of service virtual machine of any server in the distributed cluster system is balancedly scheduled to other servers in the distributed cluster system.
步骤S104,获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率。Step S104, obtaining the resource utilization rate of the same type of service virtual machines in each server in the distributed cluster system after balanced scheduling.
步骤S105,根据所述平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,通过所述预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差。Step S105, according to the resource utilization rate of the same type of service virtual machines in each server in the distributed cluster system after the balanced scheduling, obtain the information of the same type of service virtual machines in each server through the predetermined acquisition step The second standard deviation of resource usage.
每一轮平衡调度后,获取调度虚拟机对失衡率的影响,即重新获取平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差。After each round of balanced scheduling, the influence of the scheduled virtual machine on the imbalance rate is obtained, that is, the standard deviation of the resource utilization rate of the same type of service virtual machines in each server after the balanced scheduling is obtained again.
由于每一轮平衡调度后,各服务器内同一类型的业务虚拟机的资源使用率发生变化,首先要获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,然后再按照预定的标准差的获取步骤获取该轮平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差。Since the resource utilization rate of the same type of service virtual machine in each server changes after each round of balanced scheduling, it is first necessary to obtain the resource utilization rate of the same type of service virtual machine in each server in the distributed cluster system after balanced scheduling , and then obtain the standard deviation of the resource utilization rate of the same type of service virtual machines in each server after the round of balanced scheduling according to the predetermined standard deviation acquisition step.
步骤S106,比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度。Step S106, comparing the second standard deviation obtained after the balanced scheduling at least once, and executing the balanced scheduling corresponding to the smallest second standard deviation.
进行多轮上述的平衡调度,平衡调度时可以采取一定的策略进行调度,例如将重载的业务虚拟机调度至其它服务器,本发明实施例不作限定,在进行多轮上述的平衡调度中,记录每一轮平衡调度获取的该轮平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差,然后比较多轮平衡调度后获取的多个标准差,选出最小的标准差,最终执行该最小的标准差对应的平衡调度,即获取该最小标准差进行的平衡调度是将哪个或哪几个虚拟机调度至哪个或哪几个服务器,则执行该平衡调度。Perform multiple rounds of the above-mentioned balanced scheduling. During the balanced scheduling, certain strategies can be adopted for scheduling, such as scheduling heavy-duty business virtual machines to other servers. This embodiment of the present invention does not limit it. During multiple rounds of the above-mentioned balanced scheduling, record Each round of balanced scheduling obtains the standard deviation of the resource utilization rate of the same type of business virtual machine in each server after the round of balanced scheduling, and then compares multiple standard deviations obtained after multiple rounds of balanced scheduling to select the smallest standard deviation. Finally, the balanced scheduling corresponding to the minimum standard deviation is executed, that is, which virtual machine(s) are scheduled to which server(s) the balanced scheduling based on the minimum standard deviation is performed, and then the balanced scheduling is performed.
需要说明的是,由于是针对各服务器内同一类型业务虚拟机进行的分布式资源调度,可以分别进行各服务器内每一类业务虚拟机的分布式资源调度,如果某一类型业务虚拟机的资源使用均衡,则进行该分布式资源调度。It should be noted that since the distributed resource scheduling is performed for the same type of service virtual machines in each server, the distributed resource scheduling of each type of service virtual machine in each server can be performed separately. If the resources of a certain type of service virtual machine When balancing is used, the distributed resource scheduling is performed.
可见,根据本发明实施例提供的一种分布式资源调度方法,通过按照分布式集群系统中各服务器内业务虚拟机的类型进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that according to a distributed resource scheduling method provided by an embodiment of the present invention, by performing distributed resource scheduling according to the types of service virtual machines in each server in a distributed cluster system, the service quality of each service virtual machine in each server can be guaranteed. .
请参阅图2,为本发明实施例提供的另一种分布式资源调度方法的流程示意图。该方法与前述实施例的不同之处在于,还包括步骤S206:若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述获取步骤及下一次的平衡调度。Please refer to FIG. 2 , which is a schematic flowchart of another distributed resource scheduling method provided by an embodiment of the present invention. The difference between this method and the previous embodiment is that it also includes step S206: if the second standard deviation of the resource utilization rate of the same type of service virtual machine in each server is greater than or equal to the current balance after the next balance scheduling After scheduling, the second standard deviation of the resource utilization rate of the same type of service virtual machine in each server, or as of the next balanced scheduling, if the cumulative number of times the balanced scheduling is performed exceeds the first set threshold, then stop executing the Get step and next balance schedule.
采用递归调度可使得调度效率最高,在递归调度中设置递归退出的条件,即若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述获取步骤及下一次的平衡调度。这样有助于及时停止上述获取步骤和平衡调度,获得最小的标准差,执行该最小的标准差对应的平衡调度。Using recursive scheduling can make the scheduling efficiency the highest, and set the recursive exit condition in the recursive scheduling, that is, if the second standard deviation of the resource utilization rate of the same type of service virtual machine in each server is greater than or equal to the next balanced scheduling The second standard deviation of the resource utilization rate of the same type of service virtual machine in each server after the current balanced scheduling is performed, or until the next balanced scheduling, the cumulative number of times the balanced scheduling is performed exceeds the first set threshold, then stop Execute the acquisition step and the next balance scheduling. This helps to stop the above acquisition steps and balance scheduling in time, obtain the minimum standard deviation, and execute the balance scheduling corresponding to the minimum standard deviation.
请参阅图3,为本发明实施例提供的又一种分布式资源调度方法的流程示意图。该方法包括以下步骤:Please refer to FIG. 3 , which is a schematic flowchart of another distributed resource scheduling method provided by an embodiment of the present invention. The method includes the following steps:
步骤S301,根据分布式集群系统中各服务器内各类业务虚拟机占所述各服务器的资源的比例和所述各服务器内各类业务虚拟机的资源使用率,获取所述各服务器的资源使用率。Step S301, according to the ratio of various types of business virtual machines in each server in the distributed cluster system to the resources of each server and the resource utilization rate of each type of business virtual machines in each server, obtain the resource usage of each server Rate.
分布式集群系统中各服务器内有一种或多种类型的业务虚拟机,例如,有桌面云虚拟机和编译云虚拟机,DRS给集群内每个服务器分配有一定的运算、存储和输入/输出资源,各个服务器又其将其获得的资源按照一定的比例分配给其内部的各类型的业务虚拟机。保证各服务器内不同类型业务虚拟机的资源的总量和比例保持稳定,即可保证各服务器内各类业务虚拟机的服务质量。Each server in the distributed cluster system has one or more types of business virtual machines, for example, there are desktop cloud virtual machines and compilation cloud virtual machines, and DRS allocates certain computing, storage, and input/output to each server in the cluster resources, and each server allocates the resources it obtains to various types of business virtual machines inside it according to a certain proportion. Ensuring that the total amount and ratio of resources of different types of business virtual machines in each server remain stable can ensure the service quality of various types of business virtual machines in each server.
例如,集群内有三个服务器,服务器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. Server 1 has 2 desktop cloud virtual machines and 2 compiled cloud virtual machines. Server 2 has 3 desktop cloud virtual machines and 2 compiled cloud virtual machines. Server 3 has desktop cloud. 1 virtual machine, 2 compiled cloud virtual machines, DRS allocates certain CPU, memory and I/O resources to servers 1, 2, and 3 in the cluster, and each server allocates certain CPU to each internal virtual machine , memory and I/O resources, taking CPU resource allocation as an example, DRS allocates CPU resources of quantity A to server 1, allocates CPU resources of quantity B to server 2, and allocates CPU resources of quantity C to server 3, and server 1 Allocate the CPU resources of A1, A2, A3 and A4 to the 2 desktop cloud virtual machines and 2 compiled cloud virtual machines respectively, and the resource utilization rates of the 2 desktop cloud virtual machines in server 1 are 30% and 40% respectively. %, the resource utilization rates of the two compiled cloud virtual machines in server 1 are 40% and 50% respectively, then the CPU resource utilization rate of 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 various virtual machines in server 1 in the same way, and then calculate the CPU, memory and I/O resource usage of server 1 The resource usage of I/O is weighted and calculated to obtain the resource usage of server 1, and so on for servers 2 and 3.
步骤S302,根据所述各服务器的资源使用率,通过预定的获取步骤获取所述分布式集群系统的资源使用率的第三标准差,所述获取步骤为:根据所述各服务器的资源使用率获取所述分布式集群系统的平均资源使用率,并根据所述各服务器的资源使用率以及所述分布式集群系统的平均资源使用率,获取所述分布式集群系统的资源使用率的第三标准差。Step S302, according to the resource utilization rate of each server, obtain the third standard deviation of the resource utilization rate of the distributed cluster system through a predetermined acquisition step, the acquisition step is: according to the resource utilization rate of each server Obtaining the average resource usage rate of the distributed cluster system, and according to the resource usage rate of each server and the average resource usage rate of the distributed cluster system, obtaining a third value of the resource usage rate of the distributed cluster system standard deviation.
与前述实施例不同的是,由于针对的是各服务器内各类业务虚拟机,所以,按照前述实施例相同的方式获取各服务器的资源使用率以及整个分布式集群系统的平均资源使用率,然后,按照公式(1)获取分布式集群系统的资源使用率的标准差。The difference from the foregoing embodiments is that since it is aimed at various types of business virtual machines in each server, the resource utilization rate of each server and the average resource utilization rate of the entire distributed cluster system are obtained in the same manner as the foregoing embodiments, and then , obtain the standard deviation of the resource utilization rate of the distributed cluster system according to the formula (1).
步骤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.
将获取的分布式集群系统的资源使用率的标准差与该分布式集群系统的资源使用率的调度阈值进行比较,如果该分布式集群系统的资源使用率的标准差大于或等于该分布式集群系统的资源使用率的调度阈值,则触发平衡调度。平衡调度的对象可以是各服务器内任一业务虚拟机。Compare the obtained standard deviation of the resource utilization rate of the distributed cluster system with the scheduling threshold of the resource utilization rate of the distributed cluster system, if the standard deviation of the resource utilization rate of the distributed cluster system is greater than or equal to the distributed cluster system The scheduling threshold of the resource usage of the system triggers balanced scheduling. The object of balanced scheduling can be any service virtual machine in each server.
步骤S304,获取平衡调度后分布式集群系统中各服务器的资源使用率。Step S304, obtaining the resource utilization rate of each server in the distributed cluster system after balanced scheduling.
步骤S305,根据所述平衡调度后分布式集群系统中各服务器的资源使用率,通过所述预定的获取步骤获取所述平衡调度后分布式集群系统的资源使用率的第四标准差。Step S305, according to the resource usage rate of each server in the distributed cluster system after balanced scheduling, obtain the fourth standard deviation of the resource usage rate of the distributed cluster system after balanced scheduling through the predetermined acquisition step.
步骤S306,比较至少一次所述平衡调度后获取的所述第四标准差,执行最小的所述第四标准差对应的所述平衡调度。Step S306, comparing the fourth standard deviation obtained after the balanced scheduling at least once, and executing the balanced scheduling corresponding to the smallest fourth standard deviation.
步骤S304-步骤S306与前述实施例的步骤S104-步骤S106分别类似,在此不再赘述,所不同的是,针对的是各服务器内各类业务虚拟机,获取的是该分布式集群系统的资源使用率的标准差。Step S304-Step S306 are similar to Step S104-Step S106 of the previous embodiment, and will not be repeated here. The difference is that, for various types of business virtual machines in each server, the obtained is the distributed cluster system Standard deviation of resource usage.
可见,根据本发明实施例提供的一种分布式资源调度方法,通过按照各服务器内各类业务虚拟机占所在服务器的资源比例进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that, according to a distributed resource scheduling method provided by an embodiment of the present invention, by performing distributed resource scheduling according to the resource ratio of various business virtual machines in each server to the server where it is located, the service of each business virtual machine in each server can be guaranteed. quality.
请参阅图4,为本发明实施例提供的又一种分布式资源调度方法的流程示意图。该方法与前述实施例的不同之处在于,还包括步骤S406:若进行下一次平衡调度后所述分布式集群系统的资源使用率的第四标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第四标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则停止执行所述获取步骤及下一次的平衡调度。Please refer to FIG. 4 , which is a schematic flowchart of another distributed resource scheduling method provided by an embodiment of the present invention. The method is different from the foregoing embodiments in that it further includes step S406: if the fourth standard deviation of the resource utilization rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the distribution after the current balanced scheduling The fourth standard deviation of the resource utilization rate of the cluster system, or until the next balance scheduling, the cumulative number of balanced scheduling exceeds the first set threshold, or the service virtual machine is balanced from any first server After going to any second server, the change of the total amount of all kinds of business virtual machines in the any first server or the any second server is greater than the second set threshold, and/or the any first server If the change in the resources of any first server occupied by various types of service virtual machines in the server or any second server is greater than a third set threshold, the execution of the acquisition step and the next balance scheduling will be stopped.
采用递归调度可使得调度效率最高,在递归调度中设置递归退出的条件,即若进行下一次平衡调度后所述分布式集群系统的资源使用率的第四标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第四标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则停止执行所述获取步骤及下一次的平衡调度。这样有助于及时停止上述获取步骤和平衡调度,获得最小的标准差,执行该最小的标准差对应的平衡调度。Using recursive scheduling can make the scheduling efficiency the highest, and set the recursive exit condition in the recursive scheduling, that is, if the fourth standard deviation of the resource utilization rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the current balanced scheduling The fourth standard deviation of the resource utilization rate of the distributed cluster system, or as of the next balanced scheduling, the cumulative number of times the balanced scheduling is performed exceeds the first set threshold, or the service virtual machine is switched from any first After the server is balanced and dispatched to any second server, the change of the total amount of various business virtual machines in the any first server or the any second server is greater than the second set threshold, and/or the any If the resource change of any one of the first servers occupied by various types of business virtual machines in the first server or the second server is greater than the third set threshold, stop performing the acquisition step and the next balancing scheduling. This helps to stop the above acquisition steps and balance scheduling in time, obtain the minimum standard deviation, and execute the balance scheduling corresponding to the minimum standard deviation.
请参阅图5,为本发明实施例提供的一种分布式资源调度装置的结构示意图。该装置1000包括:Please refer to FIG. 5 , which is a schematic structural diagram of a distributed resource scheduling device provided by an embodiment of the present invention. The device 1000 includes:
第一获取单元11,用于获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率。The first acquiring unit 11 is configured to acquire the resource utilization rate of the same type of service virtual machines in each server in the distributed cluster system.
在虚拟化或云计算的服务器集群中包括有多个服务器,每个服务器中又包括多个虚拟机,这多个虚拟机可以运行不同类型的业务,称为业务虚拟机。采用DRS技术对服务器集群的资源进行分配,系统给每个服务器分配一定的资源,每个服务器又给其各虚拟机分配相应的资源,因此该服务器集群又称为分布式集群系统,这里的资源指中央处理器(Central Processing Unit,CPU)、内存和输入/输出(Input/Output,I/O)等控制、存储和输入/输出资源。A virtualized or cloud computing server cluster includes multiple servers, and each server includes multiple virtual machines, and these multiple virtual machines can run different types of services, which are called service virtual machines. DRS technology is used to allocate resources in server clusters. The system allocates certain resources to each server, and each server allocates corresponding resources to its virtual machines. Therefore, the server cluster is also called a distributed cluster system. The resources here Refers to control, storage, and input/output resources such as the central processing unit (Central Processing Unit, CPU), memory, and input/output (Input/Output, I/O).
第一获取单元11获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率,获取的方式可以为:在每个服务器中设置监控器,监控器监控该服务器内该类型业务虚拟机的资源使用率,并上报给DRS,或者DRS向监控器请求该类型虚拟机的资源使用率,从监控器获取该类型业务虚拟机的资源使用率的次数可以为一次,也可以为多次。这里的资源使用率可以是某一种资源的使用率,也可以是各种资源例如CPU、内存和I/O等的资源使用率的加权值。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. The resource usage rate of the machine can be reported to DRS, or the DRS can request the resource usage rate of this type of virtual machine from the monitor, and the resource usage rate of this type of business virtual machine can be obtained from the monitor for one time or multiple times . Here, the resource usage rate may be the 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 server in the distributed cluster system has one or more types of business virtual machines, for example, there are desktop cloud virtual machines and compilation cloud virtual machines. This embodiment obtains the resources of the same type of virtual machines in each server according to the business 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. Server 1 has 2 desktop cloud virtual machines and 2 compiled cloud virtual machines. Server 2 has 3 desktop cloud virtual machines and 2 compiled cloud virtual machines. Server 3 has desktop cloud. 1 virtual machine and 2 compiled cloud virtual machines. DRS allocates certain CPU, memory, and I/O resources to servers 1, 2, and 3 in the cluster, and each server allocates certain resources to various types of virtual machines inside it. CPU, memory, and I/O resources. Taking CPU resource allocation as an example, DRS allocates CPU resources of quantity A to server 1, allocates CPU resources of quantity B to server 2, and allocates CPU resources of quantity C to server 3. , Server 1 allocates CPU resources of A1, A2, A3, and A4 to the 2 desktop cloud virtual machines and 2 compiled cloud virtual machines respectively. Taking the resource usage rate of the desktop cloud virtual machine as an example, the 2 desktop cloud virtual machines in server 1 The resource utilization rate of the desktop cloud virtual machine is 30% and 40% respectively, then the resource utilization rate of the CPU of the desktop cloud virtual machine in server 1 is (30%*A1+40%*A2)/(A1+A2), Then calculate the total memory and I/O resource usage of the desktop cloud virtual machine in Server 1 in the same way, and then perform weighted calculations on the total CPU, memory, and I/O resource usage to obtain Server 1 The resource usage of the desktop cloud virtual machine, and so on to obtain the resource usage of the desktop cloud virtual machines of servers 2 and 3. At the same time, the resource utilization rate of the compiled cloud virtual machine in each server can also be obtained in the same manner.
第二获取单元12,用于根据所述各服务器内的同一类型业务虚拟机的资源使用率,通过预定的获取方式获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差,所述获取方式为:根据所述各服务器内的同一类型业务虚拟机的资源使用率获取所述各服务器内的同一类型业务虚拟机的平均资源使用率,并根据所述各服务器内的同一类型业务虚拟机的资源使用率以及所述平均资源使用率,获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差。The second acquisition unit 12 is configured to acquire the first standard of the resource usage rate of the same type of service virtual machine in each server through a predetermined acquisition method according to the resource usage rate of the same type of service virtual machine in each server Poor, the acquisition method is as follows: Obtain the average resource utilization rate of the same type of service virtual machine in each server according to the resource utilization rate of the same type of service virtual machine in each server, and according to the resource utilization rate of the same type of service virtual machine in each server The resource utilization rate of the same type of service virtual machine and the average resource utilization rate obtain the first standard deviation of the resource utilization rate of the same type of service virtual machine in each server.
采用DRS技术保证集群内的资源利用率最大化,因此,第二获取单元12获取集群内各个服务器内的同一类型业务虚拟机的资源使用率与各个服务器内的同一类型业务虚拟机的平均资源使用率的标准差,标准差用于反应数据的离散程度,其计算公式如公式(1)所示。The DRS technology is adopted to ensure the maximum utilization rate of resources in the cluster. Therefore, the second acquisition unit 12 acquires the resource utilization rate of the same type of service virtual machines in each server in the cluster and the average resource utilization of the same type of service virtual machines in each server. The standard deviation of the rate, the standard deviation is used to reflect the degree of dispersion of the data, and its calculation formula is shown in formula (1).
根据标准差的计算公式,第二获取单元12首先需要获取各个服务器内的同一类型业务虚拟机的平均资源使用率。第一获取单元11已经获取各个服务器内的同一类型业务虚拟机的资源使用率,第二获取单元12可以根据现有的计算方式获取各个服务器内的同一类型业务虚拟机的平均资源使用率。例如前面的示例中,有三个服务器,则将获取的各服务器内同一类型业务虚拟机的资源使用率取和再除以服务器的个数,即得到该平均资源使用率。According to the formula for calculating the standard deviation, the second obtaining unit 12 first needs to obtain the average resource utilization rate of the same type of service virtual machines in each server. The first obtaining unit 11 has obtained the resource utilization rate of the same type of service virtual machine in each server, and the second obtaining unit 12 can obtain the average resource utilization rate of the same type of service virtual machine in each server according to the existing calculation method. For example, in the preceding example, if there are three servers, the obtained resource utilization rates of the same type of service virtual machines in each server are summed and then divided by the number of servers to obtain the average resource utilization rate.
然后,第二获取单元12根据公式(1)获取各服务器内的同一类型业务虚拟机的资源使用率的标准差。Then, the second acquiring unit 12 acquires the standard deviation of the resource utilization rates of the same type of service virtual machines in each server according to the formula (1).
第一调度单元13,用于当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,将所述分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中。The first scheduling unit 13 is configured to: when the first standard deviation of the resource usage rates of the same type of service virtual machines in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machines in each server , the same type of service virtual machine of any server in the distributed cluster system is balancedly scheduled to other servers in the distributed cluster system.
通过比较获取的标准差与各服务器内的同一类型业务虚拟机的资源使用率的调度阈值,系统可以判断各个服务器内的该类型业务虚拟机的资源使用是否失衡,标准差越大,表示失衡率越高。需要说明的是,由于各服务器内有多种类型的业务虚拟机,则对各服务器内每一相同类型的业务虚拟机分别计算其与获取的平均资源使用率的标准差,获取的标准差的结果可以是某一类型的业务虚拟机的资源使用均衡,而另一类型的业务虚拟机的资源使用率失衡。By comparing the obtained standard deviation with the scheduling threshold of the resource usage rate of the same type of business virtual machines in each server, the system can judge whether the resource usage of this type of business virtual machines in each server is unbalanced. The larger the standard deviation, the higher the imbalance rate. higher. It should be noted that since there are multiple types of business virtual machines in each server, the standard deviation of the obtained average resource usage rate is calculated for each same type of business virtual machine in each server, and the obtained standard deviation The result may be that the resource usage of a certain type of service virtual machine is balanced, while the resource usage of another type of service virtual machine is unbalanced.
当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,第一调度单元13触发调度。调度过程中可以按照递归调度,递归调度过程中是将分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中。When the first standard deviation of the resource usage rates of the same type of service virtual machines in each server is greater than or equal to the scheduling threshold of the resource usage rates of the same type of service virtual machines in each server, the first scheduling unit 13 triggers scheduling. The scheduling process may follow recursive scheduling. In the recursive scheduling process, the same type of service virtual machine of any server in the distributed cluster system is balancedly scheduled to other servers in the distributed cluster system.
第三获取单元14,用于获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率。The third obtaining unit 14 is configured to obtain the resource utilization rate of the same type of service virtual machines in each server in the distributed cluster system after balanced scheduling.
第四获取单元15,用于根据所述平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,通过所述预定的获取方式获取所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差。The fourth acquisition unit 15 is configured to acquire the same type of service virtual machine in each server in the predetermined acquisition method according to the resource utilization rate of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling. The second standard deviation of the resource usage of type business virtual machines.
每一轮平衡调度后,第四获取单元15获取调度虚拟机对失衡率的影响,即第四获取单元15重新获取平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差。After each round of balanced scheduling, the fourth acquisition unit 15 acquires the influence of the scheduled virtual machine on the unbalance rate, that is, the fourth acquisition unit 15 reacquires the standard deviation of the resource utilization rate of the same type of service virtual machines in each server after the balanced scheduling.
由于每一轮平衡调度后,各服务器内同一类型的业务虚拟机的资源使用率发生变化,首先第三获取单元14要获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,然后第四获取单元15再按照预定的标准差的获取方式获取该轮平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差。Since the resource utilization rate of the same type of service virtual machines in each server changes after each round of balanced scheduling, first the third acquisition unit 14 needs to obtain the same type of service virtual machines in each server in the distributed cluster system after balanced scheduling. Then the fourth acquisition unit 15 acquires the standard deviation of the resource utilization rate of the same type of service virtual machines in each server after the round of balance scheduling according to the predetermined standard deviation acquisition method.
第一比较单元16,用于比较至少一次所述平衡调度后获取的所述第二标准差;A first comparison unit 16, configured to compare the second standard deviation obtained after at least one balance scheduling;
第一执行单元17,用于执行最小的所述第二标准差对应的所述平衡调度。The first executing unit 17 is configured to execute the balanced scheduling corresponding to the smallest second standard deviation.
进行多轮上述的平衡调度,平衡调度时可以采取一定的策略进行调度,例如将重载的业务虚拟机调度至其它服务器,本发明实施例不作限定,在进行多轮上述的平衡调度中,记录每一轮平衡调度获取的该轮平衡调度后各服务器内的同一类型业务虚拟机的资源使用率的标准差,然后比较多轮平衡调度后获取的多个标准差,选出最小的标准差,第一执行单元17最终执行该最小的标准差对应的平衡调度,即获取该最小标准差进行的平衡调度是将哪个或哪几个虚拟机调度至哪个或哪几个服务器,则执行该平衡调度。Perform multiple rounds of the above-mentioned balanced scheduling. During the balanced scheduling, certain strategies can be adopted for scheduling, such as scheduling heavy-duty business virtual machines to other servers. This embodiment of the present invention does not limit it. During multiple rounds of the above-mentioned balanced scheduling, record Each round of balanced scheduling obtains the standard deviation of the resource utilization rate of the same type of business virtual machine in each server after the round of balanced scheduling, and then compares multiple standard deviations obtained after multiple rounds of balanced scheduling to select the smallest standard deviation. The first execution unit 17 finally executes the balanced scheduling corresponding to the minimum standard deviation, that is, which or which virtual machines are scheduled to which or which servers are scheduled for the balanced scheduling performed by obtaining the minimum standard deviation, then the balanced scheduling is executed .
需要说明的是,由于是针对各服务器内同一类型业务虚拟机进行的分布式资源调度,可以分别进行各服务器内每一类业务虚拟机的分布式资源调度,如果某一类型业务虚拟机的资源使用均衡,则进行该分布式资源调度。It should be noted that since the distributed resource scheduling is performed for the same type of service virtual machines in each server, the distributed resource scheduling of each type of service virtual machine in each server can be performed separately. If the resources of a certain type of service virtual machine When balancing is used, the distributed resource scheduling is performed.
可见,根据本发明实施例提供的一种分布式资源调度装置,通过按照分布式集群系统中各服务器内业务虚拟机的类型进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that, according to a distributed resource scheduling device provided by an embodiment of the present invention, by performing distributed resource scheduling according to the types of service virtual machines in each server in a distributed cluster system, the service quality of each service virtual machine in each server can be guaranteed. .
作为一种实施方式,第一执行单元17还可以用于若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差的获取及下一次的平衡调度。As an implementation manner, the first execution unit 17 may also be configured to if the second standard deviation of the resource utilization rates of the same type of service virtual machines in each server after the next balanced scheduling is greater than or equal to the current balanced scheduling If the second standard deviation of the resource utilization rate of the same type of service virtual machine in each server, or as of the next balance scheduling, the cumulative number of times the balance scheduling is performed exceeds the first set threshold, then the execution of each server will be stopped. Acquisition of the second standard deviation of the resource utilization rate of the same type of business virtual machines within the same type of service and the next balance scheduling.
采用递归调度可使得调度效率最高,在递归调度中设置递归退出的条件,即若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则第一执行单元17停止执行所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差的获取及下一次的平衡调度。这样有助于及时停止上述获取步骤和平衡调度,获得最小的标准差,执行该最小的标准差对应的平衡调度。Using recursive scheduling can make the scheduling efficiency the highest, and set the recursive exit condition in the recursive scheduling, that is, if the second standard deviation of the resource utilization rate of the same type of service virtual machine in each server is greater than or equal to the next balanced scheduling The second standard deviation of the resource utilization rate of the same type of service virtual machine in each server after the current balanced scheduling is performed, or as of the next balanced scheduling, the cumulative number of times the balanced scheduling is performed exceeds the first set threshold, then the second An executing unit 17 stops executing the acquisition of the second standard deviation of the resource utilization rate of the same type of service virtual machines in each server and the next balance scheduling. This helps to stop the above acquisition steps and balance scheduling in time, obtain the minimum standard deviation, and execute the balance scheduling corresponding to the minimum standard deviation.
请参阅图6,为本发明实施例提供的另一种分布式资源调度装置的结构示意图。该装置2000包括:Please refer to FIG. 6 , which is a schematic structural diagram of another distributed resource scheduling device provided by an embodiment of the present invention. The device 2000 includes:
第五获取单元21,用于根据分布式集群系统中各服务器内各类业务虚拟机占所述各服务器的资源的比例和所述各服务器内各类业务虚拟机的资源使用率,获取所述各服务器的资源使用率。The fifth acquiring unit 21 is configured to acquire the resource utilization ratio of various types of business virtual machines in each server in the distributed cluster system according to the ratio of various types of business virtual machines in each server to the resources of each server and the resource utilization rate of each type of business virtual machines in each server. The resource usage of each server.
分布式集群系统中各服务器内有一种或多种类型的业务虚拟机,例如,有桌面云虚拟机和编译云虚拟机,DRS给集群内每个服务器分配有一定的运算、存储和输入/输出资源,各个服务器又其将其获得的资源按照一定的比例分配给其内部的各类型的业务虚拟机。保证各服务器内不同类型业务虚拟机的资源的总量和比例保持稳定,即可保证各服务器内各类业务虚拟机的服务质量。Each server in the distributed cluster system has one or more types of business virtual machines, for example, there are desktop cloud virtual machines and compilation cloud virtual machines, and DRS allocates certain computing, storage, and input/output to each server in the cluster resources, and each server allocates the resources it obtains to various types of business virtual machines inside it according to a certain ratio. Ensuring that the total amount and ratio of resources of different types of business virtual machines in each server remain stable can ensure the service quality of various types of business virtual machines in each server.
例如,集群内有三个服务器,服务器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. Server 1 has 2 desktop cloud virtual machines and 2 compiled cloud virtual machines. Server 2 has 3 desktop cloud virtual machines and 2 compiled cloud virtual machines. Server 3 has desktop cloud. 1 virtual machine, 2 compiled cloud virtual machines, DRS allocates certain CPU, memory and I/O resources to servers 1, 2, and 3 in the cluster, and each server allocates certain CPU to each internal virtual machine , memory and I/O resources, taking CPU resource allocation as an example, DRS allocates CPU resources of quantity A to server 1, allocates CPU resources of quantity B to server 2, and allocates CPU resources of quantity C to server 3, and server 1 Allocate the CPU resources of A1, A2, A3 and A4 to the 2 desktop cloud virtual machines and 2 compiled cloud virtual machines respectively, and the resource utilization rates of the 2 desktop cloud virtual machines in server 1 are 30% and 40% respectively. %, the resource utilization rates of the two compiled cloud virtual machines in server 1 are 40% and 50% respectively, then the CPU resource utilization rate of 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 various virtual machines in server 1 in the same way, and then calculate the CPU, memory and I/O resource usage of server 1 The resource usage of I/O is weighted and calculated to obtain the resource usage of server 1, and so on for servers 2 and 3.
第六获取单元22,用于根据所述各服务器的资源使用率,通过预定的获取方式获取所述分布式集群系统的资源使用率的第三标准差,所述获取步骤为:根据所述各服务器的资源使用率获取所述分布式集群系统的平均资源使用率,并根据所述各服务器的资源使用率以及所述分布式集群系统的平均资源使用率,获取所述分布式集群系统的资源使用率的第三标准差。The sixth acquisition unit 22 is configured to acquire the third standard deviation of the resource utilization rate of the distributed cluster system through a predetermined acquisition method according to the resource utilization rate of each server, and the acquisition step is: according to the resource utilization rate of each server Obtain the average resource utilization rate of the distributed cluster system according to the resource utilization rate of the server, and obtain the resources of the distributed cluster system according to the resource utilization rate of each server and the average resource utilization rate of the distributed cluster system. The third standard deviation of utilization.
与前述实施例不同的是,由于针对的是各服务器内各类业务虚拟机,所以,按照前述实施例相同的方式获取各服务器的资源使用率以及整个分布式集群系统的平均资源使用率,然后,第六获取单元22再按照公式(1)获取分布式集群系统的资源使用率的标准差。The difference from the foregoing embodiments is that since it is aimed at various types of business virtual machines in each server, the resource utilization rate of each server and the average resource utilization rate of the entire distributed cluster system are obtained in the same manner as the foregoing embodiments, and then , the sixth obtaining unit 22 obtains the standard deviation of the resource utilization rate of the distributed cluster system according to the formula (1).
第二调度单元23,用于当所述分布式集群系统的资源使用率的第三标准差大于或等于所述分布式集群系统的资源使用率的调度阈值时,将所述各服务器内任一业务虚拟机平衡调度至所述分布式集群系统的其他服务器中。The second scheduling unit 23 is configured to schedule any The service virtual machines are balanced and dispatched to other servers in the distributed cluster system.
将获取的分布式集群系统的资源使用率的标准差与该分布式集群系统的资源使用率的调度阈值进行比较,如果该分布式集群系统的资源使用率的标准差大于或等于该分布式集群系统的资源使用率的调度阈值,则第二调度单元23触发平衡调度。平衡调度的对象可以是各服务器内任一业务虚拟机。Compare the obtained standard deviation of the resource utilization rate of the distributed cluster system with the scheduling threshold of the resource utilization rate of the distributed cluster system, if the standard deviation of the resource utilization rate of the distributed cluster system is greater than or equal to the distributed cluster system If the scheduling threshold of the resource usage of the system is exceeded, the second scheduling unit 23 triggers balanced scheduling. The object of balanced scheduling can be any service virtual machine in each server.
第七获取单元24,用于获取平衡调度后分布式集群系统中各服务器的资源使用率。The seventh obtaining unit 24 is configured to obtain the resource utilization rate of each server in the distributed cluster system after balanced scheduling.
第八获取单元25,用于根据所述平衡调度后分布式集群系统中各服务器的资源使用率,通过所述预定的获取方式获取所述平衡调度后分布式集群系统的资源使用率的第四标准差。The eighth acquisition unit 25 is configured to acquire the fourth value of the resource utilization rate of the distributed cluster system after balanced scheduling through the predetermined acquisition method according to the resource utilization rate of each server in the distributed cluster system after balanced scheduling. standard deviation.
第二比较单元26,用于比较至少一次所述平衡调度后获取的所述第四标准差;The second comparison unit 26 is configured to compare the fourth standard deviation obtained after at least one balance scheduling;
第二执行单元27,用于执行最小的所述第四标准差对应的所述平衡调度。The second executing unit 27 is configured to execute the balanced scheduling corresponding to the smallest fourth standard deviation.
第七获取单元24、第八获取单元25、第二比较单元26、第二执行单元27的功能分别与前述实施例的第三获取单元14、第四获取单元15、第一比较单元16、第一执行单元17的功能类似,在此不再赘述,所不同的是,针对的是各服务器内各类业务虚拟机,获取的是该分布式集群系统的资源使用率的标准差。The functions of the seventh acquisition unit 24, the eighth acquisition unit 25, the second comparison unit 26, and the second execution unit 27 are respectively the same as those of the third acquisition unit 14, the fourth acquisition unit 15, the first comparison unit 16, the second execution unit 27 of the foregoing embodiment. The function of an execution unit 17 is similar, and will not be repeated here. The difference is that it is aimed at various types of business virtual machines in each server, and obtains the standard deviation of the resource utilization rate of the distributed cluster system.
可见,根据本发明实施例提供的一种分布式资源调度装置,通过按照各服务器内各类业务虚拟机占所在服务器的资源比例进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that according to the distributed resource scheduling device provided by the embodiment of the present invention, by performing distributed resource scheduling according to the resource ratio of various business virtual machines in each server to the server where it is located, the service of each business virtual machine in each server can be guaranteed. quality.
作为一种可行的实施方式,第二执行单元27还用于若进行下一次平衡调度后所述分布式集群系统的资源使用率的第四标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第四标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则停止执行所述平衡调度后分布式集群系统的资源使用率的获取及下一次的平衡调度。As a feasible implementation manner, the second execution unit 27 is also configured to if the fourth standard deviation of the resource utilization rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the distributed cluster system after the current balanced scheduling. The fourth standard deviation of the resource utilization rate of the cluster system, or as of the next balanced scheduling, the cumulative number of times the balanced scheduling is performed exceeds the first set threshold, or the service virtual machine is balanced from any first server to After any second server, the change of the total amount of all kinds of business virtual machines in the any first server or the any second server is greater than the second set threshold, and/or the any first server Or if the change in the resources of any of the first servers occupied by various types of business virtual machines in any of the second servers is greater than the third set threshold, stop executing the resource utilization rate of the distributed cluster system after the balanced scheduling acquisition and the next balance scheduling.
采用递归调度可使得调度效率最高,在递归调度中设置递归退出的条件,即若进行下一次平衡调度后所述分布式集群系统的资源使用率的第四标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第四标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则第二执行单元27停止执行所述平衡调度后分布式集群系统的资源使用率的获取及下一次的平衡调度。这样有助于及时停止上述获取步骤和平衡调度,获得最小的标准差,执行该最小的标准差对应的平衡调度。Using recursive scheduling can make the scheduling efficiency the highest, and set the recursive exit condition in the recursive scheduling, that is, if the fourth standard deviation of the resource utilization rate of the distributed cluster system after the next balanced scheduling is greater than or equal to the current balanced scheduling The fourth standard deviation of the resource utilization rate of the distributed cluster system, or as of the next balanced scheduling, the cumulative number of times the balanced scheduling is performed exceeds the first set threshold, or the service virtual machine is switched from any first After the server is balanced and dispatched to any second server, the change of the total amount of various business virtual machines in the any first server or the any second server is greater than the second set threshold, and/or the any If the change in resources occupied by various types of service virtual machines in the first server or any second server is greater than the third set threshold, the second execution unit 27 stops executing the balanced scheduling Acquisition of the resource utilization rate of the post-distributed cluster system and the next balanced scheduling. This helps to stop the above acquisition steps and balance scheduling in time, obtain the minimum standard deviation, and execute the balance scheduling corresponding to the minimum standard deviation.
请参阅图7,为本发明实施例提供的一种分布式资源调度设备的结构示意图,本实施例的设备3000包括处理器31、存储器32、输入设备33、输出设备34以及总线系统35,其中:Please refer to FIG. 7, which is a schematic structural diagram of a distributed resource scheduling device provided by an embodiment of the present invention. The device 3000 of this embodiment includes a processor 31, a memory 32, an input device 33, an output device 34, and a bus system 35, wherein :
处理器31控制设备3000的操作,处理器31还可以称为中央处理单元(CentralProcessing Unit,CPU)。处理器31可能是一种集成电路芯片,具有信号的处理能力。处理器31还可以是通用处理器、数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 31 controls operations of the device 3000, and the processor 31 may also be called a central processing unit (Central Processing Unit, CPU). The processor 31 may be an integrated circuit chip with signal processing capabilities. The processor 31 may also be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
存储器32可以包括只读存储器和随机存取存储器,并向处理器31提供指令和数据。存储器32的一部分还可以包括非易失性随机存取存储器(NVRAM)。The memory 32 may include read-only memory and random-access memory, and provides instructions and data to the processor 31 . A portion of memory 32 may also include non-volatile random access memory (NVRAM).
设备3000的各个组件通过总线系统35耦合在一起,该总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral ComponentInterconnect,PCI)总线或扩展工业标准体系结构(Extended Industry StandardArchitecture,EISA)总线等。所述总线可以是一条或多条物理线路,当是多条物理线路时可以分为地址总线、数据总线、控制总线等。在本发明的其它一些实施例中,处理器31、存储器32以及输入设备33、输出设备34也可以通过通信线路直接连接。The various components of the device 3000 are coupled together through a bus system 35, which may be an Industry Standard Architecture (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 can be one or more physical lines, and when there are multiple physical lines, it can be divided into an address bus, a data bus, a control bus, and the like. In some other embodiments of the present invention, the processor 31, the memory 32, the input device 33, and the output device 34 may also be directly connected through communication lines.
输入设备33可以具体实现为鼠标、键盘、麦克风等,而输出设备34可以具体实现为显示器、音频设备、视频设备。当然,输入设备33和输出设备34也可以通过一个输入输出设备来实现其功能,比如实现为可触摸的屏幕。The input device 33 can be embodied as a mouse, keyboard, microphone, etc., and the output device 34 can be embodied as a display, an audio device, and a video device. Of course, the input device 33 and the output device 34 can also realize their functions through an input and output device, such as a touch screen.
其中,处理器31读取存储器32中的计算机程序用以执行以下步骤:Wherein, the processor 31 reads the computer program in the memory 32 to perform the following steps:
获取分布式集群系统中各服务器内的同一类型业务虚拟机的资源使用率;Obtain the resource utilization rate of the same type of business virtual machines in each server in the distributed cluster system;
根据所述各服务器内的同一类型业务虚拟机的资源使用率,通过预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差,所述获取步骤为:根据所述各服务器内的同一类型业务虚拟机的资源使用率获取所述各服务器内的同一类型业务虚拟机的平均资源使用率,并根据所述各服务器内的同一类型业务虚拟机的资源使用率以及所述平均资源使用率,获取所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差;According to the resource utilization rate of the same type of service virtual machine in each server, the first standard deviation of the resource utilization rate of the same type of service virtual machine in each server is obtained through a predetermined acquisition step, and the acquisition step is: Obtain the average resource usage rate of the same type of service virtual machines in each server according to the resource usage rate of the same type of service virtual machines in each server, and obtain the resource usage rate of the same type of service virtual machines in each server rate and the average resource usage rate, and obtain the first standard deviation of the resource usage rates of the same type of service virtual machines in each server;
当所述各服务器内的同一类型业务虚拟机的资源使用率的第一标准差大于或等于所述各服务器内的同一类型业务虚拟机的资源使用率的调度阈值时,将所述分布式集群系统中任一服务器的所述同一类型业务虚拟机平衡调度至分布式集群系统的其他服务器中;When the first standard deviation of the resource usage rates of the same type of service virtual machines in each server is greater than or equal to the scheduling threshold of the resource usage rate of the same type of service virtual machines in each server, the distributed cluster The same type of business virtual machine of any server in the system is balancedly dispatched to other servers in the distributed cluster system;
获取平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率;Obtain the resource utilization rate of the same type of business virtual machines in each server in the distributed cluster system after balanced scheduling;
根据所述平衡调度后分布式集群系统中各服务器内的所述同一类型业务虚拟机的资源使用率,通过所述预定的获取步骤获取所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差;According to the resource utilization rate of the same type of service virtual machine in each server in the distributed cluster system after the balanced scheduling, obtain the resource utilization rate of the same type of service virtual machine in each server through the predetermined acquisition step the second standard deviation of
比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度。Comparing the second standard deviation obtained after the balanced scheduling at least once, and executing the balanced scheduling corresponding to the smallest second standard deviation.
作为一种可行的实施方式,处理器31在执行所述比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度的步骤之前,还执行如下步骤:As a feasible implementation manner, before the processor 31 performs the step of comparing the second standard deviation acquired after the balanced scheduling at least once, and performing the step of the balanced scheduling corresponding to the smallest second standard deviation , also perform the following steps:
若进行下一次平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差大于或等于进行当前平衡调度后所述各服务器内的同一类型业务虚拟机的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,则停止执行所述获取步骤及下一次的平衡调度。If the second standard deviation of the resource utilization 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 utilization rate of the same type of service virtual machine in each server after the current balanced scheduling The second standard deviation of the second standard deviation, or as of the next balance scheduling, if the cumulative number of balanced scheduling exceeds the first set threshold, the acquisition step and the next balanced scheduling will be stopped.
本发明实施例提供的处理器31中包含的计算机程序还可以实现为第一获取单元、第二获取单元、第一调度单元、第三获取单元、第四获取单元、第一比较单元和第一执行单元,这些单元实现的功能可以参考前述实施例所述,在此不再赘述。The computer program contained in the processor 31 provided by the embodiment of the present invention can also be implemented as a first acquisition unit, a second acquisition unit, a first scheduling unit, a third acquisition unit, a fourth acquisition unit, a first comparison unit and a first For the execution unit, the functions implemented by these units can be referred to the foregoing embodiments, and will not be repeated here.
可见,根据本发明实施例提供的一种分布式资源调度设备,通过按照分布式集群系统中各服务器内业务虚拟机的类型进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that, according to a distributed resource scheduling device provided by an embodiment of the present invention, by performing distributed resource scheduling according to the types of service virtual machines in each server in a distributed cluster system, the service quality of each service virtual machine in each server can be guaranteed. .
请参阅图8,为本发明实施例提供的另一种分布式资源调度设备的结构示意图,本实施例的设备4000包括处理器41、存储器42、输入设备43、输出设备44以及总线系统45,其中:Please refer to FIG. 8, which is a schematic structural diagram of another distributed resource scheduling device provided by an embodiment of the present invention. The device 4000 of this embodiment includes a processor 41, a memory 42, an input device 43, an output device 44, and a bus system 45. in:
处理器41控制设备4000的操作,处理器41还可以称为中央处理单元(CentralProcessing Unit,CPU)。处理器41可能是一种集成电路芯片,具有信号的处理能力。处理器41还可以是通用处理器、数字信号处理器(Digital Signal Processing,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The processor 41 controls operations of the device 4000, and the processor 41 may also be referred to as a central processing unit (Central Processing Unit, CPU). The processor 41 may be an integrated circuit chip with signal processing capability. The processor 41 can also be a general-purpose processor, a digital signal processor (Digital Signal Processing, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor, or the processor may be any conventional processor, or the like.
存储器42可以包括只读存储器和随机存取存储器,并向处理器41提供指令和数据。存储器42的一部分还可以包括非易失性随机存取存储器(NVRAM)。The memory 42 may include read-only memory and random-access memory, and provides instructions and data to the processor 41 . A portion of memory 42 may also include non-volatile random access memory (NVRAM).
设备4000的各个组件通过总线系统45耦合在一起,该总线可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral ComponentInterconnect,PCI)总线或扩展工业标准体系结构(Extended Industry StandardArchitecture,EISA)总线等。所述总线可以是一条或多条物理线路,当是多条物理线路时可以分为地址总线、数据总线、控制总线等。在本发明的其它一些实施例中,处理器41、存储器42以及输入设备43、输出设备44也可以通过通信线路直接连接。The various components of the device 4000 are coupled together through a bus system 45, which may be an Industry Standard Architecture (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 can be one or more physical lines, and when there are multiple physical lines, it can be divided into an address bus, a data bus, a control bus, and the like. In some other embodiments of the present invention, the processor 41, the memory 42, the input device 43, and the output device 44 may also be directly connected through communication lines.
输入设备43可以具体实现为鼠标、键盘、麦克风等,而输出设备44可以具体实现为显示器、音频设备、视频设备。当然,输入设备43和输出设备44也可以通过一个输入输出设备来实现其功能,比如实现为可触摸的屏幕。The input device 43 can be embodied as a mouse, a keyboard, a microphone, etc., and the output device 44 can be embodied as a display, an audio device, and a video device. Of course, the input device 43 and the output device 44 can also realize their functions through an input and output device, such as a touch screen.
其中,处理器41读取存储器42中的计算机程序用以执行以下步骤:Wherein, the processor 41 reads the computer program in the memory 42 to perform the following steps:
根据分布式集群系统中各服务器内各类业务虚拟机占所述各服务器的资源的比例和所述各服务器内各类业务虚拟机的资源使用率,获取所述各服务器的资源使用率;According to the proportion of various service virtual machines in each server in the distributed cluster system to the resources of each server and the resource utilization rate of various service virtual machines in each server, the resource utilization rate of each server is obtained;
根据所述各服务器的资源使用率,通过预定的获取步骤获取所述分布式集群系统的资源使用率的第一标准差,所述获取步骤为:根据所述各服务器的资源使用率获取所述分布式集群系统的平均资源使用率,并根据所述各服务器的资源使用率以及所述分布式集群系统的平均资源使用率,获取所述分布式集群系统的资源使用率的第一标准差;According to the resource utilization rate of each server, the first standard deviation of the resource utilization rate of the distributed cluster system is acquired through a predetermined acquisition step, and the acquisition step is: acquiring the resource utilization rate of each server according to the the average resource utilization rate of the distributed cluster system, and obtain the first standard deviation of the resource utilization rate of the distributed cluster system according to the resource utilization rate of each server and the average resource utilization 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, any service virtual machine in each server is balancedly scheduled to the In other servers of the distributed cluster system;
获取平衡调度后分布式集群系统中各服务器的资源使用率;Obtain the resource utilization rate of each server in the distributed cluster system after balanced scheduling;
根据所述平衡调度后分布式集群系统中各服务器的资源使用率,通过所述预定的获取步骤获取所述平衡调度后分布式集群系统的资源使用率的第二标准差;According to the resource usage rate of each server in the distributed cluster system after the balanced scheduling, the second standard deviation of the resource usage rate of the distributed cluster system after the balanced scheduling is obtained through the predetermined acquisition step;
比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度。Comparing the second standard deviation obtained after the balanced scheduling at least once, and executing the balanced scheduling corresponding to the smallest second standard deviation.
作为一种可行的实施方式,处理器41在所述比较至少一次所述平衡调度后获取的所述第二标准差,执行最小的所述第二标准差对应的所述平衡调度的步骤之前,还执行如下步骤:As a feasible implementation manner, before the processor 41 compares the second standard deviation acquired after the balanced scheduling at least once, and executes the step of the balanced scheduling corresponding to the smallest second standard deviation, Also perform the following steps:
若进行下一次平衡调度后所述分布式集群系统的资源使用率的第二标准差大于或等于进行当前平衡调度后所述分布式集群系统的资源使用率的第二标准差,或截止下一次平衡调度,进行所述平衡调度的累计次数超过第一设定阈值,或将所述业务虚拟机从任一第一服务器平衡调度至任一第二服务器后,所述任一第一服务器或所述任一第二服务器中各类业务虚拟机的总量的变化大于第二设定阈值,和/或所述任一第一服务器或所述任一第二服务器中各类业务虚拟机占所述任一第一服务器的资源的的变化大于第三设定阈值,则停止执行所述获取步骤及下一次的平衡调度。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 balanced scheduling, or until the next time Balanced scheduling, the cumulative number of times the balanced scheduling is performed exceeds the first set threshold, or after the service virtual machine is balancedly scheduled from any first server to any second server, any one of the first servers or all The change of the total amount of various types of business virtual machines in any second server is greater than the second set threshold, and/or the proportion of various types of business virtual machines in any one of the first servers or the second server is If the resource change of any one of the first servers is greater than the third set threshold, the execution of the acquisition step and the next balance scheduling will be stopped.
本发明实施例提供的处理器41中包含的计算机程序还可以实现为第五获取单元、第六获取单元、第二调度单元、第七获取单元、第八获取单元、第二比较单元和第二执行单元,这些单元实现的功能可以参考前述实施例所述,在此不再赘述。The computer program included in the processor 41 provided by the embodiment of the present invention can also be implemented as a fifth acquisition unit, a sixth acquisition unit, a second scheduling unit, a seventh acquisition unit, an eighth acquisition unit, a second comparison unit, and a second For the execution unit, the functions implemented by these units can be referred to the foregoing embodiments, and will not be repeated here.
可见,根据本发明实施例提供的一种分布式资源调度设备,通过按照各服务器内各类业务虚拟机占所在服务器的资源比例进行分布式资源调度,可以保证各服务器内各业务虚拟机的服务质量。It can be seen that according to the distributed resource scheduling device provided by the embodiment of the present invention, by performing distributed resource scheduling according to the resource ratio of various business virtual machines in each server to the server where it is located, the service of each business virtual machine in each server can be guaranteed. quality.
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为根据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。It should be noted that for the foregoing method embodiments, for the sake of simple description, they are expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence. Because according to the present invention, certain steps may be performed in other order or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
在上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。In the foregoing embodiments, the descriptions of each embodiment have their own emphases, and for parts not described in detail in a certain embodiment, reference may be made to relevant descriptions of other embodiments.
通过以上的实施方式的描述,所属领域的技术人员可以清楚地了解到本发明可以用硬件实现,或固件实现,或它们的组合方式来实现。当使用软件实现时,可以将上述功能存储在计算机可读介质中或作为计算机可读介质上的一个或多个指令或代码进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是计算机能够存取的任何可用介质。以此为例但不限于:计算机可读介质可以包括随机存取存储器(Random Access Memory,RAM)、只读存储器(Read-Only Memory,ROM)、电可擦可编程只读存储器(ElectricallyErasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质。此外。任何连接可以适当的成为计算机可读介质。例如,如果软件是使用同轴电缆、光纤光缆、双绞线、数字用户线(Digital Subscriber Line,DSL)或者诸如红外线、无线电和微波之类的无线技术从网站、服务器或者其他远程源传输的,那么同轴电缆、光纤光缆、双绞线、DSL或者诸如红外线、无线和微波之类的无线技术包括在所属介质的定影中。如本发明所使用的,盘(Disk)和碟(disc)包括压缩光碟(CD)、激光碟、光碟、数字通用光碟(DVD)、软盘和蓝光光碟,其中盘通常磁性的复制数据,而碟则用激光来光学的复制数据。上面的组合也应当包括在计算机可读介质的保护范围之内。Through the above description of the implementation manners, those skilled in the art can clearly understand that the present invention can be implemented by hardware, firmware, or a combination thereof. When implemented in software, the functions described above may be stored on or transmitted over 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 place to another. A storage media may be any available media that can be accessed by a computer. Take this as an example but not limited to: computer-readable media may include Random Access Memory (Random Access Memory, RAM), Read-Only Memory (Read-Only Memory, ROM), Electrically Erasable Programmable Read-Only Memory (Electrically Erasable Programmable Read -Only Memory, EEPROM), CD-ROM (Compact Disc Read-Only Memory, CD-ROM) or other optical disk storage, magnetic disk storage medium or other magnetic storage devices, or can be used to carry or store information in the form of instructions or data structures desired program code and any other medium that can be accessed by a computer. also. Any connection can 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, Coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, wireless and microwave are then included in the fixation of the associated medium. As used herein, disk and disc include compact disc (CD), laser disc, compact disc, digital versatile disc (DVD), floppy disc, and Blu-ray disc, where a disc usually reproduces data magnetically, and a disc Lasers are used to optically reproduce the data. Combinations of the above should also be included within the scope of computer-readable media.
总之,以上所述仅为本发明技术方案的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。In a word, the above descriptions are only preferred embodiments of the technical solutions of the present invention, and are not intended to limit the protection scope of the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims (8)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310751965.XA CN103763346B (en) | 2013-12-31 | 2013-12-31 | A distributed resource scheduling method and device |
PCT/CN2014/089636 WO2015101091A1 (en) | 2013-12-31 | 2014-10-28 | Distributed resource scheduling method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310751965.XA CN103763346B (en) | 2013-12-31 | 2013-12-31 | A distributed resource scheduling method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103763346A CN103763346A (en) | 2014-04-30 |
CN103763346B true CN103763346B (en) | 2017-07-25 |
Family
ID=50530505
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310751965.XA Active CN103763346B (en) | 2013-12-31 | 2013-12-31 | A distributed resource scheduling method and device |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN103763346B (en) |
WO (1) | WO2015101091A1 (en) |
Families Citing this family (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103763346B (en) * | 2013-12-31 | 2017-07-25 | 华为技术有限公司 | A 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 |
CN113672345A (en) * | 2021-08-05 | 2021-11-19 | 浪潮云信息技术股份公司 | IO prediction-based cloud virtualization engine distributed resource scheduling method |
CN114090257B (en) * | 2021-11-24 | 2024-11-05 | 中国电信股份有限公司 | Virtual machine scheduling method, device, storage medium and equipment |
Family Cites Families (6)
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 |
CN102244685B (en) * | 2011-08-11 | 2013-09-18 | 中国科学院软件研究所 | Distributed type dynamic cache expanding method and system for supporting load balancing |
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 |
CN103763346B (en) * | 2013-12-31 | 2017-07-25 | 华为技术有限公司 | A distributed resource scheduling 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 active Application Filing
Also Published As
Publication number | Publication date |
---|---|
CN103763346A (en) | 2014-04-30 |
WO2015101091A1 (en) | 2015-07-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103763346B (en) | A distributed resource scheduling method and device | |
US11558244B2 (en) | Improving performance of multi-processor computer systems | |
US11966792B2 (en) | Resource processing method of cloud platform, related device, and storage medium | |
CN109729106B (en) | Method, system and computer program product for processing computing tasks | |
US20140115603A1 (en) | Method, apparatus, and system for scheduling processor core in multiprocessor core system | |
CN110362402B (en) | Load balancing method, device, equipment and readable storage medium | |
WO2017166643A1 (en) | Method and device for quantifying task resources | |
CN110399213A (en) | Method, apparatus, electronic device and medium for determining resource requirements of an application | |
WO2018049873A1 (en) | Application scheduling method and device | |
CN109960575B (en) | Computing power sharing method, system and related equipment | |
CN111367693B (en) | Method, system, device and medium for scheduling plug-in tasks based on message queue | |
CN110262977A (en) | A kind of full link performance test method, calculates equipment and storage medium at device | |
WO2019105379A1 (en) | Resource management method and apparatus, electronic device, and storage medium | |
CN110275760A (en) | Process suspending method based on virtual host processor and its related equipment | |
CN114816738A (en) | Method, Apparatus, Device and Computer-readable Storage Medium for Determining Computing Power Nodes | |
CN110336888B (en) | A server allocation method, device, system and medium | |
CN113168344A (en) | Distributed resource management by increasing cluster diversity | |
WO2023174037A1 (en) | Resource scheduling method, apparatus and system, device, medium, and program product | |
CN116360994A (en) | Scheduling method, device, server and storage medium of distributed heterogeneous resource pool | |
US20230015908A1 (en) | Virtual machine operation management in computing devices | |
CN108028806A (en) | The method and apparatus that virtual resource is distributed in network function virtualization NFV networks | |
US20140136659A1 (en) | Timeout Value Adaptation | |
WO2020000724A1 (en) | Method, electronic device and medium for processing communication load between hosts of cloud platform | |
CN115454576B (en) | Virtual machine process management method and system and electronic equipment | |
CN108279968B (en) | Method and device for scheduling virtual machine resources |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |