CN102523153B - Load balancing method under virtual environment - Google Patents

Load balancing method under virtual environment Download PDF

Info

Publication number
CN102523153B
CN102523153B CN201110405482.5A CN201110405482A CN102523153B CN 102523153 B CN102523153 B CN 102523153B CN 201110405482 A CN201110405482 A CN 201110405482A CN 102523153 B CN102523153 B CN 102523153B
Authority
CN
China
Prior art keywords
network interface
interface card
virtual
interrupt
processor
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.)
Expired - Fee Related
Application number
CN201110405482.5A
Other languages
Chinese (zh)
Other versions
CN102523153A (en
Inventor
金海�
邵志远
王强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huazhong University of Science and Technology
Original Assignee
Huazhong University of Science and Technology
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 Huazhong University of Science and Technology filed Critical Huazhong University of Science and Technology
Priority to CN201110405482.5A priority Critical patent/CN102523153B/en
Publication of CN102523153A publication Critical patent/CN102523153A/en
Application granted granted Critical
Publication of CN102523153B publication Critical patent/CN102523153B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a load balancing method under a virtual environment. The load balancing method comprises the following steps of: judging a preset network card interrupt scheduling parameter changes when network card interrupt reaches, and if so, acquiring a sum M of current network card queues, a sum N of physical processors, interrupt loads on the physical processors, a number L of virtual processors in a virtual machine and a number K of virtual processors in a driving region; applying L annular queues and event channels for the front end of network card equipment of the virtual machine and the rear end of the network card equipment; judging whether N is more than M, and if the N is more than the M, binding M network card queues into the first M of the N physical processors in sequence by utilizing expanded message interrupt; processing the network card interrupt by the physical processors bound by the network card queues with network card interrupt; and forwarding a data packet corresponding to the network card interrupt to the rear end of the network card equipment. According to the load balancing method disclosed by the invention, problems of reduced network throughput rate and prolonged response time caused by a manner that high-load network I/O (Input/Output) is concentratedly processed in the single virtual processor under the virtual condition are avoided.

Description

Load-balancing method under virtualized environment
Technical field
The invention belongs to the load balancing field under virtualized environment, more particularly, the present invention relates to the load-balancing method under a kind of virtualized environment.
Background technology
In virtual situation, load balancing includes the load balancing of virtual processor scheduling, the load balancing that distinct device interrupts.The load balancing of virtual processor scheduling adopts " stealing " mode, when the corresponding virtual processor queue of current concurrent physical processor is empty, virtual processor to be moved in queue is moved to own virtual processor queue by the virtual processor queue that load balancing can arrive adjacent concurrent physical processor.The load balancing of distinct device, the interruption that can realize distinct device is tied to respectively different concurrent physical processor processing.
But existing load-balancing method has following problem:
1, offered load concentrates on single virtual processor, causes load imbalance in multinuclear situation, and processor becomes the bottleneck of network performance;
2, in virtual machine, process the virtual processor load weight of network I/O, according to the load-balancing method of virtual processor scheduling, this virtual processor can, by frequent migration to each concurrent physical processor processing, cause the inefficacy of high-speed cache and the increase of overhead, finally causes network performance to decline;
3, network interrupts concentrating on single driving territory virtual processor, drive territory virtual processor too frequently to seize the server program place virtual processor of same queue, cause singular association processing procedure frequently to be interrupted, the singular association processing time is elongated, overall network throughput hydraulic performance decline.
Summary of the invention
The object of the invention is to solve and concentrate on single virtual processor processing at virtual lower network I/O, the virtual processor causing is frequently processed and is frequently interrupted by migration, singular association, and finally cause the network equipment I/O processing time elongated, and the problem of network throughput decline.
The present invention is achieved by the following technical solutions:
Load-balancing method under a kind of virtualized environment, comprise the following steps: interrupt judging whether default network interface card interrupt schedule parameter changes while arrival at network interface card, if network interface card interrupt schedule parameter change, obtain the sum M of current network interface card queue, the total N of concurrent physical processor, interrupt load on concurrent physical processor, the number L of virtual processor in virtual machine, drive the number K of virtual processor in territory, wherein M, N, L and K are the integer that is greater than 1, for network card equipment front end and L circle queue of network card equipment rear end application and the event channel of virtual machine, each circle queue and event channel are corresponding to a virtual processor, judge whether N is greater than M, if N > is M, utilize extended message to interrupt successively M network interface card queue being tied to front M in N concurrent physical processor, the concurrent physical processor of being bound by the network interface card queue at network interface card interruption place is processed network interface card and is interrupted, and network interface card is interrupted to corresponding package forward to network card equipment rear end, network card equipment rear end obtains the numbering H of virtual processor in the driving territory at packet place, utilize the total L remainder of numbering H to virtual processor, remainder is the numbering as the virtual processor of reception packet, according to the circle queue of the numbering correspondence of virtual machine processor and event channel by package forward the network card equipment front end to virtual machine.
Method of the present invention is further comprising the steps of: if network interface card interrupt schedule parameter does not change, proceed to the concurrent physical processor processing network interface card of being bound by the network interface card queue at network interface card interruption place and interrupt, and network interface card is interrupted to the step of corresponding package forward to network card equipment rear end.
Method of the present invention is further comprising the steps of: if N≤M, to concurrent physical processor and M network interface card queue numbering, and utilize the numbering of network interface card queue to the total N remainder of concurrent physical processor, the numbering of the remainder concurrent physical processor that queue is bound as network interface card, utilizes extended message to interrupt successively M network interface card queue being tied to N concurrent physical processor.
The present invention has the following advantages:
1, in virtual machine manager, realize the network interface card interruption load balancing on each concurrent physical processor in virtual situation, avoided single one physical processor to carry out the response of network I/O;
2, between virtual machine manager and driving territory, realize network I/O to the load balancing that drives territory, avoided driving single virtual processor in territory to carry out the response of network I/O;
3, between driving territory and guest virtual machine, realize many queues of virtual network device I/O, make in the time that virtual machine network I/O load is heavier, each virtual processor of virtual machine can carry out load balancing to network I/O.
Accompanying drawing explanation
The flow chart of the load-balancing method under Fig. 1 virtualized environment of the present invention.
Fig. 2 is the applied environment schematic diagram of the inventive method.
Embodiment
First the technical term in the present invention is made an explanation and is defined:
Network interface card interrupt schedule parameter: defined parameters of the present invention, whether change for supervisory control system environment (network interface card queue, concurrent physical processor resource, virtual processor resources), if changed, this parameter is set up.This parameter is set to change in the time starting most, carries out load balancing for initialization.After executing load-balancing method, this parameter is eliminated at every turn.
Circle queue: English is ring buffer, adopts shared drive mode to realize, for transmit data between different virtual machine.
Drive territory: English is Driver Domain, half virtual in for the virtual machine of management equipment, device driver concentrates in this driving territory, in while virtual machine, equipment rear end corresponding to front equipment end also concentrates in this driving territory.
Event channel: English is Event Channel, simulation realizes the interrupt notification to virtual machine, for notifying the arrival of the corresponding event of virtual processor.
Extended message is interrupted: English is Message Signaled Interrupts, is called for short MSI-X, a kind of for realizing the technology of interrupting in the enterprising Mobile state binding of different processor.
As shown in Figure 1, the load-balancing method under virtualized environment of the present invention comprises the following steps:
(1) interrupt judging whether default network interface card interrupt schedule parameter changes while arrival at network interface card, if changed, proceed to step (2), otherwise proceed to step (6);
(2) obtain virtual processor in interrupt load on total N, the concurrent physical processor of sum M, concurrent physical processor of current network interface card queue, virtual machine number L, drive the number K of virtual processor in territory, wherein M, N, L and K are the integer that is greater than 1;
(3) be network card equipment front end and L circle queue of network card equipment rear end application and the event channel of virtual machine, each circle queue and event channel are corresponding to a virtual processor;
(4) judge whether N is greater than M, if N > is M, proceed to step (5), otherwise proceed to step (9);
(5) utilize extended message to interrupt successively M network interface card queue being tied to front M in N concurrent physical processor;
(6) concurrent physical processor of being bound by the network interface card queue at network interface card interruption place is processed network interface card and is interrupted, and network interface card is interrupted to corresponding package forward to network card equipment rear end;
(7) network card equipment rear end obtains the numbering H of virtual processor in the driving territory at packet place, utilizes the total L remainder of numbering H to virtual processor, and remainder is as the numbering of virtual processor that receives packet;
(8) according to the circle queue of the numbering correspondence of virtual machine processor and event channel by package forward the network card equipment front end to virtual machine;
(9) to concurrent physical processor and M network interface card queue numbering, and utilize the numbering of network interface card queue to the total N remainder of concurrent physical processor, the numbering of the remainder concurrent physical processor that queue is bound as network interface card;
(10) utilize extended message to interrupt successively M network interface card queue being tied to N concurrent physical processor.And return to step (6).
Below in conjunction with Fig. 2, operation principle of the present invention is described:
The applied virtualized environment of the inventive method comprises virtual machine manager, drives territory, virtual machine.Virtual machine manager is used for managing driving territory and virtual machine, drives territory for managing the device resource that distributes each virtual machine, and virtual machine is used for the application programs such as the server of run user.Wherein virtual machine manager and driving territory all only have one, and virtual machine can have multiple.
Physical equipment resource comprises, network interface card, concurrent physical processor.Network interface card can have multiple, and each network interface card can have one or more network interface card queue.Concurrent physical processor can have one or more, and thread is the virtual processor driving in territory and virtual machine, and each concurrent physical processor has a virtual processor queue, when scheduling, obtains from this virtual processor queue the virtual processor that needs scheduling.Wherein network interface card queue and concurrent physical processor have independent numbering, for distinguishing different network interface card queue and processor
In the time having data to arrive in network interface card, network packet is placed into corresponding network interface card queue, and produces network interface card interrupt notification virtual machine manager and process.Virtual machine manager interrupts the network interface card queue of data place according to network interface card, network interface card is interrupted being forwarded to corresponding binding physical processor and interrupt processing.In virtual machine manager, network interface card is not interrupted resolving, only this interruption is forwarded to and drives the virtual processor of binding this interruption in territory to process.
Drive territory to interrupt first obtaining network interface card interrupt schedule parameter in processing, judge whether to change, if change, carry out interruption load balancing: network interface card queue and concurrent physical processor are bound, driving territory virtual processor and concurrent physical processor are bound one by one, built respective amount network equipment front end and network equipment rear end according to virtual processor sum in each virtual machine simultaneously.
Drive territory to interrupt processing to network interface card, obtain network packet, the destination address that network packet is mail to is resolved, then by bridge by package forward to corresponding virtual machine network equipment rear end.Network equipment rear end, according to the remainder that drives territory virtual processor number to object virtual machine virtual processor sum, obtains target virtual machine virtual processor number, circle queue numbering and event channel numbering that packet is to be forwarded.According to being numbered, packet is shared to virtual machine by circle queue, notify virtual machine by packet arrival notice by event channel simultaneously.So far whole load-balancing method processing finishes.

Claims (3)

1. the load-balancing method under virtualized environment, is characterized in that, comprises the following steps:
Interrupt judging whether default network interface card interrupt schedule parameter changes while arrival at network interface card;
If described network interface card interrupt schedule parameter change, obtain virtual processor in interrupt load on total N, the described concurrent physical processor of sum M, concurrent physical processor of current network interface card queue, virtual machine number L, drive the number K of virtual processor in territory, wherein M, N, L and K are the integer that is greater than 1;
For network card equipment front end and L circle queue of network card equipment rear end application and the event channel of described virtual machine, each circle queue and event channel are corresponding to a virtual processor;
Judge whether N is greater than M;
If N>M, utilizes extended message to interrupt, its English is Message Signaled Interrupts, is called for short MSI-X, successively described M network interface card queue is tied to front M in a described N concurrent physical processor;
The concurrent physical processor of being bound by the network interface card queue at described network interface card interruption place is processed described network interface card and is interrupted, and described network interface card is interrupted to corresponding package forward to described network card equipment rear end;
Described network card equipment rear end obtains the numbering H of virtual processor in the driving territory at described packet place, utilizes the total L remainder of described numbering H to described virtual processor, and remainder is as the numbering of virtual processor that receives described packet;
According to the circle queue of the numbering correspondence of described virtual machine processor and event channel by described package forward the network card equipment front end to described virtual machine.
2. load-balancing method according to claim 1, it is characterized in that, it is further comprising the steps of: if described network interface card interrupt schedule parameter does not change, the concurrent physical processor of being bound by the network interface card queue at described network interface card interruption place described in proceeding to is processed described network interface card and is interrupted, and described network interface card is interrupted to the step of corresponding package forward to described network card equipment rear end.
3. load-balancing method according to claim 1, is characterized in that, further comprising the steps of:
If N≤M, to described concurrent physical processor and described M network interface card queue numbering, and utilizes the numbering of described network interface card queue to the total N remainder of described concurrent physical processor, the numbering of the concurrent physical processor that remainder is bound as described network interface card queue;
Utilize extended message to interrupt successively described M network interface card queue being tied to a described N concurrent physical processor.
CN201110405482.5A 2011-12-08 2011-12-08 Load balancing method under virtual environment Expired - Fee Related CN102523153B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110405482.5A CN102523153B (en) 2011-12-08 2011-12-08 Load balancing method under virtual environment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110405482.5A CN102523153B (en) 2011-12-08 2011-12-08 Load balancing method under virtual environment

Publications (2)

Publication Number Publication Date
CN102523153A CN102523153A (en) 2012-06-27
CN102523153B true CN102523153B (en) 2014-06-04

Family

ID=46293952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110405482.5A Expired - Fee Related CN102523153B (en) 2011-12-08 2011-12-08 Load balancing method under virtual environment

Country Status (1)

Country Link
CN (1) CN102523153B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984085A (en) * 2012-11-21 2013-03-20 网神信息技术(北京)股份有限公司 Mapping method and device
CN103049333B (en) * 2012-12-12 2015-10-21 华中科技大学 A kind of virtual under interruption dynamic distribution method
CN104883264A (en) * 2014-02-27 2015-09-02 中国科学院声学研究所 Method and system of virtualizing network cards on network processing platform
CN104680452A (en) * 2015-02-13 2015-06-03 湖南强智科技发展有限公司 Course selecting method and system
CN105138291B (en) * 2015-08-25 2019-09-13 杭州华为数字技术有限公司 A kind of data transmission method and device
CN106789337B (en) * 2017-01-18 2020-06-26 郑州云海信息技术有限公司 Network performance optimization method of KVM
CN109284192B (en) * 2018-09-29 2021-10-12 网宿科技股份有限公司 Parameter configuration method and electronic equipment
CN109525510A (en) * 2018-11-01 2019-03-26 北京天融信网络安全技术有限公司 A kind of method and apparatus handling data
CN114048160A (en) * 2021-11-08 2022-02-15 上海兆芯集成电路有限公司 Link balance adjusting system and link balance adjusting method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557420A (en) * 2009-03-31 2009-10-14 北京航空航天大学 Realization method of high-efficiency network communication of a virtual machine monitor
CN101631139A (en) * 2009-05-19 2010-01-20 华耀环宇科技(北京)有限公司 Load balancing software architecture based on multi-core platform and method therefor
CN101667144A (en) * 2009-09-29 2010-03-10 北京航空航天大学 Virtual machine communication method based on shared memory
CN101706757A (en) * 2009-09-21 2010-05-12 中国科学院计算技术研究所 I/O system and working method facing multi-core platform and distributed virtualization environment
CN102270159A (en) * 2011-08-11 2011-12-07 浙江大学 Access controlling and load balancing method for virtualized environment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5108975B2 (en) * 2008-04-28 2012-12-26 ヒューレット−パッカード デベロップメント カンパニー エル.ピー. Virtual interrupt mode interface and method for virtualizing interrupt mode
US8312175B2 (en) * 2010-01-21 2012-11-13 Vmware, Inc. Virtual machine access to storage via a multi-queue IO storage adapter with optimized cache affinity and PCPU load balancing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101557420A (en) * 2009-03-31 2009-10-14 北京航空航天大学 Realization method of high-efficiency network communication of a virtual machine monitor
CN101631139A (en) * 2009-05-19 2010-01-20 华耀环宇科技(北京)有限公司 Load balancing software architecture based on multi-core platform and method therefor
CN101706757A (en) * 2009-09-21 2010-05-12 中国科学院计算技术研究所 I/O system and working method facing multi-core platform and distributed virtualization environment
CN101667144A (en) * 2009-09-29 2010-03-10 北京航空航天大学 Virtual machine communication method based on shared memory
CN102270159A (en) * 2011-08-11 2011-12-07 浙江大学 Access controlling and load balancing method for virtualized environment

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
《Scheduling I/O in virtual machine monitors》;Diego Ongaro等;《VEE’08:Proceedings of the Fourth ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments》;20080307;第1-10页 *
《面向xen网络虚拟化的性能研究》;杨林凤等;《微型电脑应用》;20091031;第25卷(第10期);第11-13页 *
Diego Ongaro等.《Scheduling I/O in virtual machine monitors》.《VEE’08:Proceedings of the Fourth ACM SIGPLAN/SIGOPS International Conference on Virtual Execution Environments》.2008,
杨林凤等.《面向xen网络虚拟化的性能研究》.《微型电脑应用》.2009,第25卷(第10期),

Also Published As

Publication number Publication date
CN102523153A (en) 2012-06-27

Similar Documents

Publication Publication Date Title
CN102523153B (en) Load balancing method under virtual environment
CN108762896B (en) Hadoop cluster-based task scheduling method and computer equipment
EP2701074B1 (en) Method, device, and system for performing scheduling in multi-processor core system
CN102427475B (en) Load balance scheduling system in cloud computing environment
US10454850B2 (en) Apparatus and method for buffering data in a switch
Samal et al. Analysis of variants in round robin algorithms for load balancing in cloud computing
CN101694631B (en) Real time job dispatching patcher and method
US20140115586A1 (en) Method for dispatching central processing unit of hotspot domain virtual machine and virtual machine system
US20150052254A1 (en) Virtual Machine Live Migration Method, Virtual Machine Deployment Method, Server, and Cluster System
WO2017034731A1 (en) Technologies for offloading network packet processing to a gpu
CN104253850A (en) Distributed task scheduling method and system
CN102043667A (en) Task scheduling method for embedded operating system
CN104598298A (en) Virtual machine dispatching algorithm based on task load and current work property of virtual machine
CN103744716A (en) Dynamic interrupt balanced mapping method based on current virtual central processing unit (VCPU) scheduling state
Guan et al. Workload-aware credit scheduler for improving network I/O performance in virtualization environment
EP3238386B1 (en) Apparatus and method for routing data in a switch
Huang et al. Adaptive and scalable optimizations for high performance SR-IOV
CN102323895A (en) Real-time scheduling method of embedded operating system based on STB (Set Top Box)
CN112162835A (en) Scheduling optimization method for real-time tasks in heterogeneous cloud environment
CN106572500B (en) Scheduling method of hardware accelerator in C-RAN
CN107094119A (en) A kind of control method for equalizing load and system based on cloud computing and SDN
CN102609307A (en) Multi-core multi-thread dual-operating system network equipment and control method thereof
US9612877B1 (en) High performance computing in a virtualized environment
Lei et al. Parallelizing packet processing in container overlay networks
CN103582877B (en) Computer system interrupt processing

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140604

Termination date: 20201208