CN110839086A - High-concurrency load balancing processing method - Google Patents

High-concurrency load balancing processing method Download PDF

Info

Publication number
CN110839086A
CN110839086A CN201911336517.7A CN201911336517A CN110839086A CN 110839086 A CN110839086 A CN 110839086A CN 201911336517 A CN201911336517 A CN 201911336517A CN 110839086 A CN110839086 A CN 110839086A
Authority
CN
China
Prior art keywords
node
nodes
determining
special
polling
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
Application number
CN201911336517.7A
Other languages
Chinese (zh)
Inventor
付晗
王海滨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jilin Civil Aviation Airport Group Co
Original Assignee
Jilin Civil Aviation Airport Group Co
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jilin Civil Aviation Airport Group Co filed Critical Jilin Civil Aviation Airport Group Co
Priority to CN201911336517.7A priority Critical patent/CN110839086A/en
Publication of CN110839086A publication Critical patent/CN110839086A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Abstract

The invention relates to a high-concurrency load balancing processing method, which comprises the following steps: setting a node on a main node and determining an IP and host file of the node; judging whether the downtime exists; if not, determining the capacity of a server pool according to the number of the nodes, and determining a polling mode according to the IP of the nodes; and if so, distributing the nodes according to the response time of the nodes. The invention can improve the utilization efficiency of the node and the session maintenance.

Description

High-concurrency load balancing processing method
Technical Field
The invention relates to the technical field of load balancing, in particular to a high-concurrency load balancing processing method.
Background
In the current high-concurrency data platform, if the number of the configuration nodes of the server side is too small, great pressure is easily caused to the server side, so that the user experience is influenced, and even the system is crashed. After the service end nodes are added, most of the current algorithms have unbalanced distribution of pressure distribution or cannot maintain user sessions under the condition of load balance, so that the user is disconnected.
Disclosure of Invention
The invention aims to provide a high-concurrency load balancing processing method which can improve the utilization efficiency of nodes and session maintenance.
In order to achieve the purpose, the invention provides the following scheme:
a high concurrency load balancing processing method comprises the following steps:
setting a node on a main node and determining an IP and host file of the node;
judging whether the downtime exists;
if not, determining the capacity of a server pool according to the number of the nodes, and determining a polling mode according to the IP of the nodes;
and if so, distributing the nodes according to the response time of the nodes.
Optionally, the capacity of the server pool is greater than or equal to the number of the nodes.
Optionally, the polling manner includes a hash manner and a weighting manner.
Optionally, the determining a polling manner according to the IP of the node includes:
judging whether the IP of the node is a special IP or not;
if not, acquiring the node priority, and determining a polling weight according to the node priority;
and if so, reallocating the node IP.
Optionally, the allocating the nodes according to the response time of the nodes includes: and preferentially distributing the nodes with short response time.
Optionally, the determining whether the IP of the node is a special IP includes:
acquiring a special IP list;
judging whether the node IP is positioned in the special IP list or not;
if yes, the node IP is a special IP;
if not, the node IP is a common IP.
Optionally, the polling weight of the node is determined according to the node priority and weight correspondence table.
Optionally, the node IP is redistributed according to the node and IP mapping table.
According to the specific embodiment provided by the invention, the invention discloses the following technical effects:
when the load balance calculation is carried out, the influence of node distribution and user session maintenance on the load performance is considered, so that the utilization efficiency of the nodes and the session maintenance are improved to the maximum extent.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings without inventive exercise.
Fig. 1 is a flowchart of a high concurrency load balancing processing method according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The invention aims to provide a high-concurrency load balancing processing method which can improve the utilization efficiency of nodes and session maintenance.
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in further detail below.
FIG. 1 is a flow chart of a high concurrency load balancing processing method of the present invention; as shown in fig. 1, a high concurrency load balancing processing method includes:
step 101: setting a node on a main node and determining an IP and host file of the node;
step 102: judging whether the downtime exists;
step 103: if not, determining the capacity of a server pool according to the number of the nodes, and determining a polling mode according to the IP of the nodes;
step 104: and if so, distributing the nodes according to the response time of the nodes.
Specifically, step 101 specifically sets the number of nodes that can be supported and the IP addresses of the nodes (which may be ported) on the master node, and configures their IP and corresponding host files on each node.
In step 103, the capacity of the server pool is greater than or equal to the number of the nodes, and the polling mode includes a hash mode and a weighting mode.
Specifically, the determining a polling manner according to the IP of the node includes:
judging whether the IP of the node is a special IP or not according to a given special IP list;
if the IP of the node is not in the special IP list, acquiring the priority of the node, and searching and determining the polling weight of the priority of the node according to a corresponding relation table of the priority of the node and the polling weight;
and if the IP of the node is in the special IP list, redistributing the node IP according to the node and the IP corresponding table.
In addition, the weighting manner in step 103 is to set a higher weight for the node server with better configuration (higher priority) and a lower weight for the node server with poorer performance (lower priority); according to the setting in the previous step, and by combining the corresponding relation between the node priority and the polling weight, an additional judgment condition can be set in the polling process, and how to better select and configure the nodes which are high or normally work by the nodes under the condition that the node server is down is processed.
The Hash mode can bind the IP to a fixed IP; in order to keep the session of the fixed IP address all the time, a node and an IP corresponding table are set by combining a hash mode, for some special access IPs, the special access IPs can be positioned on the fixed node according to a given special IP list, and the distribution of the IPs can be forced according to a distribution rule.
Step 104 specifically includes: and under the condition of downtime, allocating the requests according to the response time of the back-end server according to the load condition of the server nodes, wherein the allocation is carried out preferentially with short response time. Under the condition that the pressure of the whole site is very high, more nodes are in full load work, more downtime occurs at this time, the instant load condition of the server can be judged by acquiring the load condition and the response time of the nodes, then the other nodes are switched to under the condition that the CPU performance of the server reaches 80% or the occupied memory reaches 80% according to the preset judgment condition, and meanwhile, if the response time of the node exceeds 10 seconds, the next node is switched to, and the normal work of the node queue is ensured according to the short-response-time preferential distribution.
The node model and the load strategy related by the invention are as follows:
load balancing: the operation units are shared to execute. That is, we need a scheduler to ensure that all backend servers give full play to the performance, so as to keep the overall performance of the server cluster optimal, which is load balancing. A cheap, effective and transparent method derived for this situation is load balancing (LoadBalance), which is a technology for expanding the bandwidth of existing network devices and servers, increasing the throughput, enhancing the network data processing capability, and improving the flexibility and availability of the network.
The following strategies are mainly available:
1. polling (default)
Each request is distributed to different back-end servers one by one according to the time sequence, and if the back-end servers are down, the requests can be automatically rejected.
2. Assigning weights
The polling probability, weight and access ratio are specified to be in direct proportion, and the method is used for the condition that the performance of the back-end server is not uniform.
IP binding IP _ hash
Each request is distributed according to the hash result of the access ip (the same back-end server can be selected for the client in the same C-type address field, and the back-end server is replaced unless the back-end server is down), so that each visitor fixedly accesses one back-end server, and the problem of session can be solved.
Fair (third party)
The request is distributed according to the response time of the back-end server, and the request is preferentially distributed with short response time.
Url _ hash (third party)
The requests are distributed according to the hash result of accessing the urls, so that each url is directed to the same back-end server, and the back-end server is effective when caching.
The invention can also set the dispatching state of each server, and the commonly used state parameters are as follows:
# configuration load Balancing
# upstream indicates that the load balancing server pool defines a server pool named webserver
upstream webserver{
server IP1weight=5max_fails=1fail_timeout=2;
server IP2weight=3max_fails=1fail_timeout=2down;
server IP3weight=2max_fails=1fail_timeout=2backup;
}
Description of the parameters:
# max _ failures allows the number of request failures, defaults 1 when the maximum number is exceeded, returns an error defined by the proxy _ next _ upstream instruction,
# fail _ timeout after max _ failures has elapsed, time seconds to pause the server, max _ failures and fail _ timeout are used together in real application
# down indicates that the current server is not participating in load balancing for the moment.
The reserved backup machine of # backup requests the backup machine when all other non-backup machines are down or busy, so the pressure of the backup machine is the lightest.
The invention also discloses the following technical effects:
1. the load balance of each node can be satisfied.
2. Different node selection strategies can be configured according to the actual number of nodes.
3. User session maintenance can be completed, and the online condition of a user cannot be influenced by node skipping.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
The principles and embodiments of the present invention have been described herein using specific examples, which are provided only to help understand the method and the core concept of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, the specific embodiments and the application range may be changed. In view of the above, the present disclosure should not be construed as limiting the invention.

Claims (8)

1. A high concurrency load balancing processing method is characterized by comprising the following steps:
setting a node on a main node and determining an IP and host file of the node;
judging whether the downtime exists;
if not, determining the capacity of a server pool according to the number of the nodes, and determining a polling mode according to the IP of the nodes;
and if so, distributing the nodes according to the response time of the nodes.
2. The method according to claim 1, wherein the capacity of the server pool is greater than or equal to the number of the nodes.
3. The method according to claim 1, wherein the polling scheme includes a hash scheme and a weighting scheme.
4. The method according to claim 1 or 3, wherein the determining a polling manner according to the IP of the node includes:
judging whether the IP of the node is a special IP or not;
if not, acquiring the node priority, and determining a polling weight according to the node priority;
and if so, reallocating the node IP.
5. The method according to claim 1, wherein the allocating the nodes according to their response times includes: and preferentially distributing the nodes with short response time.
6. The method according to claim 4, wherein the determining whether the IP of the node is a special IP comprises:
acquiring a special IP list;
judging whether the node IP is positioned in the special IP list or not;
if yes, the node IP is a special IP;
if not, the node IP is a common IP.
7. The method according to claim 4, wherein the polling weight of the node is determined according to a node priority and weight correspondence table.
8. The method according to claim 4, wherein the node IPs are redistributed according to a node and IP mapping table.
CN201911336517.7A 2019-12-23 2019-12-23 High-concurrency load balancing processing method Pending CN110839086A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911336517.7A CN110839086A (en) 2019-12-23 2019-12-23 High-concurrency load balancing processing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911336517.7A CN110839086A (en) 2019-12-23 2019-12-23 High-concurrency load balancing processing method

Publications (1)

Publication Number Publication Date
CN110839086A true CN110839086A (en) 2020-02-25

Family

ID=69578655

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911336517.7A Pending CN110839086A (en) 2019-12-23 2019-12-23 High-concurrency load balancing processing method

Country Status (1)

Country Link
CN (1) CN110839086A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030126200A1 (en) * 1996-08-02 2003-07-03 Wolff James J. Dynamic load balancing of a network of client and server computer
CN1937534A (en) * 2006-09-20 2007-03-28 杭州华为三康技术有限公司 Load balance realizing method and load balance device
CN102611735A (en) * 2011-12-21 2012-07-25 奇智软件(北京)有限公司 Load balancing method and system of application services
WO2015058525A1 (en) * 2013-10-25 2015-04-30 华为技术有限公司 Distributed method and device for processing data stream
CN105282259A (en) * 2015-11-13 2016-01-27 深圳联友科技有限公司 Load balancing allocation method, agent and system used for background cluster service
CN106375355A (en) * 2015-07-20 2017-02-01 中兴通讯股份有限公司 Load balancing processing method and apparatus
CN107645540A (en) * 2017-08-21 2018-01-30 西安交大捷普网络科技有限公司 The load-balancing method of web application systems
CN109104500A (en) * 2018-09-29 2018-12-28 广东省信息工程有限公司 A kind of server load balancing method and device of dynamic adjustment
CN109933431A (en) * 2019-03-11 2019-06-25 浪潮通用软件有限公司 A kind of intelligent client load equalization methods and system
CN109951566A (en) * 2019-04-02 2019-06-28 深圳市中博科创信息技术有限公司 A kind of Nginx load-balancing method, device, equipment and readable storage medium storing program for executing
US20190373053A1 (en) * 2018-05-29 2019-12-05 Red Hat, Inc. Ranked session affinity to improve load balancing efficiency for stateful requests

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030126200A1 (en) * 1996-08-02 2003-07-03 Wolff James J. Dynamic load balancing of a network of client and server computer
CN1937534A (en) * 2006-09-20 2007-03-28 杭州华为三康技术有限公司 Load balance realizing method and load balance device
CN102611735A (en) * 2011-12-21 2012-07-25 奇智软件(北京)有限公司 Load balancing method and system of application services
WO2015058525A1 (en) * 2013-10-25 2015-04-30 华为技术有限公司 Distributed method and device for processing data stream
CN106375355A (en) * 2015-07-20 2017-02-01 中兴通讯股份有限公司 Load balancing processing method and apparatus
CN105282259A (en) * 2015-11-13 2016-01-27 深圳联友科技有限公司 Load balancing allocation method, agent and system used for background cluster service
CN107645540A (en) * 2017-08-21 2018-01-30 西安交大捷普网络科技有限公司 The load-balancing method of web application systems
US20190373053A1 (en) * 2018-05-29 2019-12-05 Red Hat, Inc. Ranked session affinity to improve load balancing efficiency for stateful requests
CN109104500A (en) * 2018-09-29 2018-12-28 广东省信息工程有限公司 A kind of server load balancing method and device of dynamic adjustment
CN109933431A (en) * 2019-03-11 2019-06-25 浪潮通用软件有限公司 A kind of intelligent client load equalization methods and system
CN109951566A (en) * 2019-04-02 2019-06-28 深圳市中博科创信息技术有限公司 A kind of Nginx load-balancing method, device, equipment and readable storage medium storing program for executing

Similar Documents

Publication Publication Date Title
JP6671468B2 (en) Method and apparatus for optimizing load distribution based on cloud monitoring
CN109274707B (en) Load scheduling method and device
CN108499100B (en) Cloud game error recovery method and system based on edge calculation
CN103391299B (en) Load-balancing method and SiteServer LBS
WO2016074323A1 (en) Http scheduling system and method of content delivery network
US9733983B2 (en) System and method for surge protection and rate acceleration in a traffic director environment
US9154549B2 (en) Dynamic server farms
CN107483390B (en) Cloud rendering network deployment subsystem, system and cloud rendering platform
CN108933829A (en) A kind of load-balancing method and device
CN103701916A (en) Dynamic load balancing method of distributed storage system
JP2013525931A (en) Dynamic binding used for content delivery
Semchedine et al. Task assignment policies in distributed server systems: A survey
US20230069240A1 (en) Dynamic cloning of application infrastructures
CN109951566A (en) A kind of Nginx load-balancing method, device, equipment and readable storage medium storing program for executing
US8458702B1 (en) Method for implementing user space up-calls on java virtual machine before/after garbage collection
CN112202918A (en) Load scheduling method, device, equipment and storage medium for long connection communication
CN105721552A (en) Method for implementing dynamic load balancing based on domain name system (DNS) and DNS
JP2005182641A (en) Dynamic load distribution system and dynamic load distribution method
Qu et al. Mitigating impact of short‐term overload on multi‐cloud web applications through geographical load balancing
Hayat et al. Efficient energy utilization in cloud fog environment
CN110597619A (en) Load balancing method, load balancing device and load balancing server
Chen et al. A fast converging mechanism for load balancing among sdn multiple controllers
CN110839086A (en) High-concurrency load balancing processing method
CN109302302A (en) Service scalable method, system and the computer readable storage medium of network element
EP2321931B1 (en) Shared hosting using host name affinity

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: 20200225