A health check system in a load balancing device
By designing a health check module in the load balancing device to summarize the health check results of the back-end server, the problems of low reliability and poor forwarding performance in the prior art are solved, and more efficient health check notifications and forwarding performance are achieved.
Patent Information
- Application Number
- CN202211633488.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-19
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2042-12-19
AI Technical Summary
The existing load balancing equipment health check system is prone to misjudgment in the case of network congestion, resulting in low reliability of health check notifications and affecting the performance of the forwarding module.
A health check system was designed, in which the health check module summarizes the health check sub-results of the backend server and outputs the health check total results based on the preset threshold, instead of handing the results to the forwarding module for summary judgment, thereby reducing the forwarding module's Workloads, improve reliability and forwarding performance of health check notices.
By reducing the workload of the forwarding module, the forwarding performance of the load balancing device is improved, and the message loss caused by excessive health check notices is avoided, which improves the reliability of health check notices.
Smart Images

Figure CN115914027B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of equipment health check, and in particular to a health check system in a load balancing device. Background Art
[0002] The load balancing device will periodically send detection messages to the backend servers to check their operating status. This process is called health check. For example, the load balancing device sends an ICMRequest message to the backend server group every 5 seconds. If one of the servers is running normally, it will reply to the load balancing device with an ICMReply message. After the load balancing device receives the ICMReply message from the server, it considers that the server is running normally. If the load balancing device does not receive the ICMP reply message from a server, the load balancing device considers that the server is abnormal. The load balancing device will not distribute traffic to the backend servers with abnormal health check status, but only to those backend servers with normal health check status. That is, only servers with normal status can undertake business traffic, which improves the reliability of the business. When the abnormal backend server returns to normal, the health check will also detect it and re-add it to the load cluster and re-carry business traffic.
[0003] Normally, only one method is used to perform health checks on a backend server, such as Internet Control Message Protocol (ICMP), Transmission Control Protocol (TCP), and User Datagram Protocol (UDP). In the case of network congestion, health check messages are easily discarded, so health checks are prone to misjudgment. In order to increase fault tolerance, N (N>1, up to 16) methods can be used to perform health checks on a backend server at the same time. As long as the results of M (M≤N) health checks are normal, the backend server is considered normal.
[0004] In the existing health check system, such as Figure 2As shown, in order to increase fault tolerance, the health check module uses N (up to 16) methods to perform health checks on each backend server at the same time, and sends all these health check results to the forwarding module. In this case, the forwarding module needs to summarize a large number of health check results and perform a large number of analysis and decisions, which will consume the performance of the forwarding module and affect the forwarding performance to a certain extent. The health check notification is transmitted through the port socket. When the number of health check results is relatively large, the number of interactive messages is relatively large, so the message channel is prone to congestion, resulting in message loss, which will cause abnormal health results. In summary, the reliability of health check notifications in existing health check systems is low, and the forwarding performance of the forwarding module is poor. Summary of the invention
[0005] The purpose of the present invention is to provide a health check system in a load balancing device, which improves the reliability of health check notifications and the forwarding performance of a forwarding module.
[0006] To achieve the above object, the present invention provides the following solutions:
[0007] A health check system in a load balancing device, the health check system comprising: a health check module and a forwarding module; the forwarding module and a backend server are both connected to the health check module; the forwarding module is connected to the backend server;
[0008] The health check module includes:
[0009] The inspection submodule is connected to the backend server and is used to inspect the backend server using N preset health inspection methods to obtain N current health inspection results; the health inspection result is a normal result or an abnormal result; N>1;
[0010] A result output submodule, connected to the inspection submodule, for outputting the total result of the current number of health inspections of the backend server according to a preset threshold and all the current number of health inspection results;
[0011] The forwarding module comprises:
[0012] The traffic distribution submodule is connected to the result output submodule and is used to control the traffic distribution to the backend server according to the total results of the current number of health checks.
[0013] Optionally, the health check system further includes: an inspection method storage submodule; the inspection method storage submodule is connected to the inspection submodule;
[0014] The inspection method storage submodule is used to store the preset health inspection method.
[0015] Optionally, the health check module further includes: an inspection method acquisition submodule; the inspection method acquisition submodule is connected to the inspection method storage submodule and the inspection submodule respectively;
[0016] The inspection method acquisition submodule is used to obtain the preset health inspection method from the inspection method storage submodule, and send the preset health inspection method to the inspection submodule.
[0017] Optionally, the health check module further includes: a preset threshold storage submodule; the preset threshold storage submodule is connected to the result output submodule;
[0018] The preset threshold storage submodule is used to store the preset threshold.
[0019] Optionally, the result output submodule includes:
[0020] A first judgment unit, connected to the inspection submodule, is used to judge whether the number of normal results in the R health inspection sub-results is greater than or equal to the preset threshold value, and obtain a first judgment result; <N;
[0021] A first execution unit, connected to the first judgment unit, is used to control the inspection submodule to stop the current number of inspections when the first judgment result is yes, and determine the total result of the current number of health inspections as a normal total result;
[0022] A second execution unit, connected to the first judgment unit, is used to control the inspection submodule to continue the current number of inspections when the first judgment result is no;
[0023] A second judgment unit, connected to the inspection submodule, is used to judge whether the number of normal results in the N current health inspection results is greater than or equal to the preset threshold when the inspection submodule executes N preset health inspection methods, and obtain a second judgment result;
[0024] A third execution unit, connected to the second judgment unit, is used to determine the total result of the current number of health checks as a normal total result when the second judgment result is yes;
[0025] a fourth execution unit, connected to the second judgment unit, and configured to determine the health check total result as an abnormal total result when the second judgment result is no;
[0026] The unit to be forwarded is respectively connected to the first execution unit, the third execution unit, the fourth execution unit and the forwarding module, and is used to send the total result of the current health check to the forwarding module when the total result of the current health check is different from the total result of the previous health check or the notification interval is reached.
[0027] Optionally, the traffic distribution submodule includes:
[0028] A third judgment unit, connected to the result output submodule, is used to judge whether the total result of the current number of health checks is a normal result, and reach a third judgment result;
[0029] a fifth execution unit, connected to the third judgment unit, and configured to continue distributing traffic to the backend server when the third judgment result is yes;
[0030] The sixth execution unit is connected to the third judgment unit, and is used to stop distributing traffic to the backend server when the third judgment result is no.
[0031] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0032] The present invention discloses a health check system in a load balancing device, comprising: a health check module and a forwarding module; the forwarding module and the back-end server are both connected to the health check module; the forwarding module is connected to the back-end server; the health check module comprises: a check submodule, connected to the back-end server, used to check the back-end server using N preset health check methods to obtain N current health check results; the health check result is a normal result or an abnormal result; N>1; a result output submodule, connected to the check submodule, used to output the current health check total result of the back-end server according to a preset threshold and all the current health check results; the forwarding module comprises: a traffic distribution submodule, connected to the result output submodule, used to control the traffic distribution to the back-end server according to the current health check total result. The present invention utilizes the health check module to summarize the health check results of the back-end servers to obtain the total health check result, and no longer puts it into the forwarding module for summary judgment, thereby reducing the work of the forwarding module and allowing the computing power of the forwarding module to be used for traffic distribution as much as possible, thereby improving the forwarding performance of the load balancing device; in addition, it can also reduce unnecessary health check notifications between the forwarding module and the health check module, thereby avoiding the loss of health check notifications due to too many health check notifications, and improving the reliability of the health check notifications and the forwarding performance of the forwarding module. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0034] Figure 1 A schematic diagram of the structure of a health check system in a load balancing device provided in an embodiment of the present invention;
[0035] Figure 2 This is a schematic diagram of the existing health check system structure;
[0036] Figure 3 The figure is a schematic diagram of the health check process based on the health check system in the load balancing device. DETAILED DESCRIPTION
[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0038] The purpose of the present invention is to provide a health check system in a load balancing device, aiming to improve the reliability of health check notifications and the forwarding performance of a forwarding module.
[0039] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0040] Figure 1 A schematic diagram of the structure of a health check system in a load balancing device provided in an embodiment of the present invention. Figure 1 As shown, the health check system in the load balancing device in this embodiment includes: a health check module 1 and a forwarding module 2; the forwarding module 2 and the backend server 3 are both connected to the health check module 1; the forwarding module 2 is connected to the backend server 3.
[0041] Health check module 1, including:
[0042] The inspection submodule 11 is connected to the backend server 3 and is used to inspect the backend server 3 using N preset health inspection methods to obtain N current health inspection results; the health inspection result is a normal result or an abnormal result; N>1. Specifically, N can be set to 16 at most.
[0043] The result output submodule 12 is connected to the inspection submodule 11 and is used to output the total health inspection results of the current number of backend servers 3 according to a preset threshold and all the health inspection results of the current number of times.
[0044] Forwarding module 2, including:
[0045] The traffic distribution submodule 21 is connected to the result output submodule 12 and is used to control the traffic distribution to the backend server 3 according to the total results of the current number of health checks.
[0046] As an optional implementation, the health check system further includes: an inspection method storage submodule; the inspection method storage submodule is connected to the inspection submodule 11.
[0047] The inspection method storage submodule is used to store preset health inspection methods.
[0048] As an optional implementation, the health check module 1 further includes: an inspection method acquisition submodule; the inspection method acquisition submodule is connected to the inspection method storage submodule and the inspection submodule 11 respectively.
[0049] The inspection method acquisition submodule is used to obtain a preset health inspection method from the inspection method storage submodule, and send the preset health inspection method to the inspection submodule 11 .
[0050] As an optional implementation, the health check module 1 further includes: a preset threshold storage submodule; the preset threshold storage submodule is connected to the result output submodule 12.
[0051] The preset threshold storage submodule is used to store the preset threshold.
[0052] As an optional implementation, the result output submodule 12 includes:
[0053] The first judgment unit is connected to the inspection submodule 11 and is used to judge whether the number of normal results in the R health inspection results is greater than or equal to a preset threshold value to obtain a first judgment result; <N。
[0054] The first execution unit is connected to the first judgment unit, and is used to control the inspection submodule 11 to stop the current number of inspections when the first judgment result is yes, and determine the total result of the current number of health inspections as a normal total result.
[0055] The second execution unit is connected to the first judgment unit, and is used to control the inspection submodule 11 to continue the current number of inspections when the first judgment result is no.
[0056] The second judgment unit is connected to the inspection submodule 11, and is used to determine whether the number of normal results in the N current health check results is greater than or equal to a preset threshold when the inspection submodule 11 executes N preset health check methods, so as to obtain a second judgment result.
[0057] The third execution unit is connected to the second judgment unit, and is used to determine the total result of the current number of health checks as a normal total result when the second judgment result is yes.
[0058] The fourth execution unit is connected to the second judgment unit, and is used to determine the overall health check result as an abnormal overall result when the second judgment result is no.
[0059] The forwarding unit is connected to the first execution unit, the third execution unit, the fourth execution unit and the forwarding module 2 respectively, and is used to send the current total health check result to the forwarding module 2 when the current total health check result is different from the previous total health check result or the notification interval is reached.
[0060] As an optional implementation, the traffic distribution submodule 21 includes:
[0061] The third judgment unit is connected to the result output submodule 12 and is used to judge whether the total result of the current number of health checks is a normal result to reach a third judgment result.
[0062] The fifth execution unit is connected to the third judgment unit, and is used to continue distributing traffic to the backend server 3 when the third judgment result is yes.
[0063] The sixth execution unit is connected to the third judgment unit, and is used to stop distributing traffic to the backend server 3 when the third judgment result is no.
[0064] like Figure 3 As shown, the health check process of the load balancing device based on the health check system in the load balancing device includes:
[0065] (1) The forwarding module notifies the health check module to use N preset health check methods to perform health checks on specific backend servers, and sets the preset threshold to M (M≤N).
[0066] (2) The health check module starts these N health checks on the backend server one by one. For any of the checks, if the reply message (ICMP reply message) from the backend server can be received in time and the message meets expectations, it is considered that the status of this server under this health check is normal; otherwise, it is considered that the status of this server under this health check is abnormal.
[0067] (3) After collecting R (R ≤ N) health check results, further judgment is made as follows:
[0068] Assume that among the R health check results, the number of servers that are in normal state is S (the corresponding number of servers in abnormal state is NS).
[0069] (4) If S is greater than or equal to M, the backend server status is considered normal, otherwise, continue with the remaining health checks.
[0070] (5) If all N health checks are completed (R=N) (the end time of each health check is different. If a health check is not completed, it is impossible to know whether the status of the backend server it checks is normal or abnormal), the backend server status is considered abnormal, otherwise return to (3) and wait for the next round of judgment (since the working time of each health check is different, it is necessary to wait for all health checks to be completed to prevent misjudgment).
[0071] (6) After the judgment is completed, if the total result of the previous health check has changed or the notification interval has been reached (the health check module needs to notify the forwarding module of the total result of the health check. The notification has a frequency, such as once per second, which is called the notification interval), then the total result of the health check (including two situations: 0 represents an abnormal backend server; 1 represents a normal backend server) will be notified to the forwarding module. The forwarding module is responsible for traffic distribution. There are several backend servers connected to the load balancing device. If a backend server is in an abnormal state, this backend server will not participate in traffic distribution; only servers in normal state can participate in traffic distribution, otherwise wait for the next round of judgment.
[0072] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0073] This article uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the system and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A health check system in a load balancing device, characterized in that: The health check system comprises: a health check module and a forwarding module; the forwarding module and the backend server are both connected to the health check module; the forwarding module is connected to the backend server; The health check module includes: The inspection submodule is connected to the backend server and is used to inspect the backend server using N preset health inspection methods to obtain N current health inspection results; the health inspection result is a normal result or an abnormal result; N>1; A result output submodule, connected to the inspection submodule, is used to output the total health inspection result of the current number of backend servers according to a preset threshold and all the health inspection results of the current number of times; The forwarding module comprises: A traffic distribution submodule, connected to the result output submodule, for controlling the traffic distribution to the backend server according to the total result of the current number of health checks; The result output submodule includes: A first judgment unit, connected to the inspection submodule, is used to judge whether the number of normal results in the R health inspection sub-results is greater than or equal to the preset threshold value, and obtain a first judgment result; <N; A first execution unit, connected to the first judgment unit, is used to control the inspection submodule to stop the current number of inspections when the first judgment result is yes, and determine the total result of the current number of health inspections as a normal total result; A second execution unit, connected to the first judgment unit, is used to control the inspection submodule to continue the current number of inspections when the first judgment result is no; A second judgment unit, connected to the inspection submodule, is used to judge whether the number of normal results in the N current health inspection results is greater than or equal to the preset threshold when the inspection submodule executes N preset health inspection methods, and obtain a second judgment result; A third execution unit, connected to the second judgment unit, is used to determine the total result of the current number of health checks as a normal total result when the second judgment result is yes; a fourth execution unit, connected to the second judgment unit, and configured to determine the health check total result as an abnormal total result when the second judgment result is no; The unit to be forwarded is respectively connected to the first execution unit, the third execution unit, the fourth execution unit and the forwarding module, and is used to send the total result of the current health check to the forwarding module when the total result of the current health check is different from the total result of the previous health check or the notification interval is reached.
2. The health check system in the load balancing device according to claim 1, characterized in that: The health check system further includes: an inspection method storage submodule; the inspection method storage submodule is connected to the inspection submodule; The inspection method storage submodule is used to store the preset health inspection method.
3. The health check system in the load balancing device according to claim 2, characterized in that: The health check module further includes: an inspection method acquisition submodule; the inspection method acquisition submodule is connected to the inspection method storage submodule and the inspection submodule respectively; The inspection method acquisition submodule is used to obtain the preset health inspection method from the inspection method storage submodule, and send the preset health inspection method to the inspection submodule.
4. The health check system in the load balancing device according to claim 3, characterized in that: The health check module further includes: a preset threshold storage submodule; the preset threshold storage submodule is connected to the result output submodule; The preset threshold storage submodule is used to store the preset threshold.
5. The health check system in the load balancing device according to claim 1, characterized in that: The traffic distribution submodule includes: A third judgment unit, connected to the result output submodule, is used to judge whether the total result of the current number of health checks is a normal result, and reach a third judgment result; a fifth execution unit, connected to the third judgment unit, and configured to continue distributing traffic to the backend server when the third judgment result is yes; The sixth execution unit is connected to the third judgment unit, and is used to stop distributing traffic to the backend server when the third judgment result is no.
