CN110995868A - Load balancing method and device - Google Patents
Load balancing method and device Download PDFInfo
- Publication number
- CN110995868A CN110995868A CN201911330103.3A CN201911330103A CN110995868A CN 110995868 A CN110995868 A CN 110995868A CN 201911330103 A CN201911330103 A CN 201911330103A CN 110995868 A CN110995868 A CN 110995868A
- Authority
- CN
- China
- Prior art keywords
- module
- group
- main group
- standby
- end server
- 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.)
- Pending
Links
Images
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
- H04L67/1004—Server selection for load balancing
- H04L67/1008—Server selection for load balancing based on parameters of servers, e.g. available memory or workload
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0663—Performing the actions predefined by failover planning, e.g. switching to standby network elements
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Hardware Design (AREA)
- General Engineering & Computer Science (AREA)
- Hardware Redundancy (AREA)
Abstract
The invention discloses a load balancing method and a load balancing system.A performance monitoring module is added in a Pool module, and the performance monitoring module is respectively connected with a main group and a standby group in the Pool module and is simultaneously connected with a scheduling module in the Pool module. The method comprises the steps of monitoring the operation indexes of the back-end servers in the main group, calculating the current load state of each back-end server according to the monitored operation indexes of the back-end servers in the main group, monitoring the load condition of the back-end servers in the main group, and switching to the standby group when the back-end servers in the main group are fully loaded or unavailable, so that the complex application scene with high performance and high reliability can be supported.
Description
Technical Field
The invention relates to the technical field of computer networks, in particular to a load balancing method and a load balancing device.
Background
With the rapid development of the Internet and the continuous improvement of the business volume, the data access flow based on the network is rapidly increased; meanwhile, the server website provides more and more abundant contents and information for the visitor by means of application programs such as HTTP, FTP, SMTP and the like, and the server is gradually submerged by data; in addition, most web sites (especially those for e-commerce) need to provide uninterrupted 24-hour service, and any service interruption or loss of critical data in the communication results in a direct business loss. All this puts demands on high performance and high reliability of the application services.
Under the condition of multiple AZs in a cloud computing scene, due to the fact that indexes such as time delay of servers of different AZs are different, in order to better improve user experience of a terminal user, some customers propose that load balancing is expected to preferentially use the servers in the same AZ; and when the back-end server in the AZ fails or the AZ fails and is unavailable, the back-end server of the standby AZ is started.
The demand that a part of servers with good service indexes are preferentially used is met with certain universality when the servers with good service indexes are fully loaded or have faults and some standby servers are reused. For example, in a hybrid cloud scenario, a part of servers are deployed on physical machines, a part of machines are deployed on the cloud, and when traffic is not very large, some customers propose to preferentially use the servers deployed on the physical machines. When the physical machine server is fully loaded or fails, the server on the cloud is started, so that the terminal user experience is preferentially ensured, and the requirement of high-availability deployment of services can be met.
As shown in fig. 1, the existing load balancing system mainly includes the following scheduling algorithms of a scheduling module in the prior art:
round Robin Scheduling algorithm: and the requests are distributed to different servers or links in sequence, so that each real server or link shares the connection request of the user on average.
Weighted Round Robin Scheduling (Weighted Round Robin Scheduling) algorithm: and distributing the requests to different back-end servers in sequence according to the weight, wherein the requests with large weights are distributed more, and the requests with small weights are distributed less.
Hash (Source IP Hashing scheduling) algorithm based on source IP: requests from the same source IP are mapped onto a server or link by a Hash function.
The current technical solutions are all directed to a common network mode, such as using a nginx web server to perform load balancing or using a Haproxy to implement load balancing, and although these load balancing services also provide a richer scheduling algorithm, they cannot meet this complex demand scenario, for example, a physical server mentioned by a certain client is preferentially accessed to the local of the client, and when the physical server is fully loaded or fails, the physical server is accessed to a server deployed in the cloud.
Disclosure of Invention
The purpose of the invention is as follows: aiming at the defects in the prior art, the invention provides a load balancing system and a method thereof.
The technical scheme is as follows:
a method of load balancing, comprising the steps of:
(1) adding a performance monitoring module in the Pool module, wherein the performance monitoring module is respectively connected with a main group and a standby group in the Pool module and is simultaneously connected with a scheduling module in the Pool module;
(2) the performance monitoring module acquires the operation indexes of the back-end servers in the main group at preset time intervals, and then acquires the operation indexes of the back-end servers in the main group according to the acquired operation indexes, including CPU utilization rate and memory utilization rate; calculating the current load state of each rear-end server, and sending the current load state to the scheduling module; wherein, the load state comprises three states of full load, normal and unavailable;
(3) and a scheduling module in the Pool module receives the current load state of each back-end server in the main group sent by the performance monitoring module, and allocates the main group and the standby group according to the load state and actual requirements of the back-end servers in the main group.
In the step (2), the current load state of each back-end server is calculated as follows:
(21) define the status monitor Value: if the performance monitoring module cannot obtain the feedback of the back-end server, Value is-1, and the back-end server is unavailable at this time; if the performance monitoring module can obtain the feedback of the back-end server, Value ═ is (CPU utilization rate < set threshold) & (memory utilization rate < set threshold);
(22) calculating the Value of each backend server Value, and if the Value is-1, the backend server is unavailable; if Value is 1, the back-end server is normal; if Value is 0, the backend server is already fully loaded.
The allocation of the active set and the standby set according to the actual requirement is as follows:
(31) if the scheduling mode of the current Pool module is set to be a mixed mode of the standby group and the main group, the standby group does not need to be specially configured;
(32) if the current Pool module scheduling mode is set to preferentially use the main group mode, at this time:
when the state monitoring Value of each back-end server in the main group is-1, starting the standby server group;
and when the state monitoring Value of each back-end server in the main group is 0, starting the standby server group.
In the step (21), the threshold is set as follows: the CPU utilization rate is 85%; the threshold is set as follows: and 85% of memory.
A load balancing system comprises a message receiving module, a monitor module, a Pool selecting module and a plurality of Pool modules; the message receiving module, the listener module and the Pool selecting module are sequentially connected, and the Pool selecting module is respectively connected with all the Pool modules;
the Pool module comprises a scheduling module, a performance monitoring module, a main group and a standby group, wherein the main group and the standby group are respectively provided with a plurality of back-end servers; the scheduling module is respectively connected with the main group and the standby group, the performance monitoring module is respectively connected with the main group and the standby group, and the performance monitoring module is connected with the scheduling module;
the performance monitoring module acquires operation indexes of a back-end server in the main group at preset time intervals, wherein the operation indexes comprise CPU utilization rate and memory utilization rate; calculating the current load state of each back-end server according to the acquired operation indexes of the back-end servers in the main group, and sending the current load state to the scheduling module; wherein, the load state comprises three states of full load, normal and unavailable;
the scheduling module receives the current load state of each back-end server in the main group sent by the performance monitoring module, and allocates the main group and the standby group according to the load state and the actual demand of the back-end servers in the main group.
The performance monitoring module calculates the current load state of each back-end server according to the acquired operation index of the back-end server in the main group, specifically as follows:
obtaining the current load state of each back-end server by calculating a state monitoring Value, wherein if the performance detection module cannot obtain the feedback of the back-end server, the back-end server is unavailable when the state monitoring Value is-1; if the detection program can obtain the feedback of the back-end server, Value ═ is (CPU utilization rate < set threshold) & (memory utilization rate < set threshold); if Value is 1, the back-end server is normal; if Value is 0, the backend server is already fully loaded.
The allocation of the active set and the standby set according to the actual requirement is as follows:
if the scheduling mode of the current Pool module is set to be a mixed mode of the standby group and the main group, the standby group does not need to be specially configured;
if the current Pool module scheduling mode is set to preferentially use the main group mode, at this time:
when the state monitoring Value of each back-end server in the main group is-1, starting the standby server group; and when the state monitoring Value of each back-end server in the main group is 0, starting the standby server group.
The set threshold in the status monitoring Value is as follows: the CPU utilization rate is 85%; the threshold is set as follows: and 85% of memory.
Has the advantages that: the invention adds a performance monitoring module in the Pool module to monitor the operation index of the back-end server in the main group, calculates the current load state of each back-end server according to the monitored operation index of the back-end server in the main group, further monitors the load condition of the back-end server in the main group, and switches to the standby group when the back-end server in the main group is fully loaded or unavailable, thereby being capable of supporting the complex application scene with high performance and high reliability.
Drawings
Fig. 1 is a diagram illustrating internal logic processing of a load balancing system in the prior art.
Fig. 2 is a processing diagram of the internal logic of the load balancing system of the present invention.
Detailed Description
The invention is further elucidated with reference to the drawings and the embodiments.
Fig. 2 is a processing diagram of the internal logic of the load balancing system of the present invention. As shown in fig. 2, the load balancing method of the present invention includes the steps of:
(1) adding a performance monitoring module in the Pool module, wherein the performance monitoring module is respectively connected with a main group and a standby group in the Pool module and is simultaneously connected with a scheduling module in the Pool module;
(2) the performance monitoring module acquires the operation indexes of the back-end servers in the main group at preset time intervals, calculates the current load state of each back-end server according to the acquired operation indexes of the back-end servers in the main group, and sends the current load state to the scheduling module; the indexes obtained from each back-end server in the main group comprise CPU utilization rate and memory utilization rate;
the specific calculation of the current load state of each back-end server is as follows:
(21) define the status monitor Value: if the performance monitoring module cannot obtain the feedback of the back-end server, Value is-1; (the backend server is considered unavailable); if the detection program can obtain the feedback of the back-end server, Value ═ is (CPU utilization rate < set threshold) & (memory utilization rate < set threshold);
(22) if the Value of each backend server Value is calculated, if the Value is-1, the backend server is unavailable; if Value is 1, the back-end server is normal; if Value is 0, the backend server is fully loaded;
(3) a scheduling module in the Pool module receives the current load state of each back-end server in the main group sent by the performance monitoring module, and allocates the main group and the standby group according to actual requirements;
the specific distribution is as follows:
if the scheduling mode of the current Pool module is set to be a mixed mode of the standby group and the main group, the standby group does not need to be specially configured;
if the current Pool module scheduling mode is set to preferentially use the main group mode, at this time:
when the state monitoring Value of each back-end server in the main group is-1, starting the standby server group; and when the state monitoring Value of each back-end server in the main group is 0, starting the standby server group.
The invention also provides a load balancing system, which comprises a message receiving module, a monitor module, a Pool selecting module and a plurality of Pool modules; the message receiving module, the listener module and the Pool selecting module are sequentially connected, and the Pool selecting module is respectively connected with all the Pool modules.
The Pool module comprises a scheduling module, a performance monitoring module, a main group and a standby group, wherein the main group and the standby group are respectively provided with a plurality of back-end servers which can be physical machines or virtual machines; the scheduling module is respectively connected with the main group and the standby group, the performance monitoring module is respectively connected with the main group and the standby group, and the performance monitoring module is connected with the scheduling module.
The performance monitoring module acquires the operation indexes of the back-end servers in the main group at preset time intervals, calculates the current load state of each back-end server according to the acquired operation indexes of the back-end servers in the main group, and sends the current load state to the scheduling module; in the present invention, the preset time interval is set according to specific requirements, and in a specific embodiment of the present invention, the preset time interval is set to 1 s.
The indexes required to be obtained from each physical server comprise CPU utilization rate and memory utilization rate;
if the server is not available: value ═ 1; when Value is 1, the physical server is considered normal, and when Value is 0, the server is considered full. In the present invention, the threshold is set as follows: the CPU utilization rate is 85%; the threshold is set as follows: and 85% of memory.
The scheduling module receives the current load state of each back-end server in the main group sent by the performance monitoring module, and allocates the main group and the standby group according to actual requirements;
the triggering condition for the standby group activation can be configured as follows:
(1) the standby group and the main group are used in a mixed mode: under such usage, the primary and standby groupings have no substantial significance;
(2) when the main server group is unavailable or the whole server group fails, starting the standby server group, wherein the condition to be configured is that the state monitoring Value of each physical server is-1;
or when the main server group is fully loaded, starting the standby server group, and configuring the condition that the state monitoring Value of each physical server in the main server group is 0. The invention adds a performance monitoring module in the Pool module to monitor the operation index of the back-end server in the main group, calculates the current load state of each back-end server according to the monitored operation index of the back-end server in the main group, further monitors the load condition of the back-end server in the main group, and switches to the standby group when the back-end server in the main group is fully loaded or unavailable, thereby being capable of supporting the complex application scene with high performance and high reliability.
Although the preferred embodiments of the present invention have been described in detail, the present invention is not limited to the details of the foregoing embodiments, and various equivalent changes (such as number, shape, position, etc.) may be made to the technical solution of the present invention within the technical spirit of the present invention, and the equivalents are protected by the present invention.
Claims (8)
1. A method of load balancing, characterized by: the method comprises the following steps:
(1) adding a performance monitoring module in the Pool module, wherein the performance monitoring module is respectively connected with a main group and a standby group in the Pool module and is simultaneously connected with a scheduling module in the Pool module;
(2) the performance monitoring module acquires the operation indexes of the back-end servers in the main group at preset time intervals, and then acquires the operation indexes of the back-end servers in the main group according to the acquired operation indexes, including CPU utilization rate and memory utilization rate; calculating the current load state of each rear-end server, and sending the current load state to the scheduling module; wherein, the load state comprises three states of full load, normal and unavailable;
(3) and a scheduling module in the Pool module receives the current load state of each back-end server in the main group sent by the performance monitoring module, and allocates the main group and the standby group according to the load state and actual requirements of the back-end servers in the main group.
2. The load balancing method according to claim 1, wherein: in the step (2), the current load state of each back-end server is calculated as follows:
(21) define the status monitor Value: if the performance monitoring module cannot obtain the feedback of the back-end server, Value is-1, and the back-end server is unavailable at this time; if the performance monitoring module can obtain the feedback of the back-end server, Value ═ is (CPU utilization rate < set threshold) & (memory utilization rate < set threshold);
(22) calculating the Value of each backend server Value, and if the Value is-1, the backend server is unavailable; if Value is 1, the back-end server is normal; if Value is 0, the backend server is already fully loaded.
3. The load balancing method according to claim 2, wherein: in the step (3), the allocation of the active set and the standby set according to the actual requirement is as follows:
(31) if the scheduling mode of the current Pool module is set to be a mixed mode of the standby group and the main group, the standby group does not need to be specially configured;
(32) if the current Pool module scheduling mode is set to preferentially use the main group mode, at this time:
when the state monitoring Value of each back-end server in the main group is-1, starting the standby server group;
and when the state monitoring Value of each back-end server in the main group is 0, starting the standby server group.
4. The load balancing method according to claim 2, wherein: in the step (21), the threshold is set as follows: the CPU utilization rate is 85%; the threshold is set as follows: and 85% of memory.
5. A load balancing system, characterized by: the system comprises a message receiving module, a listener module, a Pool selecting module and a plurality of Pool modules; the message receiving module, the listener module and the Pool selecting module are sequentially connected, and the Pool selecting module is respectively connected with all the Pool modules;
the Pool module comprises a scheduling module, a performance monitoring module, a main group and a standby group, wherein the main group and the standby group are respectively provided with a plurality of back-end servers; the scheduling module is respectively connected with the main group and the standby group, the performance monitoring module is respectively connected with the main group and the standby group, and the performance monitoring module is connected with the scheduling module;
the performance monitoring module acquires operation indexes of a back-end server in the main group at preset time intervals, wherein the operation indexes comprise CPU utilization rate and memory utilization rate; calculating the current load state of each back-end server according to the acquired operation indexes of the back-end servers in the main group, and sending the current load state to the scheduling module; wherein, the load state comprises three states of full load, normal and unavailable;
the scheduling module receives the current load state of each back-end server in the main group sent by the performance monitoring module, and allocates the main group and the standby group according to the load state and the actual demand of the back-end servers in the main group.
6. The load balancing system of claim 5, wherein: the performance monitoring module calculates the current load state of each back-end server according to the acquired operation index of the back-end server in the main group, specifically as follows:
obtaining the current load state of each back-end server by calculating a state monitoring Value, wherein if the performance detection module cannot obtain the feedback of the back-end server, the back-end server is unavailable when the state monitoring Value is-1; if the detection program can obtain the feedback of the back-end server, Value ═ is (CPU utilization rate < set threshold) & (memory utilization rate < set threshold); if Value is 1, the back-end server is normal; if Value is 0, the backend server is already fully loaded.
7. The load balancing system of claim 6, wherein: the allocation of the active set and the standby set according to the actual requirement is as follows:
if the scheduling mode of the current Pool module is set to be a mixed mode of the standby group and the main group, the standby group does not need to be specially configured;
if the current Pool module scheduling mode is set to preferentially use the main group mode, at this time:
when the state monitoring Value of each back-end server in the main group is-1, starting the standby server group; and when the state monitoring Value of each back-end server in the main group is 0, starting the standby server group.
8. The load balancing system of claim 6, wherein: the set threshold in the status monitoring Value is as follows: the CPU utilization rate is 85%; the threshold is set as follows: and 85% of memory.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911330103.3A CN110995868A (en) | 2019-12-20 | 2019-12-20 | Load balancing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911330103.3A CN110995868A (en) | 2019-12-20 | 2019-12-20 | Load balancing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110995868A true CN110995868A (en) | 2020-04-10 |
Family
ID=70073766
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911330103.3A Pending CN110995868A (en) | 2019-12-20 | 2019-12-20 | Load balancing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110995868A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102611735A (en) * | 2011-12-21 | 2012-07-25 | 奇智软件(北京)有限公司 | Load balancing method and system of application services |
CN104780115A (en) * | 2014-01-14 | 2015-07-15 | 上海盛大网络发展有限公司 | Load balancing method and load balancing system in cloud computing environment |
US20150263958A1 (en) * | 2014-03-17 | 2015-09-17 | Electronics And Telecommunications Research Institute | Load balancing apparatus and method |
CN106131222A (en) * | 2016-08-29 | 2016-11-16 | 桂林浩新科技服务有限公司 | A kind of server load balancing concocting method and system |
CN106230986A (en) * | 2016-09-21 | 2016-12-14 | 南方电网科学研究院有限责任公司 | Resource adaptation scheduling system and method based on electric power PaaS cloud platform |
CN106656533A (en) * | 2015-10-29 | 2017-05-10 | 大唐移动通信设备有限公司 | Method and device for monitoring load processing of cluster system |
CN107689925A (en) * | 2017-09-28 | 2018-02-13 | 平安科技(深圳)有限公司 | Load balance optimization method and device based on cloud monitoring |
-
2019
- 2019-12-20 CN CN201911330103.3A patent/CN110995868A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102611735A (en) * | 2011-12-21 | 2012-07-25 | 奇智软件(北京)有限公司 | Load balancing method and system of application services |
CN104780115A (en) * | 2014-01-14 | 2015-07-15 | 上海盛大网络发展有限公司 | Load balancing method and load balancing system in cloud computing environment |
US20150263958A1 (en) * | 2014-03-17 | 2015-09-17 | Electronics And Telecommunications Research Institute | Load balancing apparatus and method |
CN106656533A (en) * | 2015-10-29 | 2017-05-10 | 大唐移动通信设备有限公司 | Method and device for monitoring load processing of cluster system |
CN106131222A (en) * | 2016-08-29 | 2016-11-16 | 桂林浩新科技服务有限公司 | A kind of server load balancing concocting method and system |
CN106230986A (en) * | 2016-09-21 | 2016-12-14 | 南方电网科学研究院有限责任公司 | Resource adaptation scheduling system and method based on electric power PaaS cloud platform |
CN107689925A (en) * | 2017-09-28 | 2018-02-13 | 平安科技(深圳)有限公司 | Load balance optimization method and device based on cloud monitoring |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109274707B (en) | Load scheduling method and device | |
CN107465708B (en) | CDN bandwidth scheduling system and method | |
CN102164116B (en) | Method, system and corresponding device for balancing load | |
CN109167674B (en) | Service node scoring method, Domain Name System (DNS) scheduling method and server | |
CN108712464A (en) | A kind of implementation method towards cluster micro services High Availabitity | |
CN109379774A (en) | Intelligent dispatching method, terminal device, fringe node cluster and intelligent dispatching system | |
CN104834722A (en) | CDN (Content Delivery Network)-based content management system | |
CN103607424B (en) | Server connection method and server system | |
US20140188801A1 (en) | Method and system for intelligent load balancing | |
CN112351083B (en) | Service processing method and network service system | |
CN110198332B (en) | Scheduling method and device for content distribution network node and storage medium | |
CN112350952B (en) | Controller distribution method and network service system | |
CN102891868A (en) | Load balancing method and device for distributed system | |
CN112202918B (en) | Load scheduling method, device, equipment and storage medium for long connection communication | |
CN107682442B (en) | Web connection method and device | |
CN112866394B (en) | Load balancing method, device, system, computer equipment and storage medium | |
CN113014611B (en) | Load balancing method and related equipment | |
CN107689878A (en) | TCP length connection SiteServer LBSs based on name scheduling | |
CN112311896B (en) | Health examination method, device, equipment and computer readable storage medium | |
CN115242798A (en) | Task scheduling method based on edge cloud, electronic equipment and storage medium | |
CN115373843A (en) | Method, device and medium for dynamically pre-judging optimal path equipment | |
Raghul et al. | Literature survey on traffic-based server load balancing using SDN and open flow | |
CN115086331A (en) | Cloud equipment scheduling method, device and system, electronic equipment and storage medium | |
CN113301079A (en) | Data acquisition method, system, computing device and storage medium | |
WO2016206433A1 (en) | Method and apparatus for balancing server load |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200410 |