Dynamic GSLB processing method based on service delayTechnical Field
The invention belongs to the technical field of computer networks, and particularly relates to a GSLB processing method.
Background
In the whole GSLB multi-data center solution, all current GSLB manufacturer solutions respond to DNS requests according to a series of algorithms such as health check, geographical position and the like. The method can not be really combined with the service, and in real application, the service access of the SLB loaded service is slow due to various conditions such as large service volume, long-term system operation, network reasons and the like, which is a problem to be solved by the invention.
Therefore, a new technical solution is needed to solve the above problems.
Disclosure of Invention
The purpose of the invention is as follows: the problem of slow client access caused by busy server service is solved, and the problem of service failure caused by abnormal operation of part of service links after the server operates for a long time is also solved.
The technical scheme is as follows: in order to achieve the purpose, the invention can adopt the following technical scheme:
a dynamic GSLB processing method based on service delay comprises the following steps:
the data center SLB1 equipment monitors and records service delay in real time, and the service corresponding to the service delay is the whole process of accessing to the VIP from the client and then transferring to a back-end real server from the VIP;
assume that the address data of the traffic VIP1 is m 1; the data center SLB2 behavior is consistent with the data center SLB1, assuming the address data of the business VIP2 is m 2; m1 and m2 are dynamically acquired by the SLB and retain the numerical values of the latest groups to cover the operation;
the GSLB detects and collects the corresponding service states of all data center equipment through a protocol, wherein the service states are vip 1-m 1; the vip2 is m2, and the SLB takes a plurality of groups of data from all data center equipment at regular time;
GSLB measures according to self-set delay safety value t1 and alarm value t2, the measurement algorithm is:
(1) calculating the average value of a plurality of groups of data retrieved by the data center as m;
(2) if m < t1 is considered as a safe range, GSLB normally responds to the DNS response rate of the data center, assuming the rate is s 1;
(3) if t1< m < t2, considering the boundary range, and dynamically adjusting the rate of GSLB responding to the data center SLB1 to be half of the original rate of s1, namely s 1/2;
continuously detecting that two cycles m still belong to the range, and continuously adjusting the rate of GSLB responding to the data center SLB1 to be half of the last time, namely s 1/4;
continuously detecting that two periods m still belong to the range, and continuously adjusting the speed of the GSLB responding to the data center SLB1 to be half of the last time, namely s 1/8;
continuing to continuously probe that two cycles m still belong to the range, GSLB will no longer respond to DNS requests from the data center SLB 1;
(4) if m > t2, then the scope is considered anomalous and GSLB will no longer respond to DNS requests from the data center SLB 1.
Further, a recovery mechanism is also included in step (3), i.e. m < t 1.
Further, it is characterized in that: the SLB timing takes five groups of data from the SLB equipment of the data center, and if the five groups are not satisfied, all the data are taken back, namely m1_1, m1_2, m1_3, m1_4 and m1_ 5.
Furthermore, the method is suitable for multiple data centers, and the GSLB is associated with a health check algorithm in the method.
Has the advantages that: the invention adjusts the GSLB response speed in time by adopting a measurement algorithm to solve the problems of slow client access caused by busy server service and service failure caused by abnormal operation of part of service links after long-time operation of the server, such as memory leakage, overstaffed database and the like, wherein the service can be accessed but the response is slow and overtime often occurs.
Detailed Description
The embodiment discloses a dynamic GSLB processing method based on service delay applied to multiple data centers, and the precondition of the processing method is as follows:
1GSLB associated health check algorithm
2 multidata center
Implementation and principle description:
1. the data center SLB1 equipment monitors and records the service delay of the whole process that the service is accessed from the client to the VIP and then is transferred from the VIP to the real server at the back end in real time, and the service VIP1 is assumed to be m 1; data center SLB2 behavior is consistent with data center SLB1, assuming traffic VIP2 is m 2; m1 and m2 are dynamically acquired by the SLB, the numerical values of the latest 5 groups are reserved, and the operation is covered;
2. the GSLB detects and collects (active and passive modes) the corresponding service states on the data center SLB device through the protocol, which are vip1 ═ m 1; when vip2 is m2, the SLB periodically takes five groups of data from the data center SLB device, assuming that m1_1, m1_2, m1_3, m1_4 and m1_5 are all retrieved when the five groups are less than five,
3. GSLB measures according to self-set delay safety value t1 and alarm value t2, the measurement algorithm is:
(1) calculating the average value of the data center retrieval data m1_1 to m1_5 as m
(2) If m < t1 is considered a safe range, GSLB responds normally to the data center's DNS reply rate, assuming rate s1
(3) If t1< m < t2, considering the boundary range, and dynamically adjusting the rate of GSLB responding to the data center SLB1 to be half of the original rate of s1, namely s 1/2;
continuously detecting that two cycles m still belong to the range, and continuously adjusting the rate of GSLB responding to the data center SLB1 to be the last general rate, namely s 1/4;
continuously detecting that two periods m still belong to the range, and continuously adjusting the rate of GSLB responding to the data center SLB1 to be the last ordinary rate, namely s 1/8;
continuing to continuously probe that two cycles m still belong to the range, GSLB will no longer respond to DNS requests from the data center SLB1
And (3) a recovery mechanism: m < t1
(4) If m > t2, then the scope is considered anomalous and GSLB will no longer respond to DNS requests from the data center SLB 1.
In addition, the present invention has many specific implementations and ways, and the above description is only a preferred embodiment of the present invention. It should be noted that, for those skilled in the art, without departing from the principle of the present invention, several improvements and modifications can be made, and these improvements and modifications should also be construed as the protection scope of the present invention. All the components not specified in the present embodiment can be realized by the prior art.