CN105592134B - A kind of method and apparatus of load balancing - Google Patents
A kind of method and apparatus of load balancing Download PDFInfo
- Publication number
- CN105592134B CN105592134B CN201510531384.4A CN201510531384A CN105592134B CN 105592134 B CN105592134 B CN 105592134B CN 201510531384 A CN201510531384 A CN 201510531384A CN 105592134 B CN105592134 B CN 105592134B
- Authority
- CN
- China
- Prior art keywords
- virtual machine
- business
- application
- default
- threshold value
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
Abstract
The present invention provides a kind of method and apparatus of load balancing, this method comprises: obtaining the application message and performance information of each virtual machine in business virtual machine group;Using the application message and performance information, DRX processing is carried out to the virtual machine in the business virtual machine group;Using load-balancing algorithm, between each virtual machine in the business virtual machine group after DRX processing, load balancing is carried out to the user access request message for accessing the application.According to the technical solution of the present invention, the quantity that virtual machine is adjusted by dynamic, improves resource utilization, and can be with the resource of reasonable utilization virtual machine.
Description
Technical field
The present invention relates to field of communication technology more particularly to a kind of method and apparatus of load balancing.
Background technique
As data center traffic increasingly increases, user demand is continuously improved, and the scale and function of data center are increasingly multiple
Miscellaneous, management difficulty is higher and higher, therefore, virtualizes to data center resource, becomes the important of current data center's integration
Trend.Virtualization technology allows resource user and system operator by abstracting to the service of physical resource and offer
It is indifferent to the physical features of object and the details of service boundaries, to reduce the complexity that resource is used and managed, improves and use
Efficiency.Thus, it can be improved the resource utilization of data center to the virtualization of data center, and reduce the energy consumption of system.Into
One step, a physical server can be fictionalized by more virtual machines by dedicated virtualization software, each virtual machine is only
Vertical operation, is independent of each other, there is oneself operating system, application program and hardware environment.
When virtual machine is externally provided in application, if there is a large number of users needs to access the application, then the void of the application is provided
Quasi- machine may be unable to satisfy the requirements for access of a large number of users, and therefore, it is necessary to increase to provide the quantity of the virtual machine of the application.And
And it if if there is a large amount of virtual machine is provided which the application, then can be wasted virtual when the number of users for accessing the application is less
The resource of machine, therefore, it is necessary to reduce to provide the quantity of the virtual machine of the application.Based on this, needs to be aware of when to increase to provide and be somebody's turn to do
The quantity of the virtual machine of application, and when reduce and the quantity of the virtual machine of the application is provided, thus dynamic adjustment virtual machine
Quantity.
Summary of the invention
The present invention provides a kind of method of load balancing, includes multiple virtual machines in business virtual machine group, and business is virtual
Virtual machine in unit is used to provide same application, the described method comprises the following steps:
Obtain the application message and performance information of each virtual machine in the business virtual machine group;
It is virtual to the business using the application message and performance information of each virtual machine in the business virtual machine group
Virtual machine in unit carries out dynamic resource extension DRX processing;
Using load-balancing algorithm, between each virtual machine in the business virtual machine group after DRX processing, to visit
Ask that the user access request message of the application carries out load balancing.
The present invention provides a kind of device of load balancing, includes multiple virtual machines in business virtual machine group, and business is virtual
For providing same application, described device specifically includes virtual machine in unit: module is obtained, it is virtual for obtaining the business
The application message and performance information of each virtual machine in unit;
Processing module, for utilizing the application message and performance information of each virtual machine in the business virtual machine group,
Dynamic resource extension DRX processing is carried out to the virtual machine in the business virtual machine group;
Load blocks, each void for utilizing load-balancing algorithm, in the business virtual machine group after DRX processing
Between quasi- machine, load balancing is carried out to the user access request message for accessing the application.
Based on the above-mentioned technical proposal, in the embodiment of the present invention, by configuring the business virtual machine group including multiple virtual machines,
And the virtual machine in business virtual machine group provides same application, so as to utilize each virtual machine in business virtual machine group
Application message and performance information in business virtual machine group virtual machine carry out DRX (Dynamic Resource
EXtension, dynamic resource extension) processing, the application is provided in application, can increase when there is a large number of users to need to access this
The quantity of virtual machine enhances processing capacity to meet the requirements for access of a large number of users;When the number of users for needing to access the application
When reduction, it is possible to reduce the quantity of the virtual machine of the application is provided, to recycle the resource of virtual machine.Aforesaid way is adjusted by dynamic
The quantity of whole virtual machine, improves resource utilization, and can be with the resource of reasonable utilization virtual machine.
Detailed description of the invention
Fig. 1 is the flow chart of the method for the load balancing in one embodiment of the present invention;
Fig. 2 is the hardware structure diagram of the load balancing equipment in one embodiment of the present invention;
Fig. 3 is the structure chart of the device of the load balancing in one embodiment of the present invention.
Specific embodiment
Aiming at the problems existing in the prior art, a kind of method that load balancing is proposed in the embodiment of the present invention, this method
Applied in the system including multiple virtual machines.Virtual machine is the virtual machine of the logic virtualized on physical server, different
Virtual machine can be located on identical physical server, can also be located on different physical servers.It, can by DRX technology
Multiple virtual machines to be added in a business virtual machine group.It include multiple virtual machines in business virtual machine group based on this, and
Virtual machine in business virtual machine group can be used for providing same application.For example, multiple virtual machines in business virtual machine group are used
It is used to externally provide mailbox application etc. in externally providing multiple virtual machines in web application or business virtual machine group.
Under above-mentioned application scenarios, as shown in Figure 1, the method for the load balancing specifically includes the following steps:
Step 101, the application message and performance information of each virtual machine in business virtual machine group are obtained.
Step 102, virtual to business using the application message and performance information of each virtual machine in business virtual machine group
Virtual machine in unit carries out DRX (dynamic resource extension) processing.
Step 103, using load-balancing algorithm, between each virtual machine in the business virtual machine group after DRX processing,
Load balancing is carried out to the user access request message of access application.
In the embodiment of the present invention, timed task can star, the timed task is for periodically executing above-mentioned load point
That is, at regular intervals the method for load executes above-mentioned steps 101- step 103, carry out to the virtual machine in business virtual machine group
DRX processing, is illustrated below in conjunction with an implementation procedure.
In the embodiment of the present invention, performance information be specifically including but not limited to CPU (Central Processing Unit, in
Central processor) utilization rate and/or memory usage.Application message is specifically including but not limited to refer to using operating status and application
Mark, is specifically as follows available mode or down state using operating status.
Certainly, performance information is not limited to cpu busy percentage and/or memory usage, can also include throughput, bandwidth
The other performances information such as utilization rate, for the convenience of description, including CPU with performance information in the subsequent process of the embodiment of the present invention
It is illustrated for utilization rate and/or memory usage.
In a kind of DRX technology, by the way that multiple virtual machines are added in a business virtual machine group, timing detects business
The cpu busy percentage and memory usage of each virtual machine in virtual robot arm.If cpu busy percentage and the memory benefit of all virtual machines
It is respectively less than preset threshold with rate, then the virtual machine quantity in business virtual machine group is reduced, if there is the cpu busy percentage of virtual machine
And/or memory usage is greater than preset threshold, then increases the virtual machine quantity in business virtual machine group.Based on this, only utilizing
The performance information (such as cpu busy percentage and/or memory usage) of each virtual machine in business virtual machine group is to business virtual machine
When virtual machine in group carries out DRX processing, then it will appear following situation: although the cpu busy percentage and memory of 1, all virtual machines
Utilization rate is respectively less than preset threshold, but may have virtual machine can not be in the user access request report of processing access application
Text, the reason is that may have a large amount of user access request message to be processed on the virtual machine, in the case, if reducing industry
The virtual machine quantity being engaged in virtual robot arm, then the user access request message being assigned on the virtual machine can be more, i.e., more
User access request message can not be handled in time.Although there 2, have the cpu busy percentage of virtual machine and/or memory usage to be greater than to be pre-
If threshold value, but may have and only handle seldom user access request message on virtual machine, which has a large amount of resource also
It can be used, in the case, if increasing the virtual machine quantity in business virtual machine group, the use being assigned on the virtual machine
Family access request message can be less, wastes the resource of virtual machine.
For above-mentioned discovery, in the embodiment of the present invention, when carrying out DRX processing to the virtual machine in business virtual machine group,
The application message (as using operating status and using index) and property of each virtual machine in business virtual machine group can be comprehensively considered
Energy information (such as cpu busy percentage and/or memory usage) carries out DRX processing to the virtual machine in business virtual machine group.For reality
This existing DRX treatment process, needs first to count the application message and performance information of each virtual machine in business virtual machine group.
Wherein, in the use process of each virtual machine in business virtual machine group, the virtual machine can directly be counted
Performance information (such as cpu busy percentage and/or memory usage).
Wherein, for each virtual machine in business virtual machine group, by detecting whether virtual machine is externally capable of providing phase
It should apply, determine that the application operating status of the virtual machine is available mode or down state.When virtual machine externally can not
When respective application is provided, it is determined that the application operating status of the virtual machine is down state.When virtual machine is externally capable of providing
When respective application, it is determined that the application operating status of the virtual machine is available mode.For example, it is directed to web application (Web application),
During virtual machine handles user access request message, if virtual machine is to specified URL (Uniform Resource
Locator, uniform resource locator) page transmission HTTP (Hyper Text Transfer Protocol, Hyper text transfer association
View) request when, the http response Token Holder of status code 200 (request succeeded) that status code is 200 can be received, then it is assumed that
The virtual machine is externally capable of providing web application, determines that the application operating status of the virtual machine is available mode.If virtual machine
When sending HTTP request to the specified URL page, http response (the response generation of status code 404 that status code is 404 can be received
The table page is not present), or any http response is not received in max-timeout time range, then it is assumed that the virtual machine is external
Web application can not be provided, determine that the application operating status of the virtual machine is down state.
Further, when the application operating status of virtual machine is available mode, the application of the virtual machine can also be detected
Index.Wherein, this using index can arbitrary disposition based on practical experience, these are used to indicate the health of the application using index
Situation.For example, being directed to web application, then can configure using index is current connection Session (session) number, connection response
Time etc..It is applied for Apache, then can configure using index is each request word joint number, number of request per second, request per second
Byte number etc..
It is right using the application message and performance information of each virtual machine in business virtual machine group in the embodiment of the present invention
Virtual machine in business virtual machine group carries out the process of DRX processing, can specifically include but is not limited to such as under type: if business
The application operating status for having virtual machine in virtual robot arm is down state, then carries out reboot process or right to the virtual machine
The virtual machine carries out closing processing.Alternatively, if having the application of multiple virtual machines (such as all virtual machines) in business virtual machine group
Operating status is available mode, and the application index of each virtual machine in this multiple virtual machine is respectively less than preset first threshold value,
Performance information is respectively less than default second threshold, then carries out closing processing to the virtual machine in business virtual machine group.Alternatively, if industry
There is the application operating status of multiple virtual machines (such as all virtual machines) for available mode in business virtual robot arm, and this multiple virtual machine
In the application index of each virtual machine be all larger than default third threshold value, performance information is all larger than default 4th threshold value, then to industry
Virtual machine in business virtual robot arm carries out unlatching processing.Alternatively, if having multiple virtual machines (such as all void in business virtual machine group
Quasi- machine) application operating status be available mode, and include using index in this multiple virtual machine less than preset first threshold value, property
Can information be less than the virtual machine of default second threshold, including application index is greater than default third threshold value, performance information be greater than it is default
The virtual machine of 4th threshold value is adjusted the access weight of the virtual machine in business virtual machine group.
Wherein, preset first threshold value, default second threshold, default third threshold value and default 4th threshold value, can basis
Practical experience is configured, and default third threshold value is greater than preset first threshold value, is preset the 4th threshold value and is greater than default second threshold,
Moreover, between default third threshold value and default 4th threshold value, there is no size relation, preset first threshold value and default second thresholds
Between also without size relation.
Setup measures preset first threshold value and default second threshold are applied for virtual machine.When the application index of virtual machine is small
When preset first threshold value, indicate the application on the virtual machine health status be it is excellent, the virtual machine can handle more at this time
More user access request messages being assigned on the virtual machine.When the application index of virtual machine is greater than default second threshold,
Indicate the application on the virtual machine health status be it is poor, at this time the virtual machine can not continue with is assigned to this virtually
User access request message on machine.When the application index of virtual machine is between preset first threshold value and default second threshold
When, indicate that the health status of the application on the virtual machine is good, the user access request report being assigned on the virtual machine at this time
The quantity of text is just right, without the quantity for adjusting the user access request message being assigned on the virtual machine.
When the application index of virtual machine is an application index, using setup measures preset first threshold value and preset for this
Second threshold.When the application index of virtual machine is multiple application indexs, respectively each application setup measures preset the first threshold
Value and default second threshold may be the same or different for the preset first threshold value of different application setup measures, answer for difference
It may be the same or different with the default second threshold of setup measures.When the application index of virtual machine is multiple using index
When, if this multiple application index is respectively less than corresponding preset first threshold value, then it represents that the application index of virtual machine is less than default
First threshold, the health status of the application on the virtual machine are excellent.If having any application index big in this multiple application index
In corresponding default second threshold, then it represents that the application index of virtual machine is greater than default second threshold, the application on the virtual machine
Health status be it is poor.For other situations, indicate that the application index of virtual machine is located at preset first threshold value and default second threshold
Between value, the health status of the application on the virtual machine is good.
For example, being applied for Apache, it is assumed that using index include each request word joint number, number of request per second, per second ask
Byte number is sought, preset first threshold value 1 and default second threshold 1 are set for each request word joint number, it is pre- for number of request per second setting
If first threshold 2 and default second threshold 2, preset first threshold value 3 and default second threshold 3 are set for request word joint number per second.
For virtual machine 1, each request word joint number, the number of request per second, request word joint number per second of Apache application are counted.It is asked when every time
Byte number is asked to be less than preset first threshold value 1, number of request per second is less than preset first threshold value 2, and request word joint number per second is less than default
When first threshold 3, indicate that the application index of virtual machine 1 is less than preset first threshold value, the health status of the application on the virtual machine 1
It is excellent.Second threshold 1 and/or number of request per second are preset greater than default second threshold 2 when each request word joint number is greater than, and/or
When request word joint number per second is greater than default second threshold 3, indicate that the application index of virtual machine 1 is greater than default second threshold, the void
The health status of application on quasi- machine 1 is poor.For other situations except above-mentioned two situations, the application of virtual machine 1 is indicated
For index between preset first threshold value and default second threshold, the health status of the application on the virtual machine 1 is good.
Wherein, default third threshold value and default 4th threshold value are set for the performance information of virtual machine.When the performance of virtual machine
When information is less than default third threshold value, then it represents that the performance condition on the virtual machine be it is excellent, the virtual machine can handle more at this time
More user access request messages being assigned on the virtual machine.When the performance information of virtual machine is greater than default four threshold value,
Then indicate performance condition on the virtual machine be it is poor, the virtual machine can not be continued with and is assigned on the virtual machine at this time
User access request message.When the performance information of virtual machine is located between default third threshold value and default 4th threshold value, then table
Show performance condition on the virtual machine be it is good, the quantity for the user access request message being assigned on the virtual machine at this time is just closed
It is suitable, without the quantity for adjusting the user access request message being assigned on the virtual machine.
It is pre- for performance information setting when the performance information (such as cpu busy percentage or memory usage) of virtual machine is one
If third threshold value and default 4th threshold value.When the performance information (such as cpu busy percentage and memory usage) of virtual machine is multiple,
Default third threshold value and default 4th threshold value is arranged in respectively each performance information, for the default third of different performance information setting
Threshold value may be the same or different, and may be the same or different for default 4th threshold value of different performance information setting.
When the performance information of virtual machine is multiple, if multiple performance informations are respectively less than corresponding default third threshold value, indicate virtual
The performance information of machine is less than default third threshold value, and the performance condition of the virtual machine is excellent.If had in multiple performance informations any
Performance information is greater than corresponding default 4th threshold value, indicates that the performance information of virtual machine is greater than default 4th threshold value, the virtual machine
Performance condition be it is poor.For other situations, indicate that the performance information of virtual machine is located at default third threshold value and default 4th threshold
Between value, the performance condition of the virtual machine is good.
For example, default third threshold value 1 and default 4th threshold value 1 are set for cpu busy percentage, it is default for memory usage setting
Third threshold value 2 and default 4th threshold value 2.For virtual machine 1, cpu busy percentage and memory usage are counted.When cpu busy percentage is small
In default third threshold value 1, when memory usage is less than default third threshold value 2, indicate that the performance information of virtual machine 1 is less than default the
Three threshold values, the performance condition of the virtual machine 1 are excellent.When cpu busy percentage is big greater than default 4th threshold value 1 and/or memory usage
When default four threshold value 2, indicate that the performance information of virtual machine 1 is greater than default 4th threshold value, the performance condition of the virtual machine 1 is
Difference.For other situations except above-mentioned two situations, indicate that the performance information of virtual machine 1 is located at default third threshold value and presets
Between 4th threshold value, the performance condition of the virtual machine 1 is good.
The process for carrying out DRX processing to the above-mentioned virtual machine in business virtual machine group below is illustrated.
If the application operating status for having virtual machine in situation one, business virtual machine group is down state, to the void
Quasi- machine carries out reboot process, or carries out closing processing to the virtual machine.
When the application operating status of virtual machine is down state, the configuration information based on user, then to the virtual machine
Reboot process is carried out, or closing processing is carried out to the virtual machine.If the configuration information of user is still to ask user's access
When asking message load to share the virtual machine of down state or restarting the virtual machine of down state, then answering when virtual machine
When with operating status being down state, reboot process is carried out to the virtual machine.If the configuration information of user is not by user
When access request message load shares the virtual machine of down state or closes the virtual machine of down state, then when virtual
When the application operating status of machine is down state, closing processing is carried out to the virtual machine.
During carrying out reboot process to virtual machine, after restarting in order to avoid continuous several times, event still can not be solved
The case where barrier, the i.e. application operating status of virtual machine remains as down state, then it can specify maximum and restart number.It is not reaching
When restarting number to maximum, if the application operating status of virtual machine remains as unavailable after carrying out reboot process to virtual machine
State then continues to carry out reboot process to virtual machine.When reaching maximum and restarting number, if carrying out reboot process to virtual machine
Afterwards, the application operating status of virtual machine remains as down state, then stops restarting virtual machine, and carry out at closing virtual machine
Reason.
During carrying out reboot process to virtual machine, since the system starting and application starting etc. of virtual machine are both needed to
Want time-consuming, in order to avoid virtual machine not yet starts completely, which is just restarted caused problem again, can be according to operation
Maintenance experience specifies the minimum interval started twice, i.e., when carrying out the interval of reboot process to virtual machine twice in succession
Between, it needs not less than the minimum interval.
After carrying out closing processing to virtual machine, which is no longer used to externally provide corresponding application, i.e., externally
Stop application, therefore user access request message load will not be shared to the virtual machine.
In practical applications, if to virtual machine configuration NQA (Network Quality Analyse, network quality point
Analysis) detection, then it can be periodically detected itself network quality between virtual machine.When the application operating status of virtual machine is not
When available mode, then detect itself network quality between virtual machine be it is unavailable, at this point it is possible to which the virtual machine is arranged
It is subsequent when sending user access request message to be unavailable, it is virtual that user access request message load will not be shared to this
Machine.
If the application operating status for having multiple virtual machines in situation two, business virtual machine group is available mode, and this is more
The application index of each virtual machine in a virtual machine is respectively less than preset first threshold value, and performance information is respectively less than default second threshold
Value, then carry out closing processing to the virtual machine in business virtual machine group.
When the application index of multiple virtual machines in business virtual machine group is respectively less than preset first threshold value, performance information is small
When default second threshold, then illustrates that multiple virtual machines in business virtual machine group can handle and be more assigned to this virtually
User access request message on machine.It therefore, can be to the virtual machine in business virtual machine group in order to save the resource of virtual machine
Carry out closing processing.Wherein, the quantity of the virtual machine of closing can be selected according to actual needs.In a kind of concrete application
In, it can be with the quantity for the virtual machine for needing to retain in configuration service virtual robot arm, when closing virtual machine, as long as the void being not turned off
The quantity of quasi- machine is more than or equal to the quantity of the virtual machine retained.For example, the number of the virtual machine retained in business virtual machine group
Amount is 5, in business virtual machine group there is currently the quantity of virtual machine be 8 when, then can close 1 virtual machine, can also close
2 virtual machines are closed, 3 virtual machines can also be closed.
When the application index of multiple virtual machines in business virtual machine group is respectively less than preset first threshold value, performance information is small
When default second threshold, at the beginning of such case generation can also be recorded.To the virtual machine in business virtual machine group
During carrying out closing processing, occurred according to the customized condition of user (such as being continued above 2 hours) and such case
At the beginning of, when determining that (the application index of multiple virtual machines in business virtual machine group is respectively less than default first to such case
Threshold value, performance information are respectively less than default second threshold) duration when meeting the customized condition of user, then can be to business
Virtual machine in virtual robot arm carries out closing processing.The customized condition of user is unsatisfactory for when the duration for determining such case
When, then it does not need to carry out closing processing to the virtual machine in business virtual machine group.
For above situation one and situation two, in the embodiment of the present invention, carried out to the virtual machine in business virtual machine group
After closing processing, if there is the virtual machine being in close state in business virtual machine group, deleted meeting default virtual machine
When except condition, can also obtain employment the virtual machine be engaged in deleting in virtual robot arm and be in close state.Wherein, which deletes
Condition can be arbitrarily arranged based on practical experience, as the default virtual machine deletion condition of setting is the virtual machine being in close state
Quantity is more than 2, this is based on, when the quantity for the virtual machine being in close state in business virtual machine group is more than 2, it is determined that
Meet default virtual machine and deletes condition, and the virtual machine be engaged in deleting in virtual robot arm and be in close state of obtaining employment.
If the application operating status for having multiple virtual machines in situation three, business virtual machine group is available mode, and this is more
The application index of each virtual machine in a virtual machine is all larger than default third threshold value, and performance information is all larger than default 4th threshold
Value, then carry out unlatching processing to the virtual machine in business virtual machine group.
When the application index of multiple virtual machines in business virtual machine group is greater than default third threshold value, performance information is greater than pre-
If when four threshold values, illustrating that multiple virtual machines in business virtual machine group can not continue with the use for being assigned to the virtual machine
Family access request message.It, can be to virtual in business virtual machine group in order to guarantee that user access request message is handled in time
Machine carries out unlatching processing.
In the embodiment of the present invention, open to the virtual machine in business virtual machine group the process of processing, specifically can wrap
It includes but is not limited to such as under type: judging in business virtual machine group with the presence or absence of the virtual machine being in close state.If it is present
Directly open the virtual machine being in close state in the business virtual machine group;If it does not exist, then creation is for providing the industry
The virtual machine of the corresponding application of business virtual robot arm, and the virtual machine currently created is added in the business virtual machine group, and is opened
Open the virtual machine currently created.
It wherein, can be according to DHCP (Dynamic Host when creation is for providing the virtual machine of application
Configuration Protocol, dynamic host configuration protocol) or preset IP address range, with distributing a free time IP
Location, and new virtual machine is created according to preset virtual machine template, and by the free IP addresses, subnet mask, default gateway etc.
The network information configures on the virtual machine currently created.
Wherein, the quantity of the virtual machine of unlatching can be selected according to actual needs.In a kind of concrete application, if
There is the virtual machine being in close state in business virtual machine group, then can directly open all places in the business virtual machine group
In the virtual machine of closed state, or open the virtual machine for being partially in closed state in the business virtual machine group.If industry
There is no the virtual machine being in close state in business virtual robot arm, then it can create a new virtual machine or creation is multiple new
Virtual machine.
If the application operating status for having multiple virtual machines in situation four, business virtual machine group is available mode, and this is more
It include being less than the virtual machine of default second threshold less than preset first threshold value, performance information using index, and wrap in a virtual machine
It includes and is greater than default third threshold value, performance information greater than the virtual machine for presetting the 4th threshold value, then to business virtual machine group using index
In the access weight of virtual machine be adjusted.
Wherein, when the application index of the virtual machine in business virtual machine group is less than preset first threshold value, performance information is less than
When default second threshold, then illustrate that the virtual machine can handle the user access request report being more assigned on the virtual machine
Text.When the application index of the virtual machine in business virtual machine group is greater than default third threshold value, performance information is greater than default 4th threshold
When value, then the user access request message for being assigned to the virtual machine can not be continued with by illustrating the virtual machine.Based on this,
In the embodiment of the present invention, to the process that the access weight of the virtual machine in business virtual machine group is adjusted, it can specifically include
But it is not limited to such as under type: increases and be less than the virtual of default second threshold less than preset first threshold value, performance information using index
The access weight of machine, and reduce and be greater than default third threshold value, performance information greater than the virtual machine for presetting the 4th threshold value using index
Access weight;With when carrying out load balancing to the user access request message of access application, increase is sent to access weight
The quantity of the user access request message of increased virtual machine, and reduce the user's visit for being sent to the virtual machine of access weight reduction
Ask the quantity of request message.
If the application message and performance information of multiple virtual machines in business virtual machine group are except above-mentioned four kinds of situations
Other situations, then will not to the virtual machine in business virtual machine group carry out DRX processing.
For example, when in business virtual machine group including virtual machine 1, virtual machine 2, virtual machine 3 and virtual machine 4, then using negative
Equalization algorithm is carried, to the user access request message of access application between virtual machine 1, virtual machine 2, virtual machine 3 and virtual machine 4
Carry out load balancing.For above situation one and situation two, it is assumed that carried out at closing to the virtual machine 1 in business virtual machine group
Reason then utilizes load-balancing algorithm, virtual machine 2, virtual machine 3 and the virtual machine 4 in the business virtual machine group after DRX processing
Between to access application user access request message carry out load balancing.For above situation three, it is assumed that in business virtual machine
New virtual machine 5 is added in group, and unlatching processing is carried out to the virtual machine 5 in business virtual machine group, then is calculated using load balancing
Method, DRX processing after business virtual machine group in virtual machine 1, virtual machine 2, virtual machine 3, virtual machine 4 and virtual machine 5 it
Between to access application user access request message carry out load balancing.For above situation four, it is assumed that increase business virtual machine
The access weight of virtual machine 1 in group, and reduce the access weight of the virtual machine 2 in business virtual machine group, then it is equal using load
Method is accounted, it is right between virtual machine 1, virtual machine 2, virtual machine 3 and the virtual machine 4 in the business virtual machine group after DRX processing
The user access request message of access application carries out load balancing.
For situation one, situation two and situation three, which can be used arbitrary load-balancing algorithm, this
It is without limitation in inventive embodiments.For situation four, which can be used round robin algorithm or minimal chain
Algorithm is connect, the round robin algorithm or min-link algorithm can be sent to this by adjusting the access weight of virtual machine to change
The quantity of the user access request message of virtual machine.
For situation four, it is assumed that before adjusting access weight, for every continuous 100 user access request messages,
There are 25 user access request messages to be sent to virtual machine 1, there are 25 user access request messages to be sent to virtual machine 2,
There are 25 user access request messages to be sent to virtual machine 3, there are 25 user access request messages to be sent to virtual machine 4.
Moreover, after adjusting access weight, it is assumed that increase virtual machine 1 access weight, and reduce virtual machine 2 access weight it
Afterwards, it can make there are 45 user access request messages to be sent to void for per continuous 100 user access request messages
Quasi- machine 1, has 5 user access request messages to be sent to virtual machine 2, has 25 user access request messages to be sent to virtually
Machine 3 has 25 user access request messages to be sent to virtual machine 4.By above-mentioned processing, it can increase and be sent to idle void
The quantity of the user access request message of quasi- machine 1, and the user access request message for being sent to busy virtual machine 2 can be reduced
Quantity.
Based on the above-mentioned technical proposal, in the embodiment of the present invention, by configuring the business virtual machine group including multiple virtual machines,
Virtual machine in the business virtual machine group provides same application, to utilize the application of each virtual machine in business virtual machine group
Information and performance information carry out DRX processing to the virtual machine in business virtual machine group, when there is a large number of users to need to access in application,
Increase and the quantity of the virtual machine of the application is provided, to meet the requirements for access of a large number of users, enhances processing capacity;When access is applied
Number of users reduce when, it is possible to reduce the quantity of the virtual machine of application is provided, to recycle the resource of virtual machine.Aforesaid way is logical
The quantity that dynamic adjusts virtual machine is crossed, is improved resource utilization, and can be with the resource of reasonable utilization virtual machine.
The method of the above-mentioned load balancing proposed in the embodiment of the present invention can be applied in load balancing equipment, can also
To apply on the Network Management Equipment or other equipment that can manage the load balancing equipment.In load balancing equipment, to answer
With creating real service group (as applied A), and configure under the reality service group multiple real service.Wherein it is possible to will have it is identical or
Multiple virtual machine abstractions of similar application are at a real service group, and a real service group may include multiple real services.Real clothes
Business is the entity that customer service is handled in load balancing equipment, and there are the mapping relations of IP address and port with virtual machine.For
The above process, real service group are equivalent to above-mentioned business virtual machine group, and real services corresponds to a virtual machine.
Based on inventive concept same as the above method, a kind of dress of load balancing is additionally provided in the embodiment of the present invention
It sets, the device of the load balancing can be applied in load balancing equipment.The device of the load balancing can by software realization,
It can also be realized by way of hardware or software and hardware combining.Taking software implementation as an example, as the dress on a logical meaning
It sets, is by the processor of the load balancing equipment where it, by computer program instructions corresponding in nonvolatile memory
It is read into memory what operation was formed.For hardware view, as shown in Fig. 2, being the device of load balancing proposed by the present invention
A kind of hardware structure diagram of the load balancing equipment at place, in addition to processor shown in Fig. 2, network interface, memory and it is non-easily
Outside the property lost memory, load balancing equipment can also include other hardware, such as be responsible for the forwarding chip of processing message;From hardware
From structure, which is also possible to be distributed apparatus, may include multiple interface cards, so as in hardware view
Carry out the extension of Message processing.
It include multiple virtual machines in business virtual machine group for the device for the load balancing that the embodiment of the present invention proposes, and
Virtual machine in business virtual machine group is for providing same application.As shown in figure 3, the load balancing proposed for the embodiment of the present invention
Device structure chart, the device of the load balancing specifically includes:
Module 11 is obtained, for obtaining the application message and performance letter of each virtual machine in the business virtual machine group
Breath;Processing module 12, for the application message and performance information using each virtual machine in the business virtual machine group, to institute
The virtual machine stated in business virtual machine group carries out DRX processing;Load blocks 13, for utilizing load-balancing algorithm, in DRX processing
Between each virtual machine in the business virtual machine group later, the user access request message for accessing the application is born
Load is shared.
In the embodiment of the present invention, the application message includes using operating status and applying index, and the application runs shape
State is specially available mode or down state;
The processing module 12, specifically for being not when the application operating status for having virtual machine in the business virtual machine group
When available mode, then reboot process is carried out to the virtual machine, or closing processing is carried out to the virtual machine;Alternatively, working as institute
Stating has the application operating status of multiple virtual machines for available mode in business virtual machine group, and each of the multiple virtual machine
The application index of virtual machine is respectively less than preset first threshold value, when performance information is respectively less than default second threshold, then virtual to business
Virtual machine in unit carries out closing processing;Alternatively, when the application operation shape for having multiple virtual machines in the business virtual machine group
State is available mode, and the application index of each virtual machine in the multiple virtual machine is all larger than default third threshold value, performance
When information is all larger than default four threshold value, then unlatching processing is carried out to the virtual machine in business virtual machine group;Alternatively, working as the industry
The application operating status for having multiple virtual machines in business virtual robot arm is available mode, and includes that application refers in the multiple virtual machine
Mark is less than preset first threshold value, performance information is less than the virtual machine of default second threshold, and is greater than default the including application index
When three threshold values, performance information are greater than the virtual machine of default 4th threshold value, then to the access right of the virtual machine in business virtual machine group
It is adjusted again;
Default third threshold value is greater than preset first threshold value, presets the 4th threshold value and is greater than default second threshold.
The processing module 12 is also used to after carrying out closing processing to the virtual machine in the business virtual machine group,
If there is the virtual machine being in close state in the business virtual machine group, when meeting default virtual machine deletion condition,
The virtual machine being in close state is deleted from the business virtual machine group.
The processing module 12, specifically in the mistake for open to the virtual machine in the business virtual machine group processing
Cheng Zhong judges in the business virtual machine group with the presence or absence of the virtual machine being in close state;If it is present opening the industry
The virtual machine being in close state being engaged in virtual robot arm;If it does not exist, then creation is used to provide the described the virtual machine of application,
And the virtual machine currently created is added in the business virtual machine group, and open the virtual machine currently created.
The processing module 12, specifically for what is be adjusted in the access weight to the virtual machine in business virtual machine group
In the process, increase the access right for being less than the virtual machine of default second threshold less than preset first threshold value, performance information using index
Weight, and reduce the access weight for being greater than the virtual machine of default 4th threshold value greater than default third threshold value, performance information using index;
With when carrying out load balancing to the user access request message for accessing the application, increase is sent to the increased void of access weight
The quantity of the user access request message of quasi- machine, and reduce the user access request report for being sent to the virtual machine of access weight reduction
The quantity of text.
Wherein, the modules of apparatus of the present invention can integrate in one, can also be deployed separately.Above-mentioned module can close
And be a module, multiple submodule can also be further split into.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can be by
Software adds the mode of required general hardware platform to realize, naturally it is also possible to which by hardware, but in many cases, the former is more
Good embodiment.Based on this understanding, technical solution of the present invention substantially in other words contributes to the prior art
Part can be embodied in the form of software products, which is stored in a storage medium, if including
Dry instruction is used so that a computer equipment (can be personal computer, server or the network equipment etc.) executes this hair
Method described in bright each embodiment.It will be appreciated by those skilled in the art that attached drawing is the schematic diagram of a preferred embodiment,
Module or process in attached drawing are not necessarily implemented necessary to the present invention.
It will be appreciated by those skilled in the art that the module in device in embodiment can describe be divided according to embodiment
It is distributed in the device of embodiment, corresponding change can also be carried out and be located in one or more devices different from the present embodiment.On
The module for stating embodiment can be merged into a module, can also be further split into multiple submodule.The embodiments of the present invention
Serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
Disclosed above is only several specific embodiments of the invention, and still, the present invention is not limited to this, any ability
What the technical staff in domain can think variation should all fall into protection scope of the present invention.
Claims (10)
1. a kind of method of load balancing, which is characterized in that include multiple virtual machines in business virtual machine group, and business virtual machine
Virtual machine in group is used to provide same application, the described method comprises the following steps:
Obtain the application message and performance information of each virtual machine in the business virtual machine group;The application message includes answering
With operating status and index is applied, the application operating status is specially available mode or down state, and the application refers to
Mark is for indicating the health status of application;
Using the application message and performance information of each virtual machine in the business virtual machine group, to the business virtual machine group
In virtual machine carry out dynamic resource extension DRX processing;
Using load-balancing algorithm, between each virtual machine in the business virtual machine group after DRX processing, to access institute
The user access request message for stating application carries out load balancing.
2. the method according to claim 1, wherein
The application message and performance information using each virtual machine in the business virtual machine group, it is virtual to the business
Virtual machine in unit carries out the process of DRX processing, specifically includes:
If have in the business virtual machine group virtual machine application operating status be down state, to the virtual machine into
Row reboot process, or closing processing is carried out to the virtual machine;Alternatively,
If having the application operating status of multiple virtual machines in the business virtual machine group is available mode, and the multiple virtual
The application index of each virtual machine in machine is respectively less than preset first threshold value, and performance information is respectively less than default second threshold, then right
Virtual machine in business virtual machine group carries out closing processing;Alternatively,
If having the application operating status of multiple virtual machines in the business virtual machine group is available mode, and the multiple virtual
The application index of each virtual machine in machine is all larger than default third threshold value, and performance information is all larger than default 4th threshold value, then right
Virtual machine in business virtual machine group carries out unlatching processing;Alternatively,
If having the application operating status of multiple virtual machines in the business virtual machine group is available mode, and the multiple virtual
It include less than preset first threshold value, performance information in machine using index less than the virtual machine for presetting second threshold, and including application
Index is greater than default third threshold value, performance information is greater than the virtual machine for presetting the 4th threshold value, then to the void in business virtual machine group
The access weight of quasi- machine is adjusted;
Default third threshold value is greater than preset first threshold value, presets the 4th threshold value and is greater than default second threshold.
3. according to the method described in claim 2, it is characterized in that, being closed to the virtual machine in the business virtual machine group
It closes after processing, the method further includes:
If there is the virtual machine being in close state in the business virtual machine group, condition is deleted meeting default virtual machine
When, the virtual machine being in close state is deleted from the business virtual machine group.
4. according to the method described in claim 2, it is characterized in that, the virtual machine in the business virtual machine group carries out
The process for opening processing, specifically includes:
Judge in the business virtual machine group with the presence or absence of the virtual machine being in close state;
If it is present opening the virtual machine being in close state in the business virtual machine group;
If it does not exist, then creation is used to provide the described the virtual machine of application, and the virtual machine currently created is added to described
In business virtual machine group, and open the virtual machine currently created.
5. according to the method described in claim 2, it is characterized in that, the visit to the virtual machine in the business virtual machine group
It asks the process that weight is adjusted, specifically includes:
Increase the access weight for being less than the virtual machine of default second threshold less than preset first threshold value, performance information using index,
And reduce the access weight for being greater than the virtual machine of default 4th threshold value greater than default third threshold value, performance information using index;With
When carrying out load balancing to the user access request message for accessing the application, it is increased virtual that increase is sent to access weight
The quantity of the user access request message of machine, and reduce the user access request message for being sent to the virtual machine of access weight reduction
Quantity.
6. a kind of device of load balancing, which is characterized in that include multiple virtual machines in business virtual machine group, and business virtual machine
For providing same application, described device specifically includes virtual machine in group:
Module is obtained, for obtaining the application message and performance information of each virtual machine in the business virtual machine group;It is described
Application message includes using operating status and applying index, and the application operating status is specially available mode or unavailable shape
State, the health status for being used to indicate application using index;
Processing module, for the application message and performance information using each virtual machine in the business virtual machine group, to institute
It states the virtual machine in business virtual machine group and carries out dynamic resource extension DRX processing;
Load blocks, each virtual machine for utilizing load-balancing algorithm, in the business virtual machine group after DRX processing
Between, load balancing is carried out to the user access request message for accessing the application.
7. device according to claim 6, which is characterized in that
The processing module, specifically for being unavailable shape when the application operating status for having virtual machine in the business virtual machine group
When state, then reboot process is carried out to the virtual machine, or closing processing is carried out to the virtual machine;Alternatively, working as the business
There is the application operating status of multiple virtual machines for available mode in virtual robot arm, and each virtual machine in the multiple virtual machine
Application index be respectively less than preset first threshold value, when performance information is respectively less than default second threshold, then in business virtual machine group
Virtual machine carry out closing processing;Alternatively, having the application operating status of multiple virtual machines in the business virtual machine group for can
It is all larger than default third threshold value with the application index of state, and each virtual machine in the multiple virtual machine, performance information is equal
When greater than default four threshold value, then unlatching processing is carried out to the virtual machine in business virtual machine group;Alternatively, when the business is virtual
The application operating status for having multiple virtual machines in unit is available mode, and includes being less than using index in the multiple virtual machine
Preset first threshold value, performance information are less than the virtual machine of default second threshold, and including application index be greater than default third threshold value,
When performance information is greater than the virtual machine of default 4th threshold value, then the access weight of the virtual machine in business virtual machine group is adjusted
It is whole;
Default third threshold value is greater than preset first threshold value, presets the 4th threshold value and is greater than default second threshold.
8. device according to claim 7, which is characterized in that
The processing module is also used to after carrying out closing processing to the virtual machine in the business virtual machine group, if institute
It states and there is the virtual machine that is in close state in business virtual machine group, then when meeting default virtual machine and deleting condition, from described
The virtual machine being in close state is deleted in business virtual machine group.
9. device according to claim 7, which is characterized in that
The processing module, specifically for during carrying out unlatching processing to the virtual machine in the business virtual machine group,
Judge in the business virtual machine group with the presence or absence of the virtual machine being in close state;If it is present it is empty to open the business
The virtual machine being in close state in quasi- unit;If it does not exist, then creation is used to provide the described the virtual machine of application, and will
The virtual machine currently created is added in the business virtual machine group, and opens the virtual machine currently created.
10. device according to claim 7, which is characterized in that
The processing module, specifically for the process being adjusted in the access weight to the virtual machine in business virtual machine group
In, increase the access weight for being less than the virtual machine of default second threshold less than preset first threshold value, performance information using index, and
Reduce the access weight for being greater than the virtual machine of default 4th threshold value greater than default third threshold value, performance information using index;With
When carrying out load balancing to the user access request message for accessing the application, increase is sent to the increased virtual machine of access weight
User access request message quantity, and reduce the user access request message for being sent to the virtual machine of access weight reduction
Quantity.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510531384.4A CN105592134B (en) | 2015-08-26 | 2015-08-26 | A kind of method and apparatus of load balancing |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510531384.4A CN105592134B (en) | 2015-08-26 | 2015-08-26 | A kind of method and apparatus of load balancing |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105592134A CN105592134A (en) | 2016-05-18 |
CN105592134B true CN105592134B (en) | 2019-04-05 |
Family
ID=55931340
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510531384.4A Active CN105592134B (en) | 2015-08-26 | 2015-08-26 | A kind of method and apparatus of load balancing |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105592134B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107645520B (en) * | 2016-07-21 | 2020-12-04 | 阿里巴巴集团控股有限公司 | Load balancing method, device and system |
CN107979539B (en) * | 2017-10-30 | 2021-12-03 | 新华三技术有限公司 | Message processing method and device |
CN111740857B (en) * | 2020-05-29 | 2023-12-26 | 新华三信息安全技术有限公司 | Method and device for issuing Network Quality Analysis (NQA) configuration |
CN112367267B (en) * | 2020-09-30 | 2022-03-29 | 新华三大数据技术有限公司 | Virtual machine management method and device |
CN112764879A (en) * | 2021-01-14 | 2021-05-07 | 深圳市科思科技股份有限公司 | Load balancing method, electronic device and computer readable storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102508718A (en) * | 2011-11-22 | 2012-06-20 | 杭州华三通信技术有限公司 | Method and device for balancing load of virtual machine |
CN103294552A (en) * | 2012-02-22 | 2013-09-11 | 鸿富锦精密工业(深圳)有限公司 | Method for increasing configuration quantity of virtual machines of server |
CN104426694A (en) * | 2013-08-28 | 2015-03-18 | 杭州华三通信技术有限公司 | Method and device for adjusting virtual-machine resources |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8185893B2 (en) * | 2006-10-27 | 2012-05-22 | Hewlett-Packard Development Company, L.P. | Starting up at least one virtual machine in a physical machine by a load balancer |
US9141420B2 (en) * | 2010-11-04 | 2015-09-22 | Alcatel Lucent | Overload control in a cloud computing environment |
-
2015
- 2015-08-26 CN CN201510531384.4A patent/CN105592134B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102508718A (en) * | 2011-11-22 | 2012-06-20 | 杭州华三通信技术有限公司 | Method and device for balancing load of virtual machine |
CN103294552A (en) * | 2012-02-22 | 2013-09-11 | 鸿富锦精密工业(深圳)有限公司 | Method for increasing configuration quantity of virtual machines of server |
CN104426694A (en) * | 2013-08-28 | 2015-03-18 | 杭州华三通信技术有限公司 | Method and device for adjusting virtual-machine resources |
Also Published As
Publication number | Publication date |
---|---|
CN105592134A (en) | 2016-05-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105592134B (en) | A kind of method and apparatus of load balancing | |
US11470011B2 (en) | System for bandwidth optimization with traffic priority determination | |
US10581960B2 (en) | Performing context-rich attribute-based load balancing on a host | |
US11582163B2 (en) | System for early system resource constraint detection and recovery | |
US20180375726A1 (en) | Resource Configuration Method, Virtualized Network Function Manager, and Element Management System | |
DE102020132078A1 (en) | RESOURCE ALLOCATION BASED ON APPLICABLE SERVICE LEVEL AGREEMENT | |
CN110933097B (en) | Current limiting and automatic capacity expanding and shrinking method for multi-service gateway | |
US10404603B2 (en) | System and method of providing increased data optimization based on traffic priority on connection | |
WO2018121334A1 (en) | Web application service providing method, apparatus, electronic device and system | |
JP2018045671A (en) | Method and apparatus for scheduling cloud server | |
US20130007253A1 (en) | Method, system and corresponding device for load balancing | |
GB2413868A (en) | Communicating between a server and browsing clients | |
CN103152200B (en) | Virtual machine migration method, switch, network management device and network system | |
US10469559B2 (en) | Quality of service for web real-time communication networks | |
CN109787827B (en) | CDN network monitoring method and device | |
CN108933829A (en) | A kind of load-balancing method and device | |
US20190044799A1 (en) | Technologies for hot-swapping a legacy appliance with a network functions virtualization appliance | |
KR20190029486A (en) | Elastic honeynet system and method for managing the same | |
KR101402367B1 (en) | Efficient and cost-effective distributed call admission control | |
US10574796B2 (en) | System for dynamic selection and application of TCP congestion avoidance flavors | |
US10225358B2 (en) | Page push method, device, server and system | |
CN107306230B (en) | Method, device, controller and core network equipment for network resource deployment | |
US11316916B2 (en) | Packet processing method, related device, and computer storage medium | |
CN108604996A (en) | A kind of strategy transmission method and apparatus in NFV systems | |
Bays et al. | Flow based load balancing: Optimizing web servers resource utilization |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No. Applicant after: Xinhua three Technology Co., Ltd. Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No. Applicant before: Huasan Communication Technology Co., Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |