CN116781629A - Load balancing method with flow control function based on time delay - Google Patents
Load balancing method with flow control function based on time delay Download PDFInfo
- Publication number
- CN116781629A CN116781629A CN202310878173.2A CN202310878173A CN116781629A CN 116781629 A CN116781629 A CN 116781629A CN 202310878173 A CN202310878173 A CN 202310878173A CN 116781629 A CN116781629 A CN 116781629A
- Authority
- CN
- China
- Prior art keywords
- load balancing
- node
- delay
- request
- flow control
- 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
- 238000000034 method Methods 0.000 title claims abstract description 36
- 238000001514 detection method Methods 0.000 claims abstract description 27
- 239000000523 sample Substances 0.000 claims description 14
- 230000008569 process Effects 0.000 claims description 9
- 230000001960 triggered effect Effects 0.000 claims description 4
- 230000009286 beneficial effect Effects 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 4
- 230000004075 alteration Effects 0.000 description 1
- 230000010485 coping Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000737 periodic effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention relates to the technical field of development of a back-end server, in particular to a load balancing method with a flow control function based on time delay, which comprises the following steps: the load balancing module receives cluster node registration; the load balancing module receives the service request; solving an original request; calculating the request round trip delay according to the detection packet sending time stamp and the current system time; calculating the round trip delay of the request, and comparing the delay with idle state delay recorded in the flow control information; the beneficial effects are as follows: according to the load balancing method with the flow control function based on time delay, which is provided by the invention, the detection of congestion is more sensitive through time delay detection, and congestion can be detected when congestion begins; according to the congestion condition estimation of the cluster nodes, the request sending rate is dynamically adjusted, so that the back-end node can work near the maximum throughput and the low processing delay is ensured.
Description
Technical Field
The invention relates to the technical field of development of a back-end server, in particular to a load balancing method with a flow control function based on time delay.
Background
With the rapid development of internet information technology, AI, cloud computing, big data, internet of things and various industries are deeply integrated, the various industries accelerate digital transformation, and the online system which is used for bearing more and more businesses needs to process massive business requests and provide uninterrupted stable services.
In the prior art, any high-performance single physical server cannot be used for increasingly massive business processing scenes, so that the service is generally designed into a cluster form, and processing tasks are shared by any plurality of background services deployed on different physical nodes together, so that the transverse elastic expansion capability is provided for coping with more and more business processing. In order to coordinate the load of the working nodes in the cluster, various load balancing strategies are generated. Common load balancing policies are polling, weighted polling, random, least connected, and source address hashing for session sticky, etc.
However, these load balancing strategies are based on the assumption that the processing capacities of the cluster nodes are equal, and some load balancing strategies are based on pre-estimating the processing capacities of different cluster nodes according to indexes such as server hardware resources and the like.
Disclosure of Invention
The invention aims to provide a load balancing method with a flow control function based on time delay, which aims to solve the problems in the background technology.
In order to achieve the above purpose, the present invention provides the following technical solutions: a load balancing method with a flow control function based on time delay, the load balancing method comprising the following steps:
the load balancing module receives cluster node registration;
the load balancing module receives the service request;
solving an original request;
calculating the request round trip delay according to the detection packet sending time stamp and the current system time;
and calculating the round trip delay of the request, and comparing the delay with idle state delay recorded in the flow control information.
Preferably, after the load balancing module receives the cluster node registration, the node enters an idle state.
Preferably, after the load balancing module receives the service request, if there are cluster nodes in an idle state, the nodes enter a delay detection state, and the request is encapsulated into a detection packet and forwarded to the nodes.
Preferably, after receiving the probe packet, the cluster node solves the original request, processes the original request, and records the processing time of the original request; and after the cluster node processes the original request, sending a detection packet ack message to the load balancing module.
Preferably, after receiving the probe packet ack, the load balancing module calculates the round trip delay of the request as the delay of the service idle state according to the sending time stamp of the probe packet and the current system time if the node is in the probe state, and records the time delay; the node is switched to a normal working state, the working period duration is set, and a phase ending timer is started.
Preferably, after the load balancing module receives the detection packet ack, if the node is in a normal working state, calculating the request round trip delay, comparing idle state delay recorded in the delay flow control information, if the delay is obviously higher than the idle delay, indicating that the node has reached the maximum throughput, and queuing is occurred; then the real-time forwarding rate is reduced; if the time delay is equal to or lower than the idle time delay, the node is indicated to have no queuing condition, and the real-time forwarding rate is increased.
Preferably, when the load balancing module receives the service request and there is no node in an idle state, the load balancing module selects a working node according to the real-time forwarding rate of the node in the working state, and the request sent to the target node is uniformly packaged into a probe packet format, so that the forwarding rate is adjusted in real time according to the probe packet ack.
Preferably, after the working state end timer is triggered, the node is switched from the working state to the emptying state, the node in the emptying state does not reassign the request, and the state lasts for N seconds, so that the node is ensured to process the in-transit request; after the emptying state is finished for N seconds, the node enters an idle state and enters the next state circulation period.
Compared with the prior art, the invention has the beneficial effects that:
according to the load balancing method with the flow control function based on time delay, which is provided by the invention, the detection of congestion is more sensitive through time delay detection, and congestion can be detected when congestion begins; according to the congestion condition estimation of the cluster nodes, the request sending rate is dynamically adjusted, so that the back-end node can work near the maximum throughput and the low processing delay is ensured; the work of the cluster nodes is divided into countless periods, and the periods do not influence each other. Through periodic state transition, the system has better self-adaptive fault tolerance capability. For example, the idle delay detected in a certain period is inaccurate, and when the next period is entered, the problem is corrected by restarting the detection.
Drawings
FIG. 1 is a schematic diagram of a load balancing module receiving cluster node registration according to the present invention;
FIG. 2 is a schematic diagram of a load balancing module receiving a service request according to the present invention;
FIG. 3 is a schematic diagram of a load balancing module receiving a probing packet according to the present invention;
fig. 4 is a schematic diagram of connection between a load balancing module and a cluster node according to the present invention.
Detailed Description
In order to make the objects, technical solutions, and advantages of the present invention more apparent, the embodiments of the present invention will be further described in detail with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are some, but not all, embodiments of the present invention, are intended to be illustrative only and not limiting of the embodiments of the present invention, and that all other embodiments obtained by persons of ordinary skill in the art without making any inventive effort are within the scope of the present invention.
Referring to fig. 1 to 4, the present invention provides a technical solution: a load balancing method with a flow control function based on time delay, the load balancing method comprising the following steps:
1. the load balancing module receives cluster node registration. The node enters an idle state.
2. The load balancing module receives the service request, if there is a cluster node in an idle state, the node enters a time delay detection state, and packages the request into a detection packet and forwards the detection packet to the node.
The following is the basic format of the probe packet
3. After the cluster node receives the detection packet, the cluster node solves the original request, processes the original request, and records the processing time of the original request. And after the cluster node processes the original request, sending a detection packet ack message to the load balancing module.
The following is the basic format of the probe ack packet
4. After receiving the probe packet ack, the load balancing module calculates the round trip delay of the request according to the sending time stamp of the probe packet and the current system time, if the node is in the probe state, and takes the round trip delay as the delay of the service idle state and records the delay. The node is switched to a normal working state, and the working period duration is set. The end of this phase timer (triggered after M seconds) is started.
Initializing the following flow control information
5. After receiving the detection packet ack, the load balancing module calculates the round trip delay of the request if the node is in a normal working state, compares the delay with the idle state delay recorded in the flow control information, and if the delay is obviously higher than the idle delay, the load balancing module indicates that the node has reached the maximum throughput and the queuing condition occurs. The real-time forwarding rate is reduced. If the time delay is equal to or lower than the idle time delay, the node is indicated to have no queuing condition, and the real-time forwarding rate is increased.
6. When the load balancing module receives the service request, the load balancing module has no node in an idle state. The working node to which the forwarding is directed is selected based on the real-time forwarding rate of the node in the working state. Requests to the target node are uniformly encapsulated in probe packet format. So as to adjust the forwarding rate in real time based on the probing packet ack.
7. When the working state ending timer is triggered, the node is switched from the working state to the emptying state, and the node in the emptying state does not reassign the request. This state lasts for N seconds, to ensure that the node has processed the in-transit request.
8. After the end of the N seconds of the drain state, the node enters an idle state. The next state cycle period is entered.
As the node belongs to, the idle state, the detection state and the working state do not affect the normal service request processing, and only the node in the emptying state does not send the service request any more in a short time. As long as the ratio of the duration M of the working state to the duration N of the queuing state is reasonably controlled, the node utilization rate is not obviously affected.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.
Claims (8)
1. A load balancing method with flow control function based on time delay is characterized in that: the load balancing method comprises the following steps:
the load balancing module receives cluster node registration;
the load balancing module receives the service request;
solving an original request;
calculating the request round trip delay according to the detection packet sending time stamp and the current system time;
and calculating the round trip delay of the request, and comparing the delay with idle state delay recorded in the flow control information.
2. The load balancing method with flow control function based on time delay according to claim 1, wherein the method is characterized in that: and after the load balancing module receives the cluster node registration, the node enters an idle state.
3. The load balancing method with flow control function based on time delay according to claim 1, wherein the method is characterized in that: after receiving the service request, the load balancing module provides the cluster nodes in idle state, the nodes enter a time delay detection state, and the request is packaged into detection packets and forwarded to the nodes.
4. The load balancing method with flow control function based on time delay according to claim 1, wherein the method is characterized in that: after receiving the detection packet, the cluster node solves the original request, processes the original request, and records the processing time of the original request; and after the cluster node processes the original request, sending a detection packet ack message to the load balancing module.
5. The load balancing method with flow control function based on time delay according to claim 1, wherein the method is characterized in that: after receiving the detection packet ack, the load balancing module calculates the round-trip delay of the request as the delay of the service idle state according to the detection packet sending time stamp and the current system time if the node is in the detection state, and records the time delay; the node is switched to a normal working state, the working period duration is set, and a phase ending timer is started.
6. The method for load balancing with flow control function based on time delay according to claim 5, wherein the method comprises the following steps: after receiving the detection packet ack, the load balancing module calculates the round trip delay of the request if the node is in a normal working state, compares idle state delay recorded in the delay flow control information, and if the delay is obviously higher than the idle delay, the load balancing module indicates that the node has reached the maximum throughput and queuing condition occurs; then the real-time forwarding rate is reduced; if the time delay is equal to or lower than the idle time delay, the node is indicated to have no queuing condition, and the real-time forwarding rate is increased.
7. The method for load balancing with flow control function based on time delay according to claim 6, wherein the method comprises the following steps: when the load balancing module receives the service request and the node which is not in the idle state, the load balancing module selects the working node which is sent to according to the real-time forwarding rate of the node in the working state, and the request which is sent to the target node is uniformly packaged into a probe packet format so as to adjust the forwarding rate in real time according to the probe packet.
8. The method for load balancing with flow control function based on time delay according to claim 7, wherein the method comprises the following steps: when the working state ending timer is triggered, the node is switched from the working state to the emptying state, the node in the emptying state does not reassign the request, and the state lasts for N seconds, so that the node is ensured to process the in-transit request; after the emptying state is finished for N seconds, the node enters an idle state and enters the next state circulation period.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310878173.2A CN116781629A (en) | 2023-07-18 | 2023-07-18 | Load balancing method with flow control function based on time delay |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310878173.2A CN116781629A (en) | 2023-07-18 | 2023-07-18 | Load balancing method with flow control function based on time delay |
Publications (1)
Publication Number | Publication Date |
---|---|
CN116781629A true CN116781629A (en) | 2023-09-19 |
Family
ID=87993061
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202310878173.2A Pending CN116781629A (en) | 2023-07-18 | 2023-07-18 | Load balancing method with flow control function based on time delay |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN116781629A (en) |
-
2023
- 2023-07-18 CN CN202310878173.2A patent/CN116781629A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US20210250265A1 (en) | Health status monitoring for services provided by computing devices | |
US20210036907A1 (en) | Methods and apparatuses for pushing a message | |
US8374079B2 (en) | Proxy server, communication system, communication method and program | |
CN110858843B (en) | Service request processing method and device and computer readable storage medium | |
CN105007337A (en) | Cluster system load balancing method and system thereof | |
WO2020134840A1 (en) | Data distribution method and related product | |
CN103873523A (en) | Client cluster access method and device | |
WO2017185615A1 (en) | Method for determining service status of service processing device and scheduling device | |
US11997066B2 (en) | Data transmission system and method for edge computing and computer readable medium thereof | |
CN111405531A (en) | Method, medium, terminal and device for improving communication quality | |
CN111338575A (en) | Storage service quality control method, device, equipment and storage medium | |
US8467313B1 (en) | PHY bandwidth estimation from backpressure patterns | |
CN116781629A (en) | Load balancing method with flow control function based on time delay | |
CN112866338A (en) | Server state detection method and device | |
CN113535344A (en) | Network data processing method and device, server and storage medium | |
CN111954031B (en) | Method and system for dynamically adjusting frame extraction rate of video stream | |
US20220141153A1 (en) | Server communication method, broadband access server, and system | |
CN114584573A (en) | Node machine information synchronization method based on long polling mechanism | |
WO2017165999A1 (en) | Network service implementation method, service controller, and communication system | |
CN110519397B (en) | SIP terminal access load balancing system and method based on NGINX | |
CN111641698B (en) | Data statistical method, system, equipment and storage medium | |
CN115150400B (en) | Service fault processing method and device, cloud service platform and storage medium | |
CN114793234B (en) | Message processing method, device, equipment and storage medium | |
CN110943886B (en) | Performance data transmission method and device | |
CN115297115A (en) | Cloud computing system and scheduling method thereof |
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 |