A method and device for enhancing the overload stability of load balancing configuration
By obtaining the SHA1 value of the new configuration file when the load balancing system is configured for verification, intercepting requests, starting a new process and performing health checks, and isolating the faulty server, the problem of high business traffic error rate during the alternation of new and old processes in traditional systems is solved, and more stable load balancing is achieved.
Patent Information
- Application Number
- CN202211393410.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-08
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-11-08
AI Technical Summary
Traditional load balancing systems have business continuity problems and back-end server isolation problems when configuring reloads, resulting in high error rate of business traffic during the alternation of old and new processes. Especially when the health of the new server is unknown, traffic is routed to the failed server.
When configuring overloading, check by obtaining the SHA1 value of the new configuration file, intercepting all requests, starting a new process and performing health checks, isolating the faulty and unready servers, setting the routing weight of the healthy server to ensure that traffic is forwarded correctly.
It effectively solves the traffic destination problem during the takeover of new and old processes, ensures that the load balancing system runs more accurately and stably, and reduces the occurrence of requested wrong routing.
Smart Images

Figure CN115865938B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of computer task scheduling, and in particular, relates to a method and apparatus for enhancing the overload stability of load balancing configuration. Background Art
[0002] Load balancing is to reduce the load of one or more operating units by distributing the load (work tasks) to multiple operating units through a certain strategy to achieve load balance among different operating units.
[0003] Configuration reloading is when the configuration file of the load balancing system is updated and the configuration file is reloaded by restarting the process.
[0004] A deep health check sends an HTTP probe request to the backend server and determines the health status of the backend server based on the content returned by the backend server and the expected value.
[0005] Currently, when reloading a load balancing system, the following method is used: the load balancing system updates the configuration and starts a new process. The new process takes over the service and handles all new business traffic. The old process exits after handling the in-transit business traffic, completing the configuration update. However, the existing technology has the following shortcomings:
[0006] (1) Business continuity issues
[0007] In traditional process update methods, the old process will generally exit after starting the new process. However, when there is a lot of configuration information, the old process will exit while the new process is loading the configuration and is not yet ready. At this time, the business traffic arriving during the transition between the old and new processes will be unable to be forwarded and an error will be generated.
[0008] (2) Backend server isolation issues
[0009] Because the new process has not yet received backend server detection results, especially for newly added or expanded servers, its health status is unknown. Therefore, it cannot isolate unready or faulty servers based on health detection results. At this point, service traffic is forwarded to all servers, causing some traffic to be routed to faulty servers, resulting in service errors. The higher the proportion of faulty servers, the higher the service error rate. The more frequent the configuration updates, the longer service errors will persist. Summary of the Invention
[0010] The present application provides a method and apparatus for enhancing the stability of load balancing configuration reload, so as to at least solve the problem of request error routing caused by configuration update and reload of traditional load balancing system.
[0011] According to one aspect of the present application, a method for enhancing the stability of load balancing configuration reload is provided, comprising:
[0012] When triggering a configuration reload, obtain the SHA1 value of the new configuration file;
[0013] Verify the SHA1 value of the configuration file backed up by the platform according to the SHA1 value to obtain the verification result;
[0014] If the verification passes, set the process status and intercept all requests;
[0015] Start a new process to load the new configuration file and initialize;
[0016] Perform health checks on all connected servers and set routing weights for healthy servers;
[0017] Get the intercepted request and forward it to the healthy server and set the process status to running, output configuration error information.
[0018] In one embodiment, when a configuration reload is triggered, the SHA1 value of the new configuration file is obtained, including:
[0019] When a configuration reload is triggered, get the address of the new configuration file;
[0020] Calculate the SHA1 value based on the address of the new configuration file.
[0021] In one embodiment, if the verification passes, the process status is set and all requests are intercepted, including:
[0022] If the check passes, the process is set to be stopped to enter;
[0023] Intercept all requests in the process and temporarily store the requests in the data buffer.
[0024] In one embodiment, performing a health check on all downstream servers and setting routing weights for healthy servers includes:
[0025] Initiate virtual service detection requests to all connected servers;
[0026] The health status of the server is obtained based on the virtual service processing results returned by the server.
[0027] In one embodiment, performing a health check on all downstream servers and setting routing weights for healthy servers further includes:
[0028] Cache the health status of servers and isolate faulty and unready servers based on the server health check results;
[0029] After isolation, set routing weights for healthy servers.
[0030] In one embodiment, after completing the health check, the method further includes:
[0031] A forwarding route that sets a process to the Ready state and begins receiving and processing requests.
[0032] In one embodiment, after completing the health check, the method further includes:
[0033] Configures the cached intercepted business requests during reload and stops the process.
[0034] According to another aspect of the present application, a device for enhancing the stability of a load balancing configuration under heavy load is provided, comprising:
[0035] The acquisition unit is used to obtain the SHA1 value of the new configuration file when the configuration reload is triggered;
[0036] A value verification unit is used to verify the SHA1 value of the configuration file backed up by the platform according to the SHA1 value to obtain a verification result;
[0037] The request interception unit is used to set the process status and intercept all requests if the verification passes;
[0038] Start the initialization unit, which is used to start a new process, load a new configuration file and initialize;
[0039] Health check unit, used to check the health of all connected servers and set routing weights for healthy servers;
[0040] The output unit is used to obtain the intercepted request and forward it to the health server and set the process status to running, and output the configuration error information.
[0041] In one embodiment, the acquiring unit includes:
[0042] The address acquisition module is used to obtain the address of the new configuration file when the configuration reload is triggered;
[0043] The SHA1 value calculation module is used to calculate the SHA1 value according to the address of the new configuration file.
[0044] In one embodiment, the request interception unit includes:
[0045] The process entry module is used to set the process to be stopped if the verification passes;
[0046] The request cache module is used to intercept all requests in the process and temporarily store the requests in the data cache.
[0047] In one embodiment, the health check unit includes:
[0048] A virtual service detection initiation module is used to initiate a virtual service detection request to all downstream servers;
[0049] The health status evaluation module is used to obtain the health status of the server according to the virtual service processing result returned by the server.
[0050] In one embodiment, the health check unit further includes:
[0051] Isolation module, used to cache the health status of servers and isolate faulty and unready servers based on the server health check results;
[0052] The weight setting module is used to set the routing weight for healthy servers after isolation.
[0053] In one embodiment, after completing the health check, the device further includes:
[0054] The receiving processing module is used to set the process to the ready state and start receiving and processing the forwarding route of the request.
[0055] In one embodiment, after completing the health check, the device further includes:
[0056] Configure the business request module to configure the intercepted business requests cached during reload and stop the process.
[0057] This application determines the health status of the server, isolates unhealthy servers, and sets the routing weights of the remaining servers based on their health before taking over business requests. This application can correctly handle the traffic flow during the takeover of the old and new processes when the load balancing system configuration is reloaded, effectively solving the problem of request routing errors caused by not isolating the faulty server in time, making the load balancing system run more accurately and stably. It solves the problem of request routing errors caused by traditional load balancing system configuration updates and reloads. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. 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 any creative work.
[0059] Figure 1 This is a flow chart of a method for enhancing the overload stability of load balancing configuration provided by this application.
[0060] Figure 2 This is the situation when configuration reloading is triggered in an embodiment of the present application.
[0061] Figure 3 This is a flow chart of the method for setting process status and intercepting all requests in an embodiment of the present application.
[0062] Figure 4 This is a flow chart of a method for checking the health of all downstream servers and setting routing weights for healthy servers in an embodiment of the present application.
[0063] Figure 5 This is a flow chart of a method for checking the health of all downstream servers and setting routing weights for healthy servers in another embodiment of the present application.
[0064] Figure 6 This is a working module diagram of the load balancing configuration overload system in an embodiment of the present application.
[0065] Figure 7 This is a configuration update method for a traditional load balancing system in an embodiment of the present application.
[0066] Figure 8 Configure the reload mode for the load balancing system provided in this application.
[0067] Figure 9 This application provides a device for enhancing the heavy-load stability of load balancing configuration.
[0068] Figure 10 This is a structural block diagram of the acquisition unit in an embodiment of the present application.
[0069] Figure 11 This is a structural block diagram of the request interception unit in an embodiment of the present application.
[0070] Figure 12 This is a structural block diagram of the health check unit in an embodiment of the present application.
[0071] Figure 13 This is a structural block diagram of a health check unit in another embodiment of the present application.
[0072] Figure 14 This is a specific implementation of an electronic device in the embodiment of this application. DETAILED DESCRIPTION
[0073] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.
[0074] Currently, when reloading a load balancing system, the following method is used: the load balancing system updates the configuration and starts a new process. The new process takes over the service and handles all new business traffic. The old process exits after handling the in-transit business traffic, completing the configuration update. However, the existing technology has the following shortcomings:
[0075] (1) Business continuity issues
[0076] In traditional process update methods, the old process will generally exit after starting the new process. However, when there is a lot of configuration information, the old process will exit while the new process is loading the configuration and is not yet ready. At this time, the business traffic arriving during the transition between the old and new processes will be unable to be forwarded and an error will be generated.
[0077] (2) Backend server isolation issues
[0078] Because the new process has not yet received backend server detection results, especially for newly added or expanded servers, its health status is unknown. Therefore, it cannot isolate unready or faulty servers based on health detection results. At this point, service traffic is forwarded to all servers, causing some traffic to be routed to faulty servers, resulting in service errors. The higher the proportion of faulty servers, the higher the service error rate. The more frequent the configuration updates, the longer service errors will persist.
[0079] In order to solve the problem of request error routing caused by the traditional load balancing system configuration update reload, this application provides a method to enhance the stability of load balancing configuration reload, such as Figure 1 Shown, including:
[0080] S101: When a configuration reload is triggered, obtain the SHA1 value of the new configuration file.
[0081] S102: Verify the SHA1 value of the configuration file backed up by the platform according to the SHA1 value to obtain a verification result.
[0082] S103: If the verification passes, set the process status and intercept all requests.
[0083] S104: Start a new process to load a new configuration file and initialize it.
[0084] S105: Check the health of all the servers connected to it and set routing weights for healthy servers.
[0085] S106: Obtain the intercepted request and forward it to the health server, set the process status to running, and output configuration error information.
[0086] In one embodiment, when a configuration reload is triggered, the SHA1 value of the new configuration file is obtained, such as Figure 2 Shown, including:
[0087] S201: When a configuration reload is triggered, the address of a new configuration file is obtained.
[0088] S202: Calculate a SHA1 value based on the address of the new configuration file.
[0089] In one embodiment, if the verification passes, the process status is set and all requests are intercepted, such as Figure 3 Shown, including:
[0090] S301: If the verification passes, the process is set to be stopped to enter.
[0091] S302: intercept all requests in the process and temporarily store the requests in a data buffer.
[0092] In one embodiment, health checks are performed on all the servers connected to the server and routing weights are set for healthy servers, such as Figure 4 Shown, including:
[0093] S401: Initiate a virtual service detection request to all downstream servers.
[0094] S402: Obtain the health status of the server according to the virtual service processing result returned by the server.
[0095] In one embodiment, health checks are performed on all the servers connected to the server and routing weights are set for healthy servers, such as Figure 5 As shown, it also includes:
[0096] S501: Cache the health status of the servers and isolate the faulty and unready servers according to the health status check results of the servers.
[0097] S502: After isolation, set routing weights for healthy servers.
[0098] In one embodiment, after completing the health check, the method further includes:
[0099] A forwarding route that sets a process to the Ready state and begins receiving and processing requests.
[0100] In one embodiment, after completing the health check, the method further includes:
[0101] Configures the cached intercepted business requests during reload and stops the process.
[0102] In a specific embodiment, the present application is composed of 5 main components: Figure 6This is a working module diagram of the load balancing configuration reload system of the present application, which includes a load balancing configuration reload system composed of a control module 101, a configuration verification module 102, a process communication module 103, a forwarding routing module 104, a backend health detection module 105, and a data cache module 106.
[0103] Control module 101: responsible for receiving signals sent by the process communication module to control the start and stop of the process when the configuration is reloaded and set the process running status.
[0104] Configuration verification module 102: obtains the hash value of the updated configuration file through the SHA1 algorithm, transmits the hash value back to the configuration distribution platform 107, and receives the verification result of the configuration distribution platform 107. If the verification fails, the process reload process is stopped and old_process handles the business request.
[0105] Process communication module 103: Periodically obtains the old process PID and establishes communication with the old process. First, it is responsible for transmitting signals to the old process to control the timing of stopping and exiting the old process; second, it is responsible for transmitting the request data cached by the old process between restarted processes to the new process for continued processing and forwarding.
[0106] Forwarding routing module 104: First, it processes daily request forwarding routing, and second, it extracts the request data information cached by the old process between processes from the process communication module 102 and continues to process the forwarding routing of these requests.
[0107] Backend health detection module 105: Upon receiving the process start signal, it quickly initiates virtual service detection requests to the backend server in sequence. The backend server processes the virtual service according to the detection rules and returns the calculation results to the backend health detection module of the load balancer. The backend health detection module verifies whether the returned data meets expectations and calculates the health of the server based on the amount of data transmitted by the virtual service detection request and the response time. The formula is as follows:
[0108] Health = Probe verification passed? 0: (transmitted data volume / request response time)
[0109] The health detection module sets the load weight for the backend server according to its health, and isolates the servers with a health of 0, such as those that return incorrect detection results, detection timeout, or cannot respond. After completing the detection, it notifies the control module to set the process status to ready.
[0110] Data cache module 106: responsible for storing and recording the health check results of the backend server, and temporarily caching the business request data during the reload configuration period.
[0111] Configuration delivery platform 107: responsible for delivering configurations to the load balancer, processing the SHA1 returned by the load balancing system, and temporarily caching business request data during the reload configuration period.
[0112] The traditional load balancing system configuration update method can be summarized as follows: Figure 7 The current load balancing system process is attached to backend servers server_1 through server_m. The backend server capacity needs to be expanded by adding new servers, server_x and server_y. Server_x is healthy and can provide services, but server_y is unhealthy because it is not ready (or faulty). When a traditional load balancing system adds these two new servers, it places server_x and server_y in an undetected state because it is unaware of their health. At this point, the traditional load balancing system will continue to dispatch requests to the undetected servers and will only isolate the faulty server after a subsequent health check. Because server_y has not been isolated, requests sent to server_y will result in an error.
[0113] In view of the above-mentioned conventional load balancing system configuration update method in the prior art, in a specific embodiment, the load balancing system configuration reloading method provided by this application is as follows: Figure 8 As shown, when the back-end server needs to be expanded, new servers server_x and server_y need to be added. Server_x can provide services in a healthy state, and server_y is in an unhealthy state because it is not ready (or faulty). The method of the present invention controls the timing of the new and old processes taking over. The new_process first performs a health detection on all servers (including the newly added servers server_x and server_y) to obtain the health status of the servers. After the detection is completed, the faulty server server_y is isolated, and the routing weights of the remaining servers are set according to the health, and then the business requests are taken over. The present invention can correctly isolate the faulty server during overload and will not assign requests to server_y. It can also assign request routes by weight according to the server processing efficiency to make the load more balanced.
[0114] Based on the above load balancing system, this application also provides a workflow diagram of a load balancing configuration reload system, which includes:
[0115] Step S1: When a configuration reload is triggered, old_process calls the configuration verification module 102 to obtain the address of the new configuration file, calculates the SHA1 value based on the file, and transmits the value back to the configuration delivery platform 107.
[0116] Step S2: The configuration distribution platform 107 verifies the SHA1 value of the server file and the SHA1 value of the configuration file backed up by the platform. If the verification passes, the old_process process is set to be stopped and a series of configuration reload operations are performed. Otherwise, the configuration reload is exited and the process ends.
[0117] Step S3: Call the old_process control module to set the process state to "to be stopped", and the process enters
[0118] Step S4: old_process begins to intercept all requests and temporarily caches the requests at this stage in the data cache module 106.
[0119] Step S5: old_process calls the control module 101 to start a new process new_process, which loads a new configuration file and initializes.
[0120] Step S6: new_process calls the health check module 105 to initiate a virtual service detection request to all the servers connected thereto, obtains the server health status based on the virtual service processing result returned by the server, and caches the health status of all backend servers in the data cache module 106.
[0121] Step S7: new_process isolates faulty and unready servers based on the health check results of the backend servers and sets routing weights for healthy servers.
[0122] Step S8: new_process sets the process to the ready state by calling the control module 101 and starts receiving and processing the forwarding route of the request.
[0123] Step S9: new_process calls the communication module 103 to notify old_process that the process can be terminated.
[0124] Step S10: old_process calls the communication module 103 to send the service request cached in the data cache module 106 during the configuration reload period to the new_process, and then old_process calls the control module 101 to stop the process and exit.
[0125] Step S11: new_process reads the request cached by old_process from the communication module 103 and sends it to the forwarding routing module 104 for processing. Then new_process calls the control module 101 to set the process status to running.
[0126] Step S12: Output configuration error information.
[0127] Based on the same inventive concept, the embodiments of the present application also provide a device for enhancing the overload stability of the load balancing configuration, which can be used to implement the method described in the above embodiments, as described in the following embodiments. Since the principle of solving the problem by the device for enhancing the overload stability of the load balancing configuration is similar to the method for enhancing the overload stability of the load balancing configuration, the implementation of the device for enhancing the overload stability of the load balancing configuration can refer to the implementation of the method for enhancing the overload stability of the load balancing configuration, and the repeated parts will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements the predetermined function. Although the system described in the following embodiments is preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and conceived.
[0128] According to another aspect of the present application, a device for enhancing the stability of load balancing configuration overload is also provided. Figure 9 Shown, including:
[0129] The acquisition unit 901 is used to obtain the SHA1 value of the new configuration file when the configuration reload is triggered;
[0130] A value verification unit 902 is configured to verify the SHA1 value of the configuration file backed up by the platform according to the SHA1 value to obtain a verification result;
[0131] Request interception unit 903, used to set the process status and intercept all requests if the verification passes;
[0132] Start initialization unit 904, used to start a new process, load a new configuration file and initialize;
[0133] Health check unit 905, used to check the health of all connected servers and set routing weights for healthy servers;
[0134] The output unit 906 is used to obtain the intercepted request and forward it to the health server, set the process state to running, and output configuration error information.
[0135] In one embodiment, if Figure 10 As shown, the acquisition unit 901 includes:
[0136] The address acquisition module 1001 is used to obtain the address of the new configuration file when the configuration reload is triggered;
[0137] The SHA1 value calculation module 1002 is used to calculate the SHA1 value according to the address of the new configuration file.
[0138] In one embodiment, if Figure 11 As shown, the request interception unit 903 includes:
[0139] The process entry module 1101 is used to set the process to be stopped if the verification passes;
[0140] The request cache module 1102 is used to intercept all requests in the process and temporarily store the requests in the data cache.
[0141] In one embodiment, if Figure 12 As shown, the health check unit 905 includes:
[0142] A virtual service detection initiating module 1201 is configured to initiate a virtual service detection request to all downstream servers;
[0143] The health status evaluation module 1202 is used to obtain the health status of the server according to the virtual service processing result returned by the server.
[0144] In one embodiment, if Figure 13 As shown, the health check unit 905 also includes:
[0145] Isolation module 1301, used to cache the health status of servers and isolate faulty and unready servers based on the server health check results;
[0146] The weight setting module 1302 is used to set routing weights for healthy servers after isolation.
[0147] In one embodiment, after completing the health check, the device further includes:
[0148] The receiving processing module is used to set the process to the ready state and start receiving and processing the forwarding route of the request.
[0149] In one embodiment, after completing the health check, the device further includes:
[0150] Configure the business request module to configure the intercepted business requests cached during reload and stop the process.
[0151] This application can correctly handle traffic flow during the takeover between old and new processes when the load balancing system is reconfigured. This effectively solves the problem of request routing errors caused by the failure to isolate the faulty server in a timely manner, making the load balancing system more accurate and stable. It also solves the problem of request routing errors caused by configuration updates and reloads in traditional load balancing systems.
[0152] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0153] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0154] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0155] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0156] Specific embodiments are used in the present invention to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core ideas. At the same time, for those skilled in the art, according to the ideas of the present invention, there may be changes in the specific implementation methods and application scopes. In summary, the contents of this specification should not be understood as limiting the present invention.
[0157] The embodiments of the present application also provide a specific implementation of an electronic device that can implement all the steps in the method in the above embodiments, see Figure 14 , the electronic device specifically includes the following contents:
[0158] Processor 1401, memory 1402, communication interface 1403, bus 1404, and non-volatile memory 1405;
[0159] The processor 1401, memory 1402, and communication interface 1403 communicate with each other via the bus 1404.
[0160] The processor 1401 is configured to call the computer program in the memory 1402 and the non-volatile memory 1405. When the processor executes the computer program, all steps of the method in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0161] S101: When a configuration reload is triggered, obtain the SHA1 value of the new configuration file.
[0162] S102: Verify the SHA1 value of the configuration file backed up by the platform according to the SHA1 value to obtain a verification result.
[0163] S103: If the verification passes, set the process status and intercept all requests.
[0164] S104: Start a new process to load a new configuration file and initialize it.
[0165] S105: Check the health of all the servers connected to it and set routing weights for healthy servers.
[0166] S106: Obtain the intercepted request and forward it to the health server, set the process status to running, and output configuration error information.
[0167] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps of the method in the above embodiments. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, all the steps of the method in the above embodiments are implemented. For example, when the processor executes the computer program, the following steps are implemented:
[0168] S101: When a configuration reload is triggered, obtain the SHA1 value of the new configuration file.
[0169] S102: Verify the SHA1 value of the configuration file backed up by the platform according to the SHA1 value to obtain a verification result.
[0170] S103: If the verification passes, set the process status and intercept all requests.
[0171] S104: Start a new process to load a new configuration file and initialize it.
[0172] S105: Check the health of all the servers connected to it and set routing weights for healthy servers.
[0173] S106: Obtain the intercepted request and forward it to the health server, set the process status to running, and output configuration error information.
[0174] Each embodiment in this specification is described in a progressive manner. The same or similar parts between the embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences from other embodiments. In particular, for hardware + program embodiments, since they are basically similar to method embodiments, the description is relatively simple. For relevant parts, refer to the partial description of the method embodiment. Although the embodiments of this specification provide method operation steps as described in the embodiments or flow charts, more or fewer operation steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is only one way of executing the steps among many, and does not represent the only execution order. When an actual device or terminal product is executed, the method can be executed sequentially or in parallel according to the embodiments or the figures (for example, in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, product or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, product or device. Without further limitation, it is not excluded that there are other identical or equivalent elements in the process, method, product or device including the elements. For ease of description, the above devices are described as being functionally divided into various modules and described separately. Of course, when implementing the embodiments of this specification, the functions of each module can be implemented in the same or multiple software and / or hardware, or the modules that implement the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components that can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, and can be electrical, mechanical or other forms. The present invention is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or box in the flowcharts and / or block diagrams, as well as the combination of processes and / or boxes in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce the instructions for implementing the process Figure 1 a process or multiple processes and / or boxes Figure 1A device that performs the functions specified in one or more blocks. Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems, or computer program products. Therefore, the embodiments of this specification may take the form of entirely hardware embodiments, entirely software embodiments, or embodiments that combine software and hardware aspects. Furthermore, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code. The various embodiments in this specification are described in a progressive manner, and similar parts between the various embodiments can be referenced to each other. Each embodiment focuses on the differences from other embodiments. In particular, for system embodiments, since they are basically similar to method embodiments, the description is relatively simple, and relevant parts can be referenced to the partial description of the method embodiments. In the description of this specification, reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the embodiments of this specification. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification, as well as the features of different embodiments or examples, unless they are mutually inconsistent. The foregoing is merely an example of the embodiments of this specification and is not intended to limit the embodiments of this specification. For those skilled in the art, various modifications and variations of the embodiments of this specification are possible. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of this specification shall be included within the scope of the claims of the embodiments of this specification.
Claims
1. A method for enhancing the overload stability of load balancing configuration, characterized in that: include: When triggering a configuration reload, obtain the SHA1 value of the new configuration file; Verify the SHA1 value of the configuration file backed up by the platform according to the SHA1 value to obtain a verification result; If the verification passes, set the process status and intercept all requests; Start a new process to load the new configuration file and initialize; Perform health checks on all connected servers and set routing weights for healthy servers; Get the intercepted request and forward it to the healthy server and set the process status to running, output the configuration error information; If the verification passes, the process status is set and all requests are intercepted, including: If the verification passes, the process is set to be stopped to allow the process to enter; Intercept all requests in the process and temporarily store the requests in the data buffer.
2. The method for enhancing the overload stability of load balancing configuration according to claim 1, characterized in that: When triggering a configuration reload, the SHA1 value of the new configuration file is obtained, including: When a configuration reload is triggered, get the address of the new configuration file; Calculate the SHA1 value based on the address of the new configuration file.
3. The method for enhancing the overload stability of load balancing configuration according to claim 1, characterized in that: The health check of all the servers connected to the server and setting the routing weight for the healthy servers include: Initiate virtual service detection requests to all connected servers; The health status of the server is obtained based on the virtual service processing results returned by the server.
4. The method for enhancing the overload stability of load balancing configuration according to claim 3, characterized in that: The health check of all the servers connected to the server and setting the routing weight for the healthy servers also includes: Cache the health status of servers and isolate faulty and unready servers based on the server health check results; After isolation, set routing weights for healthy servers.
5. The method for enhancing the overload stability of load balancing configuration according to claim 1, characterized in that: After completing the health check, it also includes: A forwarding route that sets a process to the Ready state and begins receiving and processing requests.
6. The method for enhancing the overload stability of load balancing configuration according to claim 1, characterized in that: After completing the health check, it also includes: Configures the cached intercepted business requests during reload and stops the process.
7. A device for enhancing the heavy-load stability of a load balancing configuration, characterized in that: include: The acquisition unit is used to obtain the SHA1 value of the new configuration file when the configuration reload is triggered; A value verification unit, configured to verify the SHA1 value of the configuration file backed up by the platform according to the SHA1 value to obtain a verification result; The request interception unit is used to set the process status and intercept all requests if the verification passes; Start the initialization unit, which is used to start a new process, load a new configuration file and initialize; Health check unit, used to check the health of all connected servers and set routing weights for healthy servers; The output unit is used to obtain the intercepted request and forward it to the health server and set the process status to running, and output the configuration error information; The request interception unit is used to set the process to be stopped if the verification is passed; Intercept all requests in the process and temporarily store the requests in the data buffer.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method for enhancing the reload stability of load balancing configuration according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method for enhancing the reload stability of load balancing configuration according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Distributed load balancing service information continuous inheritance method and device
CN112905341A
Gateway control program graceful upgrading method based on father and child process transmission descriptors
CN113986286A