TW201516872A - Method of balancing physical machine resource load in cluster environment - Google Patents

Method of balancing physical machine resource load in cluster environment Download PDF

Info

Publication number
TW201516872A
TW201516872A TW102137429A TW102137429A TW201516872A TW 201516872 A TW201516872 A TW 201516872A TW 102137429 A TW102137429 A TW 102137429A TW 102137429 A TW102137429 A TW 102137429A TW 201516872 A TW201516872 A TW 201516872A
Authority
TW
Taiwan
Prior art keywords
resource
machine
physical
physical machine
virtual machine
Prior art date
Application number
TW102137429A
Other languages
Chinese (zh)
Other versions
TWI506557B (en
Inventor
Yi-Ming Chang
Original Assignee
Chunghwa Telecom Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chunghwa Telecom Co Ltd filed Critical Chunghwa Telecom Co Ltd
Priority to TW102137429A priority Critical patent/TWI506557B/en
Priority to CN201410211353.6A priority patent/CN104008011A/en
Publication of TW201516872A publication Critical patent/TW201516872A/en
Application granted granted Critical
Publication of TWI506557B publication Critical patent/TWI506557B/en

Links

Landscapes

  • Debugging And Monitoring (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a method of balancing a physical machine resource load in a cluster environment, including the steps of taking several resource usage rates of a virtual machine provided on a physical machine set in a cluster environment, and further calculating a discrete degree of the resource load of the physical machine set in a cluster environment and resource load arithmetic mean, via the usage rates of a virtual machine; and calculating a plurality of candidate virtual machines by a virtual machine removal algorithm for movement when the discrete degree of the resource load of the physical machine set in a cluster environment is higher than the discrete degree of a target load. The algorithm sets physical machine with resource load larger than the resource load arithmetic mean in a cluster environment in a group and others in another group, and selects virtual machines as movement candidates in a mode of selecting from each two physical machines with the same distance ranking with the resource load arithmetic mean to reduce the discrete degree of the resource load of the physical machine set in a cluster environment into the discrete degree of a target load after a removal.

Description

叢集環境中平衡實體機資源負載的方法 Method for balancing physical machine resource load in a cluster environment

本發明是有關於一種動態資源配置方法,特別是有關於一種叢集環境中平衡實體機資源負載的方法。 The present invention relates to a dynamic resource configuration method, and more particularly to a method for balancing a physical machine resource load in a cluster environment.

叢集(cluster)環境主要是透過虛擬化技術將位於實體機器(一般稱為Host)上的資源切分為不同等份使用。透過虛擬化可讓使用者或是應用程式輕易取得所需要的計算資源,不受限於初始安裝的方式、地區、位置,或實體的組合。虛擬化技術允許用戶在一台實體機上運行多個作業系統,虛擬化技術運作是透過虛擬機器管理層(Hypervisor)(或一般稱為虛擬機器監控器(virtual machine monitor,VMM))將虛擬機(Virtual Machine)與實體機硬體分開,在一個實體機中,包括處理器、記憶體、儲存設備、網路I/O等資源,在其之上分割出幾個虛擬機,每一台虛擬機依據其應用的需求,分配所需的硬體資源,虛擬機與硬體中間由虛擬機器管理層負責溝通,虛擬機器管理層負責將虛擬機的指令傳送至所需的硬體資源執行運作,並將運作的結果傳送回虛擬機,每一個虛擬機是互相獨立的,彼此並不知道互相在分享硬體的資源。換言之,虛擬化技術提供對於資料、計算能力、儲存容量及其他資源一個邏輯的分類,而不是一個實體界限。 The cluster environment is mainly used to divide the resources on the physical machine (generally called Host) into different equal parts through virtualization technology. Virtualization allows users or applications to easily obtain the computing resources they need without being limited to the initial installation, location, location, or combination of entities. Virtualization technology allows users to run multiple operating systems on a single physical machine. Virtualization technology operates through virtual machine management (hypervisor) (or generally referred to as virtual machine monitor (VMM)). (Virtual Machine) is separated from the physical machine hardware. In a physical machine, including processors, memory, storage devices, network I/O and other resources, several virtual machines are split on it, each virtual The machine allocates the required hardware resources according to the requirements of its application. The virtual machine management layer is responsible for communication between the virtual machine and the hardware. The virtual machine management layer is responsible for transmitting the instructions of the virtual machine to the required hardware resources for execution. The results of the operation are transmitted back to the virtual machine. Each virtual machine is independent of each other and does not know each other to share hardware resources. In other words, virtualization technology provides a logical classification of data, computing power, storage capacity, and other resources, rather than a physical boundary.

叢集系統是由多數個實體機所組成,為妥善利用實體機資源,各實體機再將資源分配給數個虛擬機使用以提高資源使用率。虛擬機對資源的需求起伏不定,因而各實體機上的資源使用率差異大,虛擬化技術讓虛擬機器管理層提供過量使用(overcommit)的功能,虛擬機的資源使用率無法藉由觀測得知,為提升伺服器可靠度以及服務效率,避免硬體負擔過高造成服務中斷,實體機之間的資源必須啟動負載平衡機制,將一台虛擬機從一台資源緊張的實體機移至另一台有剩餘資源的實體機。本發明的 目的提供一種在叢集環境下動態資源配置的方法,藉由獲取各實體機上裝置的虛擬機資源使用歷史資料作為資源排程之基礎,以達到實體機資源負載平衡之設計方法。 The cluster system is composed of a plurality of physical machines. In order to properly utilize the physical machine resources, each physical machine allocates resources to several virtual machines to improve resource utilization. The virtual machine's demand for resources fluctuates, so the resource usage rate on each physical machine is very different. The virtualization technology allows the virtual machine management layer to provide overcommit function. The virtual machine resource usage cannot be observed by observation. In order to improve the reliability of the server and the service efficiency, and avoid the service interruption caused by the excessive hardware load, the resources between the physical machines must start the load balancing mechanism to move one virtual machine from one physical machine with tight resources to another. A physical machine with remaining resources. The invention Objective To provide a method for dynamic resource allocation in a cluster environment, by obtaining virtual machine resource usage history data of devices on each physical machine as a basis for resource scheduling, so as to achieve a design method of physical machine resource load balancing.

為達上述先前技術中所稱之目的,本發明所設計之叢集環境 中平衡實體機資源負載的方法包括有以下步驟:有一虛擬化資源管控系統透過虛擬機器管理層監視複數個虛擬機並以本發明設計的資源表示式計算及表達該些虛擬機之資源使用率指標,並且在做負載平衡時預先載入虛擬機限制式、預設的離散程度臨界值偏好伺服器設定等各式在叢集內運算時因應不同狀況需要考慮的設定。 The cluster environment designed by the present invention for the purposes stated in the prior art above The method for balancing the load of the physical machine resource includes the following steps: a virtualized resource management system monitors a plurality of virtual machines through the virtual machine management layer and calculates and expresses resource utilization indicators of the virtual machines according to the resource representation designed by the present invention. And when load balancing is performed, the settings of the virtual machine limit type, the preset discreteness threshold value preference server setting, and the like, which are required to be considered in different situations in the cluster operation, are required.

更進一步,依據本發明之目的,所提出之一種叢集環境中平 衡實體機資源負載的方法,其流程步驟包含:A、匯入叢集資源臨界值及虛擬機配置互斥與群組設定條件;B、擷取一段時間所收集到各虛擬機歷史之資源使用量;C、根據實體機中所有虛擬機的資源使用量合以計算出實體機實際的資源使用率,再藉由計算所有實體機的資源使用率進一步求得叢集環境下之標準差值,以判斷各實體機之間負載平衡狀態及離散程度;D、判斷所求得之標準差值是否大於叢集資源臨界值,若是,則進行實體機之挑選,以挑選出至少一對實體機,並在所挑選配對之二台實體機上挑選虛擬機進行模擬搬移動作,以改善實體機資源使用率之標準差值,其中,所配對之實體機中的其中一個實體機的資源使用率係大於另一個實體機;E、計算模擬搬移虛擬機後,判斷實體機資源使用率之標準差值是否仍高於叢集資源臨界值,若是,則重覆執行步驟D以及E,若否,則執行步驟F;以及F、進行虛擬機之搬移動作,以互相搬遷所挑選配對之二台實體機中之虛擬機。 Further, in accordance with the purpose of the present invention, the proposed cluster environment is flat The method for balancing the load of the physical machine resource includes: A, the threshold value of the incoming cluster resource, the virtual machine configuration mutual exclusion and the group setting condition; B, the resource usage collected by each virtual machine history for a period of time C. Calculate the actual resource usage rate of the physical machine based on the resource usage of all the virtual machines in the physical machine, and further calculate the standard difference in the cluster environment by calculating the resource usage rate of all the physical machines to determine The load balancing state and the degree of dispersion between the physical machines; D, judging whether the standard deviation obtained is greater than the cluster resource threshold, and if so, selecting the physical machine to select at least one pair of physical machines, and Selecting a pair of physical machines to select a virtual machine for simulated mobile work to improve the standard deviation of the physical device resource usage, wherein one of the paired physical machines has a resource usage greater than another entity. E; Calculate the simulated moving virtual machine, determine whether the standard deviation of the physical machine resource usage rate is still higher than the cluster resource threshold, and if so, then Step D, and E, if not, step F; and F., Perform the move operation of the virtual machine, to move the two sets of each pair of the physical machine in the virtual machine selection.

較佳地,離散程度係為下列數學式所計算表示: 其中,表示一台編號j實體機的資源使用率;X i,j 表 示一台編號i虛擬機是否有在此編號j的實體機上啟動,有的話其值為1,沒有啟用的話其值為0;為此虛擬機i使用的資源能力;表示叢集內m台實體機的資源使用率之算數平均值;σ為由以上數值求得之標準差值,用以表達此叢集內資源負載的離散程度。 Preferably, the degree of dispersion is calculated by the following mathematical formula: among them, Indicates the resource usage rate of a numbered j entity; X i,j indicates whether a number i virtual machine is started on the physical machine of this number j, if it has a value of 1, if it is not enabled, its value is 0. ; The resource capabilities used by this virtual machine i; The arithmetic mean of the resource usage of the m physical machines in the cluster; σ is the standard deviation obtained from the above values to express the degree of dispersion of the resource load in the cluster.

較佳地,上述步驟D中更包含下列步驟:計算各實體機的 資源使用率與算數平均值之差值D j ;以及依據所計算之差值D j 將叢集內資源緊張的實體機歸類為一組,其它的實體機歸為另一組,並將二組之實體機依照差值D j 的大小進行排名,以將兩組間相同排名或某一特定排名的實體機挑選為互相搬遷虛擬機的對象,進而篩選至少一對配對之實體機,其中,相配對之其一為來源實體機,另一為目標實體機。 Preferably, the step D further includes the following steps: calculating resource usage of each physical machine Average with arithmetic The difference D j ; and the physical machine with tight resources in the cluster are classified into one group according to the calculated difference value D j , the other physical machines are classified into another group, and the physical machines of the two groups are classified according to the difference D The size of j is ranked to select the same ranking or a specific ranked physical machine between the two groups as the object of relocating the virtual machine, and then screening at least one pair of paired physical machines, wherein one of the paired is the source entity Machine, the other is the target physical machine.

較佳地,上述實體機之差值D j 大於零時係歸類於叢集內資源 緊張之組別,差值D j 小於零之實體機則歸於另一組。 Preferably, when the difference D j of the above-mentioned physical machine is greater than zero, it is classified into a group of resource shortages in the cluster, and the physical machine whose difference D j is less than zero belongs to another group.

較佳地,上述步驟D更包含下列步驟:於來源實體機與目 標實體機挑選出來後,計算出來源實體機與目標實體機之使用資源與均值的差距,其中,此差距U為差值D乘以實體機目標資源的總能力R之數值;以及於來源實體機中挑選出一個虛擬機,此虛擬機所耗的資源需大於來源實體機之使用資源與均值的差距,且差距係小於依目標資源預先定義的一 個數值。 Preferably, the above step D further comprises the following steps: After the standard physical machine is selected, the difference between the used resource and the mean value of the source physical machine and the target physical machine is calculated, wherein the difference U is the value of the difference D multiplied by the total capacity R of the physical machine target resource; and the source entity A virtual machine is selected in the machine. The virtual machine consumes more resources than the source physical machine and the mean value, and the difference is smaller than the predefined one according to the target resource. Values.

較佳地,上述步驟D更包含下列步驟:依據來源實體機與 目標實體機之使用資源與均值的差距U s U t ,計算出資源負載量中數Thd;以及若於來源實體機中無法挑選出符合之虛擬機時,則於來源實體機中挑選一個虛擬機並於目標實體機中挑選出一個虛擬機,並將來源實體機所選之虛擬機搬移至目標實體機,將目標實體機所選之虛擬機搬移至來源實體機,以使得搬移後二個虛擬機的資源能力Vresource的差得以位在|Ut|以及|Us|之間而且最接近Thd值。 Preferably, the step D further includes the following steps: calculating the resource load median Thd according to the difference between the source resource and the target physical device and the mean value U s , U t ; and if the source physical machine cannot When selecting a virtual machine that matches the virtual machine, select a virtual machine from the source physical machine and select a virtual machine from the target physical machine, and move the virtual machine selected by the source physical machine to the target physical machine, and the target physical machine The selected virtual machine is moved to the source physical machine so that the difference between the resource capabilities V resource of the two virtual machines after moving is between | Ut | and | Us | and is closest to the Thd value.

較佳地,上述資源負載量中數Thd=(U s -U t )/2。 Preferably, the resource load amount median Thd=( U s - U t )/2.

較佳地,上述步驟D更包含下列步驟:若於來源實體機及 目標實體機中無法挑選出符合之虛擬機時,則於來源實體機中挑選出一個虛擬機,此虛擬機的資源能力Vresource需最近接近資源負載量中數Thd。 Preferably, the step D further includes the following steps: if the source entity and If the virtual machine cannot be selected in the target entity, a virtual machine is selected from the source entity. The resource capacity of the virtual machine Vresource needs to be close to the resource load median Thd.

承上所述,依本發明之,其具有下列一或多個優點: According to the invention, it has one or more of the following advantages:

1、在叢集環境下平衡實體機的資源負載,不但有彈性,在VM需要工作時亦不會隨便提出遷移的指令。 1. Balancing the resource load of a physical machine in a cluster environment is not only flexible, but also does not promptly propose a migration when the VM needs to work.

2、在叢集環境下實體機硬體相容的前提下,可以對能力不同的實體機計算出負載平衡的配置而不必侷限於先前技術只能對同硬體規格的實體機做平衡。 2. Under the premise that the physical machine hardware is compatible under the cluster environment, the load balancing configuration can be calculated for the physical machines with different capabilities without being limited to the prior art, and only the physical machine with the same hardware specifications can be balanced.

3、本發明根據實際環境的不同以及需求而動態修改參數,能有彈性的做出適合的平衡結果。 3. The invention dynamically modifies parameters according to different actual environments and requirements, and can flexibly make suitable balance results.

100‧‧‧虛擬化資源管控系統 100‧‧‧Virtual Resource Management System

200‧‧‧虛擬機器管理層 200‧‧‧Virtual Machine Management

300‧‧‧叢集 300‧‧ ‧ cluster

400、500‧‧‧實體機 400, 500‧‧‧ physical machine

S101~S106、S201~S205‧‧‧步驟 S101~S106, S201~S205‧‧‧ steps

第1圖 係為本發明之叢集環境中平衡實體機資源負載的方法所運用架構之實施例之示意圖。 1 is a schematic diagram of an embodiment of an architecture employed in a method of balancing physical machine resource loads in a cluster environment of the present invention.

第2圖 係為本發明之叢集環境中平衡實體機資源負載的方法之實施例之流程圖。 Figure 2 is a flow diagram of an embodiment of a method of balancing physical machine resource loads in a cluster environment of the present invention.

第3圖 係為第2圖中步驟S104之細部流程圖。 Fig. 3 is a detailed flow chart of step S104 in Fig. 2.

為利 貴審查員瞭解本發明之技術特徵、內容與優點及其所 能達成之功效,茲將本發明配合附圖,並以實施例之表達形式詳細說明如下,而其中所使用之圖式,其主旨僅為示意及輔助說明書之用,未必為本發明實施後之真實比例與精準配置,故不應就所附之圖式的比例與配置關係解讀、侷限本發明於實際實施上的權利範圍,合先敘明。 For the benefit of the examiner, the technical features, contents and advantages of the present invention and their The present invention will be described in detail with reference to the accompanying drawings, and the description of the embodiments of the present invention will be described in detail. True proportion and precise configuration, therefore, the scope and configuration relationship of the attached drawings should not be interpreted or limited, and the scope of rights of the present invention in actual implementation should be described first.

下列實施例是叢集運算環境中實體機之負載平衡排程方法 具有進步的資源表示式以收集虛擬機的資源使用率及進步的負載平衡排程方法以找到一至多台適當虛擬機,搬移至適當的實體機,使得實體機達到效率良好的負載平衡。 The following embodiment is a load balancing scheduling method for a physical machine in a cluster computing environment An improved resource representation is used to collect virtual machine resource usage and an advanced load balancing scheduling method to find one or more appropriate virtual machines and move to the appropriate physical machine so that the physical machine achieves efficient load balancing.

請參閱第1圖所示,為施本發明較佳實施例之一種叢集環境 中平衡實體機資源負載的方法之系統架構圖。在實施例中,有一虛擬化資源管控系統100,主要功能為統籌管理與監控機房內的各種實體設備,並利用虛擬機器管理層200的虛擬化技術將叢集300的實體機資源轉化為虛擬資源池,使用一致化、共通化的使用者介面與API,用以操作管理資源以及執行即時虛擬機遷移的工作,達成在經過計算後下達負載配置命令的功能。 Please refer to FIG. 1 for a cluster environment for applying the preferred embodiment of the present invention. A system architecture diagram of a method for balancing the load of a physical machine resource. In an embodiment, there is a virtualized resource management system 100, which mainly functions to manage and monitor various physical devices in the equipment room, and utilizes the virtualization technology of the virtual machine management layer 200 to convert the physical machine resources of the cluster 300 into virtual resource pools. Use a consistent, common user interface and API to operate management resources and perform real-time virtual machine migration to achieve the ability to release load configuration commands after calculation.

叢集300通常係由一台或多台實體機所組成,而每台實體機 皆可執行一台或多台虛擬機。為了簡化說明,以下僅由二台實體機做為舉例,其中一實體機400稱之為H1,另一實體機500稱之為H2,其中H1為具有總數十二個core的CPU,且每個core運算能力量化值為四百之伺服器主機,其上執行五台虛擬機(虛擬機2、虛擬機4、虛擬機6、虛擬機7、虛擬機10),另外一台H2為具有總數十六個core之CPU,且每個core運算能力量化值為二百之伺服器主機,其上執行五台虛擬機(虛擬機1、虛擬機3、虛擬機5、虛擬機8、虛擬機9),且此實施例中各實體機400、500所有之記憶體資源皆滿足同時執行此實施例中10台虛擬機於同一台實體機之記憶體需求。其中虛擬機已使用的CPU運算能力量化值如下表1所示。其中,是指虛擬機i已使用的運算能力: Cluster 300 is usually composed of one or more physical machines, and each physical machine can execute one or more virtual machines. To simplify the description, the following is only taken as an example of two physical machines, one of which is called H1 and the other of which is called H2, where H1 is a CPU with a total of twelve cores, and each The core computing power is quantized to four hundred server hosts, on which five virtual machines (virtual machine 2, virtual machine 4, virtual machine 6, virtual machine 7, virtual machine 10) are executed, and another H2 has total Sixteen core CPUs, and each core computing power is quantized to 200 server hosts, which execute five virtual machines (virtual machine 1, virtual machine 3, virtual machine 5, virtual machine 8, virtual machine) 9), and all the memory resources of each of the physical machines 400 and 500 in this embodiment satisfy the memory requirement of simultaneously executing the 10 virtual machines in the same physical machine in the embodiment. The quantified values of the CPU computing power that the virtual machine has used are shown in Table 1 below. among them, Refers to the computing power that virtual machine i has used:

請參閱第2圖所示,為本發明較佳實施例之一種叢集環境中 Please refer to FIG. 2, which is a cluster environment in accordance with a preferred embodiment of the present invention.

平衡實體機資源負載的方法之實施例之流程圖,其流程步驟為:步驟S101,匯入叢集資源臨界值5%及虛擬機配置互斥與群組設定等限制條件。步驟S102,接著擷取一段時間收集到各虛擬機的歷史資源使用量,資源使用率的計算由以CPU使用率為此一實施例之負載平衡考量。步驟S103,根據全部虛擬機的資源使用量合以計算實體機實際的資源使用率,藉由計算所有實體機的資源使用率進一步求得叢集環境下之標準差,以判斷各實體機之間負載平衡狀態及離散程度。其中,離散程度係以下面數學運算式來計算: 其中表示一台編號j實體機的資源使用率,在此實施 例中即為虛擬機i已使用的運算能力,X i,j 表示一台編號i虛擬機是否有在此編號j的實體機上啟動,有的話其值為1沒有啟用的話其值為0,為此虛擬機i使用的資源能力,表示叢集內m台實體機的資源使用率之算數平均值,σ為由以上數值求得之標準差用以表達此叢集內資源負載的離散程度,在此實施例中σ=15.8854%。 計算出的標準差高於初始定義的臨界值5%,因此執行步驟 S104,挑選兩台適當的實體機,挑選方法是執行以下步驟:計算每台實體機的資源使用率與平均值之差值D j ,其算式為: D j =-μ resource ;在得到每台實體機的差值之後,可以將叢集內資源緊張的實體機歸類為一組並稱之為SHs,此組實體機的特徵為:D j >0;其它的實體機則為另外一組SHt。在實體機群組SHs及SHt內依D j 大小距離排名,並將兩組內相同排名的實體機圈選為互相搬遷虛擬機的對象,或者依照不同需求只選取排名第一名的一對實體機為互相搬遷虛擬機的對象,也就是在叢集內找到一對以上的實體機以供負載平衡之用。在成對的實體機配對完成後,稱資源緊張的實體機為來源實體機Hs且稱另一實體機為目標實體機Ht,此實例中Hs為實體機500,也就是H2,Ht為實體機400,也就是H1。求出其所使用資源與均值的差距,其數學運算式表示如下:U t =D t * R t U s =D s * R s ;也就是以差值乘以此實體機目標資源的總能力,此實施例得出D1=-15.8854%;D2=15.8854%的結果,Us=508.33及Ut=-762.5;然後取得一資源負載量中數Thd,其數學運算式表示如下:Thd=(U s -U t )/2;接著在此二台實體機上挑選虛擬機進行模擬搬移動作使實體機資源使用率標準差值改善最大,也就是最接或低於近初始定義的臨界值,進而執行步驟S105,計算模擬搬移虛擬機後,實體機資源使用率之標準差值是否高於臨界值,假若高於臨界值則重覆步驟S104以及S105,否則執行步驟S106,進行由步驟S104挑選出的虛擬機之搬移動作。第3圖為步驟S104之細部流程圖。當執行步驟S104將拆解成步驟S201~S205。步驟S201為計算各部實體機目標的負載平衡之差值。步驟S202基於步驟S201計算出的結果,挑選兩個最適當的實體機Hi 與Hj,Hi的資源使用率必大於Hj的資源使用率。步驟S203為虛擬機挑選方法一,藉由在挑選虛擬機的方法上藉由在Hs上挑選一台最適當的虛擬機VM,此台VM特徵為所耗的資源大於來源實體機使用資源與均值的差距且差距小於依目標資源預先定義的一個數值,使得搬移VM後可使得整體系統的負載最為平衡。假若步驟S203無法挑選一台適當的虛擬機,則採用步驟S204虛擬機挑選方法二進行挑選。步驟S204藉由在實體機Hs和實體機Ht上各找到一台最適當的虛擬機VMi以及VMi’,使得將虛擬機VMi搬移至實體機Ht以及VMi’搬移至實體機Hs後,可使得整體系統的負載最為平衡,其特徵為搬動後的差值不但位在|Ut|以及|Us|之間而且最接近Thd值,其數學運算式表示如下: (>);假若步驟S204無法挑選到兩台適當的虛擬機,則採用步驟S205虛擬機挑選方法三進行挑選。步驟S205藉由在實體機Hj上挑選一台最適當的虛擬機VMh,使得搬移VMh後,可使得整體系統的負載最為平衡,其特徵為在Hs當中挑選資源負載使用量最接近資源負載量中數的虛擬機,其數學運算式表示如下: 由上所述之步驟可以在方法一挑選到虛擬機8為符合以上方法之適合搬遷虛擬機,然後利用虛擬機器管理層虛擬化的技術將虛擬機從H1移至H2;搬移虛擬機後叢集負載的標準差值降低到2.6042%會使全體的實體機資源負載離散程度低於搬移前15.8854%且小於臨界值5%,即停止搬移計算,並交由虛擬化資源管控系統下達遷移命令進而進行虛擬機遷移,以達到實體機資源負載平衡的目標。 A flowchart of an embodiment of a method for balancing a physical machine resource load, the process steps are: Step S101, importing a cluster resource threshold value of 5% and a virtual machine configuration mutual exclusion and group setting and other restrictions. In step S102, the historical resource usage of each virtual machine is collected for a period of time, and the resource usage rate is calculated by the CPU usage rate as a load balancing consideration of the embodiment. Step S103: Calculate the actual resource usage rate of the physical machine according to the resource usage of all the virtual machines, and further calculate the standard deviation of the cluster environment by calculating the resource usage rate of all the physical machines to determine the load between the physical machines. Balanced state and degree of dispersion. Among them, the degree of dispersion is calculated by the following mathematical expression: among them Indicates the resource usage rate of a numbered j entity machine. In this embodiment, it is the computing power that virtual machine i has used. X i,j indicates whether a number i virtual machine is started on the physical machine of this number j. , if it has a value of 1 and is not enabled, its value is 0. The resource capabilities used by this virtual machine i, The arithmetic mean of the resource usage of the m physical machines in the cluster is represented, and σ is the standard deviation obtained from the above values to express the degree of dispersion of the resource load in the cluster, in this embodiment σ=15.8854%. The calculated standard deviation is higher than the initial defined threshold of 5%. Therefore, step S104 is performed to select two suitable physical machines. The selection method is to perform the following steps: calculating the difference between the resource usage rate and the average value of each physical machine. D j , whose formula is: D j = - μ resource ; After obtaining the difference of each physical machine, the physical machines with tight resources in the cluster can be classified into a group and called SHs. The characteristics of this group of physical machines are: D j >0; others The physical machine is another set of SHt. D j ranked by magnitude of distance in the physical machine and SHt is SHs group, and two groups of the same rank within the selected target entity unit circle relocation of virtual machines with each other, or select only a pair of entities ranked first according to different needs The machine is the object of relocating virtual machines to each other, that is, finding more than one pair of physical machines in the cluster for load balancing. After the paired physical machine pairing is completed, the physical machine with the resource shortage is called the source physical machine Hs and the other physical machine is the target physical machine Ht. In this example, Hs is the physical machine 500, that is, H2, and Ht is the physical machine. 400, which is H1. Find the difference between the resource used and the mean value. The mathematical expression is expressed as follows: U t = D t * R t ; U s = D s * R s ; that is, the total value of the target resource of the physical machine is multiplied by the difference Capability, this example yields a result of D 1 = -15.8854%; D 2 = 15.854%, U s = 508.33 and U t = -762.5; then a resource load median Thd is obtained, the mathematical expression of which is expressed as follows: Thd=( U s - U t )/2; then select the virtual machine on the two physical machines to perform the simulated moving movement to maximize the standard deviation of the physical machine resource usage rate, that is, the closest or lower than the initial definition. The threshold value is further executed in step S105, and the standard deviation of the physical device resource usage rate is calculated to be higher than the critical value after the simulated moving virtual machine is simulated. If the threshold value is higher than the critical value, steps S104 and S105 are repeated, otherwise step S106 is performed, and the step is performed. The mobile machine selected by S104 is moved. Fig. 3 is a detailed flow chart of step S104. When step S104 is performed, it will be disassembled into steps S201 to S205. Step S201 is to calculate a difference in load balance of each of the physical machine targets. Step S202 selects two most suitable physical machines Hi and Hj based on the result calculated in step S201, and the resource utilization rate of Hi must be greater than the resource usage rate of Hj. Step S203 is to select method 1 for the virtual machine. By selecting a most suitable virtual machine VM on the Hs in the method of selecting the virtual machine, the VM is characterized by using more resources than the source physical machine resources and the mean value. The gap and the gap are smaller than a pre-defined value according to the target resource, so that the overall system load can be balanced after moving the VM. If the appropriate virtual machine cannot be selected in step S203, the virtual machine selection method 2 is used in step S204 for selection. Step S204, by finding one of the most suitable virtual machines VMi and VMi' on the physical machine Hs and the physical machine Ht, so that the virtual machine VMi is moved to the physical machine Ht and the VMi' is moved to the physical machine Hs, the whole can be made The load of the system is the most balanced. The characteristic is that the difference after moving is not only between | Ut | and | Us | but also closest to the Thd value. The mathematical expression is as follows: ( > If the two suitable virtual machines cannot be selected in step S204, the virtual machine selection method 3 is used in step S205 for selection. In step S205, by selecting a most suitable virtual machine VMh on the physical machine Hj, after the VMh is moved, the load of the overall system can be most balanced, and the feature is that the resource load usage in the Hs is closest to the resource load. The number of virtual machines whose mathematical expressions are expressed as follows: According to the above steps, the virtual machine 8 can be selected in the method 1 to relocate the virtual machine according to the above method, and then the virtual machine is used to virtualize the virtual machine from H1 to H2; after the virtual machine is moved, the cluster load is moved. The standard deviation is reduced to 2.6042%, which will make the whole physical machine resource load dispersion less than 15.7884% before the move and less than the critical value of 5%, that is, stop the transfer calculation, and submit the migration command to the virtual resource management system to perform the virtual operation. Machine migration to achieve the goal of load balancing of physical resources.

依上述個方法挑選到列入搬遷的虛擬機之後,利用虛擬機器 管理層虛擬化的技術將虛擬機從資源緊張的實體機移至有剩餘資源的實體機;搬移虛擬機後會使全體的實體機資源負載離散程度低於搬移前,直到滿足低於預設負載離散程度臨界值或離散程度小於搬移前即停止搬移計算,並交由虛擬化資源管控系統下達遷移命令進而進行虛擬機遷移,以達到實體機資源負載平衡的目標。 After selecting the virtual machine included in the relocation according to the above method, use the virtual machine. The technology of management virtualization moves the virtual machine from the physical machine with tight resources to the physical machine with residual resources; after moving the virtual machine, the load of the whole physical machine resource is less than that before the move, until it meets the preset load. The discreteness threshold or the degree of dispersion is smaller than the shift calculation before the move, and the virtual resource management and control system issues the migration command to perform the virtual machine migration to achieve the goal of load balancing of the physical machine resources.

綜上所述,本發明所使用的步驟可以指引叢集運算服務提供 者如何從收集的虛擬機資料之擷取有用的資料開始,再利用挑選能使實體機資源使用率標準差值低於臨界值之虛擬機,進行搬移動作,以達成叢集運算環境中實體機之負載平衡設計。 In summary, the steps used in the present invention can guide the provision of cluster computing services. How do you start with the useful data from the collected virtual machine data, and then use the virtual machine that can make the standard value of the physical device resource usage lower than the critical value to move and move to achieve the physical machine in the cluster computing environment. Load balancing design.

以上所述僅為舉例性,而非為限制性者。任何未脫離本發明 之精神與範疇,而對其進行之等效修改或變更,均應包含於後附之申請專利範圍中。 The above is intended to be illustrative only and not limiting. Any without departing from the invention The spirit and scope of the invention, and equivalent modifications or alterations thereto, shall be included in the scope of the appended patent application.

S101~S106‧‧‧步驟 S101~S106‧‧‧Steps

Claims (8)

一種叢集環境中平衡實體機資源負載的方法,其包含下列步驟:A、匯入叢集資源臨界值及虛擬機配置互斥與群組設定條件;B、擷取一段時間所收集到各虛擬機歷史之資源使用量;C、根據實體機中所有虛擬機的資源使用量合以計算出實體機實際的資源使用率,再藉由計算所有實體機的資源使用率進一步求得叢集環境下之標準差值,以判斷各實體機之間負載平衡狀態及離散程度;D、判斷所求得之標準差值是否大於叢集資源臨界值,若是,則進行實體機之挑選,以挑選出至少一對實體機,並在所挑選配對之二台實體機上挑選虛擬機進行模擬搬移動作,以改善實體機資源使用率之標準差值,其中,所配對之實體機中的其中一個實體機的資源使用率係大於另一個實體機;E、計算模擬搬移虛擬機後,判斷實體機資源使用率之標準差值是否仍高於叢集資源臨界值,若是,則重覆執行步驟D以及E,若否,則執行步驟F;以及F、進行虛擬機之搬移動作,以互相搬遷所挑選配對之二台實體機中之虛擬機。 A method for balancing a physical machine resource load in a cluster environment, comprising the following steps: A, a sink cluster resource threshold, a virtual machine configuration mutual exclusion, and a group setting condition; B, collecting a virtual machine history collected for a period of time Resource usage; C. Calculate the actual resource usage rate of the physical machine based on the resource usage of all virtual machines in the physical machine, and further calculate the standard deviation in the cluster environment by calculating the resource usage rate of all the physical machines. The value is used to determine the load balance state and the degree of dispersion between the physical machines; D. Determine whether the standard deviation obtained is greater than the cluster resource threshold, and if so, select the physical machine to select at least one pair of physical machines. And selecting a virtual machine on the two selected physical machines to perform a simulated moving operation to improve the standard deviation of the physical machine resource usage rate, wherein the resource usage rate of one of the paired physical machines is More than another physical machine; E. After calculating the simulated moving virtual machine, determine whether the standard deviation of the physical machine resource usage rate is still higher than the cluster resource. Value, if yes, repeat step D, and E, if not, step F; and F., Perform the move operation of the virtual machine to another physical machine move the two sets of pairs of the selected virtual machine. 如申請專利範圍第1項所述之叢集環境中平衡實體機資源負載的方法,其中離散程度係為下列數學式所計算表示: 其中,表示一台編號j實體機的資源使用率;X i,j 表示一台編號i虛擬機是否有在此編號j的實體機上啟動,有的話其值為1,沒有啟用的話其值為0;為此虛擬機i使用的資源能力;表示叢集內m台實體機的資源使用率之算數平均值;σ為由以上數值求得之標準差值,用以表達此叢集內資源負載的離散程度。 The method for balancing the load of a physical machine resource in a cluster environment as described in claim 1 of the patent scope, wherein the degree of dispersion is calculated by the following mathematical formula: among them, Indicates the resource usage rate of a numbered j entity; X i,j indicates whether a number i virtual machine is started on the physical machine of this number j, if it has a value of 1, if it is not enabled, its value is 0. ; The resource capabilities used by this virtual machine i; The arithmetic mean of the resource usage of the m physical machines in the cluster; σ is the standard deviation obtained from the above values to express the degree of dispersion of the resource load in the cluster. 如申請專利範圍第2項所述之叢集環境中平衡實體機資源負載的方法,其中步驟D中更包含下列步驟:計算各實體機的資源使用率與算數平均值之差值D j ;以及依據所計算之差值D j 將叢集內資源緊張的實體機歸類為一組,其它的實體機歸為另一組,並將二組之實體機依照差值D j 的大小進行排名,以將兩組間相同排名或某一特定排名的實體機挑選為互相搬遷虛擬機的對象,進而篩選至少一對配對之實體機,其中,相配對之其一為來源實體機,另一為目標實體機。 The method for balancing the load of a physical machine resource in the cluster environment described in claim 2, wherein the step D further includes the following steps: calculating the resource usage rate of each physical machine. Average with arithmetic The difference D j ; and the physical machine with tight resources in the cluster are classified into one group according to the calculated difference value D j , the other physical machines are classified into another group, and the physical machines of the two groups are classified according to the difference D The size of j is ranked to select the same ranking or a specific ranked physical machine between the two groups as the object of relocating the virtual machine, and then screening at least one pair of paired physical machines, wherein one of the paired is the source entity Machine, the other is the target physical machine. 如申請專利範圍第3項所述之叢集環境中平衡實體機資源負載的方法,其中實體機之差值D j 大於零時係歸類於叢集內資源緊張之組別,差值D j 小於零之實體機則歸於另一組。 For example, in the cluster environment described in claim 3, the method for balancing the load of the physical machine resource, wherein the difference D j of the physical machine is greater than zero is classified into a group of resource shortages in the cluster, and the difference D j is less than zero. The physical machine belongs to another group. 如申請專利範圍第3項所述之叢集環境中平衡實體機資源負載的方法,其中步驟D更包含下列步驟:於來源實體機與目標實體機挑選出來後,計算出來源實體機與目標實體機之使用資源與均值的差距,其中,此差距U為差值D乘以實體機目標資源的總能力R之數值;以及 於來源實體機中挑選出一個虛擬機,此虛擬機所耗的資源需大於來源實體機之使用資源與均值的差距,且差距係小於依目標資源預先定義的一個數值。 The method for balancing the load of a physical machine resource in the cluster environment described in claim 3, wherein the step D further comprises the following steps: after the source entity machine and the target entity machine are selected, the source entity machine and the target entity machine are calculated. The difference between the resource and the mean, where the difference U is the value of the difference D multiplied by the total capacity R of the target resource of the physical machine; A virtual machine is selected from the source entity machine, and the virtual machine consumes more resources than the source physical machine uses the resource and the mean value, and the difference is less than a predefined value according to the target resource. 如申請專利範圍第5項所述之叢集環境中平衡實體機資源負載的方法,其中步驟D更包含下列步驟:依據來源實體機與目標實體機之使用資源與均值的差距U s U t ,計算出資源負載量中數Thd;以及若於來源實體機中無法挑選出符合之虛擬機時,則於來源實體機中挑選一個虛擬機並於目標實體機中挑選出一個虛擬機,並將來源實體機所選之虛擬機搬移至目標實體機,將目標實體機所選之虛擬機搬移至來源實體機,以使得搬移後二個虛擬機的資源能力Vresource的差得以位在|Ut|以及|Us|之間而且最接近Thd值。 The method for balancing the load of the physical machine resource in the cluster environment described in claim 5, wherein the step D further comprises the following steps: according to the difference between the resource of the source entity and the target entity and the mean U s , U t , Calculate the resource load median Thd; and if the virtual machine cannot be selected in the source entity machine, select a virtual machine in the source entity machine and select a virtual machine in the target physical machine, and source the source The virtual machine selected by the physical machine is moved to the target physical machine, and the virtual machine selected by the target physical machine is moved to the source physical machine, so that the difference of the resource capacity V resource of the two virtual machines after moving is located at | Ut | | Us | and the closest to the Thd value. 如申請專利範圍第6項所述之叢集環境中平衡實體機資源負載的方法,其中資源負載量中數Thd=(U s -U t )/2。 A method for balancing a physical machine resource load in a cluster environment as described in claim 6 wherein the resource load median Thd = ( U s - U t )/2. 如申請專利範圍第6項所述之叢集環境中平衡實體機資源負載的方法,其中步驟D更包含下列步驟:若於來源實體機及目標實體機中無法挑選出符合之虛擬機時,則於來源實體機中挑選出一個虛擬機,此虛擬機的資源能力Vresource需最近接近資源負載量中數Thd。 For example, in the cluster environment described in claim 6, the method for balancing the load of the physical machine resource, wherein the step D further comprises the following steps: if the virtual machine cannot be selected in the source entity machine and the target entity machine, then A virtual machine is selected from the source entity, and the resource capability V resource of the virtual machine needs to be close to the resource load median Thd.
TW102137429A 2013-10-17 2013-10-17 Balancing resources management methods in clustering environment TWI506557B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
TW102137429A TWI506557B (en) 2013-10-17 2013-10-17 Balancing resources management methods in clustering environment
CN201410211353.6A CN104008011A (en) 2013-10-17 2014-05-19 Method for balancing resource load of entity machine in cluster environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW102137429A TWI506557B (en) 2013-10-17 2013-10-17 Balancing resources management methods in clustering environment

Publications (2)

Publication Number Publication Date
TW201516872A true TW201516872A (en) 2015-05-01
TWI506557B TWI506557B (en) 2015-11-01

Family

ID=51368676

Family Applications (1)

Application Number Title Priority Date Filing Date
TW102137429A TWI506557B (en) 2013-10-17 2013-10-17 Balancing resources management methods in clustering environment

Country Status (2)

Country Link
CN (1) CN104008011A (en)
TW (1) TWI506557B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI612486B (en) * 2016-05-18 2018-01-21 先智雲端數據股份有限公司 Method for optimizing utilization of workload-consumed resources for time-inflexible workloads

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI629882B (en) * 2016-12-29 2018-07-11 中華電信股份有限公司 A method for achieving a stable selection strategy by a coordinator of distributed communication based on JGroups
CN111381963B (en) * 2020-02-28 2023-06-09 腾讯科技(深圳)有限公司 Load balancing method, load balancing device, computer readable storage medium and computer equipment

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7185096B2 (en) * 2003-05-27 2007-02-27 Sun Microsystems, Inc. System and method for cluster-sensitive sticky load balancing
US7526549B2 (en) * 2003-07-24 2009-04-28 International Business Machines Corporation Cluster data port services for clustered computer system
US7757236B1 (en) * 2004-06-28 2010-07-13 Oracle America, Inc. Load-balancing framework for a cluster
JP5101140B2 (en) * 2007-03-20 2012-12-19 株式会社日立製作所 System resource control apparatus and control method
CN103514046B (en) * 2013-09-24 2017-04-26 华为技术有限公司 Virtual machine placement method and cluster management server

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI612486B (en) * 2016-05-18 2018-01-21 先智雲端數據股份有限公司 Method for optimizing utilization of workload-consumed resources for time-inflexible workloads

Also Published As

Publication number Publication date
CN104008011A (en) 2014-08-27
TWI506557B (en) 2015-11-01

Similar Documents

Publication Publication Date Title
CN102236582B (en) Method for balanced distribution of virtualized cluster load in a plurality of physical machines
RU2605473C2 (en) Automated resource usage profiling
US20190227835A1 (en) Capacity risk management for virtual machines
JP5370946B2 (en) Resource management method and computer system
KR101569093B1 (en) A method for processing data in distributed system
EP2919116B1 (en) Global memory sharing method and device and communication system
WO2018120845A1 (en) Resource allocation method and resource manager
US20130167152A1 (en) Multi-core-based computing apparatus having hierarchical scheduler and hierarchical scheduling method
US20140331235A1 (en) Resource allocation apparatus and method
CN102710779B (en) Load balance strategy for allocating service resource based on cloud computing environment
JP2015518997A5 (en)
TW201430706A (en) Computer system and graphics processing method therefore
WO2016134542A1 (en) Virtual machine migration method, apparatus and device
TWI506557B (en) Balancing resources management methods in clustering environment
TW201324357A (en) Green energy management of virtual machine cluster
US20140259022A1 (en) Apparatus and method for managing heterogeneous multi-core processor system
KR102469927B1 (en) Apparatus for managing disaggregated memory and method for the same
US20210191751A1 (en) Method and device for allocating resource in virtualized environment
US20190114079A1 (en) Apparatus for managing disaggregated memory and method thereof
Gupta et al. Trust and deadline aware scheduling algorithm for cloud infrastructure using ant colony optimization
Jha et al. Power & load aware resource allocation policy for hybrid cloud
CN105930202B (en) A kind of virtual machine migration method of three threshold values
Hu et al. Research of scheduling strategy on OpenStack
Gondhi et al. Prediction based energy efficient virtual machine consolidation in cloud computing
CN107783823A (en) A kind of load-balancing method and device

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees