CN109150644A - A kind of pair of server carries out the method and device of health detection - Google Patents
A kind of pair of server carries out the method and device of health detection Download PDFInfo
- Publication number
- CN109150644A CN109150644A CN201710508458.1A CN201710508458A CN109150644A CN 109150644 A CN109150644 A CN 109150644A CN 201710508458 A CN201710508458 A CN 201710508458A CN 109150644 A CN109150644 A CN 109150644A
- Authority
- CN
- China
- Prior art keywords
- server
- detection
- setting
- detection frequency
- health
- 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
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0817—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking functioning
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/16—Threshold monitoring
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Measuring And Recording Apparatus For Diagnosis (AREA)
Abstract
This application involves the method and devices that field of cloud computer technology, in particular to a kind of pair of server carry out health detection.This method are as follows: the first detection frequency less than the first given threshold based on setting carries out health detection to each server respectively, determining that there are when the server of operation conditions exception, for above-mentioned abnormal server, set first detection frequency error factor is detected into frequency greater than the second of the second given threshold as setting, and health detection is continued to above-mentioned abnormal server according to the second detection frequency, wherein, the first given threshold is less than the second given threshold.Using the above method, health detection is carried out to server according to the first detection frequency, when determining that the operation conditions for having server occurs abnormal, health detection is carried out according to server of the second detection frequency to operation conditions exception, in this way, it just reduces the power consumption of server, while improving performance of server, ensure that health detection efficiency.
Description
Technical field
This application involves methods and dress that field of cloud computer technology, in particular to a kind of pair of server carry out health detection
It sets.
Background technique
Server load balancing is a kind of technology that the flowing of access of client is balanced to multiple back-end servers, with reality
Now to the portfolio effect of server load.During implementing load balancing, to the server for hanging over load balancer rear end
Carrying out health detection is a very important link.By carrying out health detection to back-end server, however, it is determined that a service
When device is in unusual condition, then the server is rejected, that is, stops forwarding the flow of the server, however, it is determined that the server is in
When normal condition, restore to forward the flow of the server.
Currently, the server load balancing of field of cloud computer technology, only supports a fixation based on user setting
Health detection frequency (e.g., 1s/ times, 3s/ times, 5s/ is inferior), to back-end server carry out health detection.Specifically, health inspection
It surveys device and judges whether user is provided with corresponding health detection frequency, and corresponding health detection frequency has been set in judgement user
When, health detection is carried out to back-end server according to the corresponding detection frequency being arranged, secure good health testing result.So-called health
Detection refers to that load balancer rear end server sends health detection request message, if back-end server is in the scheduled time
It is interior to return to corresponding response message, it is determined that back-end server health;Otherwise, it determines back-end server is unhealthy.So-called health
Frequency is detected, refers to that load balancer rear end server sends the frequency of health detection request message.
However, existing server load balancing be mostly in the form of cluster existing for, i.e. meeting in a cluster
There are multiple load balancing examples to carry out corresponding health detection to same back-end server simultaneously, in this way, will lead to rear end
Server is tired in a large amount of health detection request message for responding each load balancer transmission, to increase the function of back-end server
Consumption, reduces the performance of back-end server.
In conclusion need to design a kind of new method and device that health detection is carried out to server, it is existing to make up
There are defect present in technology and shortcoming.
Summary of the invention
The purpose of the embodiment of the present application is to provide the method and device that a kind of pair of server carries out health detection, to solve
It is existing in the prior art to disappear since back-end server is tired in a large amount of health detection request for responding each load balancer transmission
Breath, thus the problem of increasing the power consumption of back-end server, reducing the performance of back-end server.
Specific technical solution provided by the embodiments of the present application is as follows:
In a first aspect, the method that a kind of pair of server carries out health detection, comprising:
The first detection frequency based on setting carries out health detection to each server respectively, wherein first inspection
Measured frequency is lower than the first given threshold;
The operation conditions of each server is monitored, and whether just to judge the operation conditions of each server respectively
Often;
Determining, for the abnormal server, the first of setting to be examined there are when the server of operation conditions exception
Measured frequency be switched to setting second detection frequency, and according to it is described second detection frequency to the abnormal server continue into
Row health detection, wherein the second detection frequency is higher than the second given threshold, and first given threshold is less than described second
Given threshold.
Preferably, carrying out health detection to a server, specifically include:
Health detection request message is sent to a server, and judges whether one server can be according to default
It is required that returning to corresponding response message;
If one server can return to corresponding response message according to preset requirement, it is determined that one service
Device health;
If one server can not return to corresponding response message according to preset requirement, it is determined that one clothes
Business device is unhealthy.
Preferably, monitoring the operation conditions of each server, specifically include:
Execute following operation respectively for each server:
It is sampled, and is drawn using the time as abscissa based on outflow of the sampling period of setting to a server,
The outflow of one server is the curve graph of ordinate;
Calculating cycle based on setting determines that first outflow sampled point goes out to flow with the last one in current calculation cycle
Measure the straight line where sampled point, and calculate the slope of the straight line, wherein calculating cycle=N* sampling period, N be more than or equal to
1 positive integer.
Preferably, judging whether the operation conditions of each server is normal, specifically includes respectively:
Execute following operation respectively for each server:
For a server, judge that first outflow sampled point and the last one outflow are adopted in current calculation cycle
Whether the slope of the straight line where sampling point is less than 0, and the absolute value of the slope is greater than predetermined threshold value;
If so, it is abnormal to determine that the operation conditions of one server occurs;Otherwise, it is determined that one server
Operation conditions is normal.
Preferably, the second detection frequency according to setting continues health detection to the abnormal server, specifically
Include:
Following operation is executed respectively for each of abnormal server server:
During carrying out health detection to a server according to the second detection frequency of setting, however, it is determined that any one
The one server of result characterization of secondary health detection is unhealthy, then offline one server, however, it is determined that continuous N time is strong
The result of health detection characterizes one server health, then is directed to one server, by the second detection frequency of setting
Rate is switched to the first detection frequency of setting, and continues health to one server according to the first detection frequency
Detection, wherein M is given threshold.
Second aspect, a kind of pair of server carry out the device of health detection, comprising:
Detection unit carries out health detection to each server respectively for the first detection frequency based on setting,
In, the first detection frequency is lower than the first given threshold;
Monitoring unit for monitoring the operation conditions of each server, and judges each server respectively
Whether operation conditions is normal;
Switch unit, for determining, for the abnormal server, to incite somebody to action there are when the server of operation conditions exception
The the first detection frequency error factor set detects frequency to described abnormal according to described second as the second detection frequency of setting
Server continues health detection, wherein the second detection frequency is higher than the second given threshold, first given threshold
Less than second given threshold.
Preferably, the detection unit is specifically used for when carrying out health detection to a server:
Health detection request message is sent to a server, and judges whether one server can be according to default
It is required that returning to corresponding response message;
If one server can return to corresponding response message according to preset requirement, it is determined that one service
Device health;
If one server can not return to corresponding response message according to preset requirement, it is determined that one clothes
Business device is unhealthy.
Preferably, the monitoring unit is specifically used for when monitoring the operation conditions of each server:
Execute following operation respectively for each server:
It is sampled, and is drawn using the time as abscissa based on outflow of the sampling period of setting to a server,
The outflow of one server is the curve graph of ordinate;
Calculating cycle based on setting determines that first outflow sampled point goes out to flow with the last one in current calculation cycle
Measure the straight line where sampled point, and calculate the slope of the straight line, wherein calculating cycle=N* sampling period, N be more than or equal to
1 positive integer.
Preferably, when whether the operation conditions for judging each server respectively normal, the monitoring unit tool
Body is used for:
Execute following operation respectively for each server:
For a server, judge that first outflow sampled point and the last one outflow are adopted in current calculation cycle
Whether the slope of the straight line where sampling point is less than 0, and the absolute value of the slope is greater than predetermined threshold value;
If so, it is abnormal to determine that the operation conditions of one server occurs;Otherwise, it is determined that described
The operation conditions of one server is normal.
Preferably, when continuing health detection to the abnormal server according to the second detection frequency of setting,
The switch unit is specifically used for:
Following operation is executed respectively for each of abnormal server server:
During carrying out health detection to a server according to the second detection frequency of setting, however, it is determined that any one
The one server of result characterization of secondary health detection is unhealthy, then offline one server, however, it is determined that continuous N time is strong
The result of health detection characterizes one server health, then is directed to one server, by the second detection frequency of setting
Rate is switched to the first detection frequency of setting, and continues health to one server according to the first detection frequency
Detection, wherein M is given threshold.
The third aspect, a kind of storage medium are stored with the program for carrying out health detection to server, described program quilt
When processor is run, following steps are executed:
The first detection frequency based on setting carries out health detection to each server respectively, wherein first inspection
Measured frequency is lower than the first given threshold;
The operation conditions of each server is monitored, and whether just to judge the operation conditions of each server respectively
Often;
Determining, for the abnormal server, the first of setting to be examined there are when the server of operation conditions exception
Measured frequency be switched to setting second detection frequency, and according to it is described second detection frequency to the abnormal server continue into
Row health detection, wherein the second detection frequency is higher than the second given threshold, and first given threshold is less than described second
Given threshold.
Fourth aspect, a kind of communication device, including one or more processors;And
One or more computer-readable mediums are stored with instruction on the readable medium, and described instruction is one
Or multiple processors are when executing, so that described device executes method described in any one of above-mentioned first aspect.
5th aspect, one or more computer-readable mediums are stored with instruction, described instruction quilt on the readable medium
When one or more processors execute, so that communication equipment executes method described in any one of above-mentioned first aspect.
6th aspect, the method that a kind of pair of server carries out health detection, comprising:
Health detection is carried out at least one server respectively based on the first detection frequency;
The operation conditions of monitoring server;
When the operation conditions of determining server occurs abnormal, for there is abnormal server, by the first detection of setting
Frequency error factor is the second detection frequency of setting, and is carried out according to the second detection frequency to the server for exception occur
Health detection, wherein the second detection frequency is higher than the first detection frequency.
The application has the beneficial effect that:
In conclusion in the embodiment of the present application, during carrying out health detection to server, based on setting first
It detects frequency and health detection is carried out to each server respectively, wherein the first detection frequency is lower than the first given threshold;Monitoring
The operation conditions of each server, and judge whether the operation conditions of each server is normal respectively, determining there is fortune
It is the set by the set first detection frequency error factor for above-mentioned abnormal server when the server of row situation exception
Two detection frequencies, and health detection is continued to above-mentioned abnormal server according to the second detection frequency, wherein the second detection
Frequency is higher than the second given threshold, and the first given threshold is less than the second given threshold.
Using the method provided by the embodiments of the present application for carrying out health detection to server, server is not being monitored
When operation conditions occurs abnormal, health detection is carried out to each server according to the first detection frequency lower than the first given threshold,
In this way, being greatly lowered server for responding the power consumption of health detection, to improve the performance of server, and monitoring
To when there is abnormal server there are operation conditions, frequency is detected to operation conditions according to be higher than the second given threshold second
There is abnormal server and carry out health detection, in this way, ensuring that unsound server can be detected in time, guarantees
Health detection efficiency.
Detailed description of the invention
Fig. 1 is the system architecture figure of load balancing example in the embodiment of the present application;
Fig. 2 is in the embodiment of the present application, and a kind of pair of server carries out the detail flowchart of the method for health detection;
Fig. 3 is in the embodiment of the present application, and based on the outflow sampled point in current calculation cycle, the outflow drawn out is bent
Line chart;
Fig. 4 is in the embodiment of the present application, and a kind of pair of server carries out the detail flowchart of the method for health detection;
Fig. 5 is in the embodiment of the present application, and load balancer carries out the detail flowchart of health detection to server X;
Fig. 6 is the detail flowchart of another method that health detection is carried out to server in the embodiment of the present application;
Fig. 7 is in the embodiment of the present application, and a kind of pair of server carries out the structure drawing of device of health detection.
Specific embodiment
It is existing in the prior art since back-end server is tired in a large amount of of each load balancer transmission of response in order to solve
Health detection request message, thus the problem of increasing the power consumption of back-end server, reducing the performance of back-end server.The application
A kind of new method and device that health detection is carried out to server, this method are provided in embodiment are as follows: the based on setting
One detection frequency carries out health detection to each server respectively, monitors the operation conditions of each server, and sentence respectively
Break each server operation conditions it is whether normal, when the operation conditions for determining at least one server occurs abnormal, needle
To at least one above-mentioned server, by the set first detection frequency error factor as the second detection frequency of setting, and according to second
Detection frequency continues health detection at least one above-mentioned server, wherein the first detection frequency is lower than the first setting threshold
Value, the second detection frequency are higher than the second given threshold, and the first given threshold is less than the second given threshold.
Below in conjunction with the attached drawing in the embodiment of the present application, technical solutions in the embodiments of the present application carries out clear, complete
Site preparation description, it is clear that described embodiments are only a part of embodiments of the present application, is not whole embodiments.It is based on
Embodiment in the application, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall in the protection scope of this application.
In the embodiment of the present application, the system architecture figure of load balancing example is as shown in fig.1, include at least load balancer
With several servers.
In practical application, since back-end server is in health status within 99.99% or more time, and only low
In being likely to be at unsound situation in 0.01 time, therefore, in the embodiment of the present application, firstly, load balancer is according to setting
Fixed the first detection frequency lower than the first given threshold carries out health detection to each back-end server respectively, and supervises in real time
The operation conditions of each server is surveyed, judges whether the operation conditions of each server is normal respectively;Then, determining to deposit
When the operation conditions of at least one back-end server occurs abnormal, at least one above-mentioned back-end server, by the first inspection
Measured frequency is switched to and detects frequency higher than the second of the second given threshold, and according to the second detection frequency to above-mentioned after at least one
End server continues health detection, wherein first given threshold is less than second given threshold.
To be described in detail below by scheme of the specific embodiment to the application, certainly, the application be not limited to
Lower embodiment.
Embodiment one:
As shown in fig.2, a kind of pair of server carries out the detailed process of the method for health detection such as in the embodiment of the present application
Under:
Step 200: the first detection frequency based on setting carries out health detection to each server respectively.
In practical application, load balancer can be according to set by user, first detection lower than the first given threshold
Each back-end server that frequency respectively administers it carries out health detection.First given threshold can be answered according to different
User is carried out with scene to custom-configure.
Specifically, only carrying out health detection to a back-end server to illustrate load with load balancer below
Weighing apparatus carries out the detailed process of health detection to back-end server.
Firstly, load balancer sends health detection request message to a server;Then, judge said one service
Whether device can return to corresponding response message according to preset requirement.
For example, it is assumed that load balancer needs to carry out health detection to back-end server 1, then, load balancer is backward
It holds server 1 to send health detection request message, and judges whether back-end server returns in preset duration and be good for above-mentioned
The corresponding response message of health solicitation message.
If it is determined that said one server can return to corresponding response message according to preset requirement, it is determined that said one
Server health.
For example, it is assumed that load balancer rear end server 1 sends health detection request message, back-end server 1 is being connect
After the health detection request message for receiving load balancer transmission, corresponding response is generated based on above-mentioned health detection request message
Message, and the response message is returned into load balancer, if load balancer receives the response in preset duration and disappears
Breath, it is determined that 1 health of back-end server.
Further, if it is determined that said one server can not return to corresponding response message according to preset requirement, then
Determine that said one server is unhealthy.
For example, it is assumed that load balancer rear end server 2 sends health detection request message, load balancer is default
Duration in do not receive the response message corresponding with the health detection request message of the return of back-end server 2, then load is equal
Weighing apparatus determines that back-end server 2 is unhealthy.Certainly, back-end server 2 does not return to corresponding response message in preset duration
The reason of, can include but is not limited to be back-end server 2 do not receive load balancer transmission health detection request message,
Either back-end server 2 cannot be examined after the health detection request message for receiving load balancer transmission according to the health
It surveys request message and completes corresponding response operation etc., in the embodiment of the present application, be not specifically limited in this embodiment.
In the embodiment of the present application, the first given threshold can be the customized value of user, then, in order to adapt to different answer
With scene, so that it may according to different application scenarios come actual demand, corresponding first given threshold is respectively set, further
, the range of the first detection frequency can be limited indirectly in such a way that the first given threshold is set.
Step 210: monitoring the operation conditions of each server, and judge that the operation conditions of each server is respectively
It is no normal.
In practical application, the outflow of each back-end server of its administration of load balancer real-time monitoring is every to monitor
The operation conditions of one back-end server, and whether the outflow for judging from the fact each back-end server normally judges
Whether the operation conditions of each back-end server there is exception.So-called outflow refers to the flow gone out from server, clothes
Business device performs corresponding processing each service request received, and processing result is fed back to each service request object.
Specifically, load balancer when monitoring the operation conditions of each server, is distinguished for each server
It executes following operation: being sampled based on outflow of the sampling period of setting to a server, and drawing with the time is cross
Coordinate, the outflow of said one server are the curve graph of ordinate;Calculating cycle based on setting determines current calculating week
First outflow sampled point and the straight line where the last one outflow sampled point in phase, and the slope of above-mentioned straight line is calculated,
Wherein, calculating cycle=N* sampling period, N are the positive integer more than or equal to 1.
For example, it is assumed that the outflow sampling period set is 200ms, the slope calculation period set is 1s, refering to Fig. 3 institute
Show, according to the sampled point (e.g., A, B, C, D, E, F) in current calculation cycle, draws accordingly using the time as abscissa, server
Outflow be ordinate curve graph.For current calculation cycle, A is that first outflow is adopted in current calculation cycle
Sampling point, coordinate are (x1, y1), and F is the last one outflow sampled point in current calculation cycle, and coordinate is (x2, y2), then,
The slope k of the straight line AF where A and F can be calculated according to the coordinate of A and F, wherein k=(y2-y1)/(x2-x1).
Certainly, in the embodiment of the present invention, the setting in outflow sampling period and calculating cycle need to only guarantee each calculating
All there is at least one outflow sampled point in period, if only existing an outflow sampled point in current calculation cycle,
The outflow sampled point then calculated in current calculation cycle is straight where with the last one sampled point in a upper calculating cycle
The slope of line, and subsequent operation is carried out, details are not described herein.
Further, load balancer is when whether the operation conditions for judging each above-mentioned server respectively is normal, needle
It executes following operation respectively to each server: for a server, judging first outflow in current calculation cycle
Whether the slope of the straight line where sampled point and the last one outflow sampled point is less than 0, and the absolute value of above-mentioned slope is greater than
Predetermined threshold value;If so, it is abnormal to determine that the operation conditions of said one server occurs;Otherwise, it is determined that said one service
The operation conditions of device is normal.
For example, it is assumed that in outflow curve graph 1, in current calculation cycle first outflow sample point coordinate be (80Mb,
11 points 11 seconds 11 minutes), the last one outflow sample point coordinate is (10Mb, 11: 12 11 :) in current calculation cycle, if
Fixed calculating cycle is 1s, predetermined threshold value 50Mb/s, it is possible to be obtained by calculation first in current calculation cycle
The slope k 1=-70Mb/s, k1 of straight line where a outflow sampled point and the last one outflow sampled point are less than 0, and k1
Absolute value be greater than predetermined threshold value (70Mb/s > 50Mb/s), then determine the operation of the corresponding server 1 of flow curve Fig. 1
Situation occurs abnormal.
In another example, it is assumed that in outflow curve graph 2, first outflow sample point coordinate is in current calculation cycle
(50Mb, 12: 10 10 :), in current calculation cycle the last one outflow sample point coordinate be (40Mb, 12 points 10 minutes 11
Second), the calculating cycle set is 1s, predetermined threshold value 50Mb/s, it is possible to which current calculation cycle is obtained by calculation
Slope k 2=-10Mb/s, the k2 < 0 of straight line where interior first outflow sampled point and the last one outflow sampled point,
But the absolute value of k2 is less than predetermined threshold value (10Mb/s < 50Mb/s), then determines the corresponding server 2 of flow curve Fig. 2
Operation conditions is normal.
In the embodiment of the present application, predetermined threshold value can be the customized value of user, then, in order to adapt to different applications
Scene, so that it may according to the actual demand of different application scenarios, corresponding predetermined threshold value be respectively set, so as to more acurrate
Determining server operation conditions it is whether normal.
Step 220: when determining that the operation conditions of at least one server occurs abnormal, at least one above-mentioned service
Device, by the set first detection frequency error factor as the second detection frequency of setting.
In practical application, load balancer is determining that it is abnormal that the operation conditions that there is at least server occurs, that is, exists extremely
Few corresponding outflow curve graph of a server, first outflow sampled point in current calculation cycle and last
The slope of straight line where one sampled point is respectively less than 0, and the absolute value of the slope is all larger than predetermined threshold value, and statement exists extremely
There is the decline of cliff of displacement formula in current calculation cycle in the outflow of a few server, and fall is more than preset range.
In the embodiment of the present application, only there is exception with the operation conditions of a server to be illustrated.Specifically,
When executing step 220, load balancer takes said one when determining to occur abnormal there are the outflow of a server
The corresponding detection frequency of business device, the second detection frequency from the first detection frequency error factor set as setting, wherein the first detection
Frequency is lower than the first given threshold, and the second detection frequency is higher than the second given threshold, and the first given threshold is less than the second setting threshold
Value.
For example, it is assumed that the first given threshold set is 5 times/min, the first detection frequency is 3 times/min, i.e., 20s/ times,
Second given threshold be 15 times/min, second detection frequency be 20 times/min, i.e., 3s/ time, if load balancer determine service
When the operation conditions (i.e. outflow) of device 1 and server 3 occurs abnormal, by the health detection frequency to server 1 and server 3
20 times/min is switched to from 3 times/min.
Step 230: health detection being continued at least one above-mentioned server according to the second detection frequency.
In the embodiment of the present application, only with according to the second detection frequency of setting to server carry out health detection come into
Row illustrates.
Specifically, during carrying out health detection to a server according to the second detection frequency of setting, if really
The result for determining continuous N time health detection characterizes said one server health, then said one server is directed to, by setting
Second detection frequency error factor be setting first detection frequency, and according to it is above-mentioned first detect frequency to said one server after
It is continuous to carry out health detection, wherein M is given threshold.
For example, it is assumed that the first detection frequency set is 3 times/min, the second detection frequency set is born as 20 times/min
Balanced device is carried when the operation conditions for determining server 3 occurs abnormal, server 3 will be carried out the frequency of health detection from 3 times/
Min is switched to 20 times/min, continues to carry out health detection to server 3.In the detection frequency according to 20 times/min to server 3
During carrying out health detection, however, it is determined that it is health that continuous 60 testing results, which characterize server 3, then will be to server
The frequency of 3 progress health detections is switched to 3 times/min from 20 times/min, and according to the frequency of 3 times/min continue to server 3 into
Row health detection.
Specifically, during carrying out health detection to a server according to the second detection frequency of setting, if really
The result characterization said one server of fixed any health detection is unhealthy, then offline said one server.
For example, it is assumed that the first detection frequency set is 3 times/min, the second detection frequency set is born as 20 times/min
Balanced device is carried when the operation conditions for determining server 1 occurs abnormal, server 1 will be carried out the frequency of health detection from 3 times/
Min is improved to 20 times/min, continues to carry out health detection to server 1.In the detection frequency according to 20 times/min to server 1
During health detection, however, it is determined that the testing result of first time characterization server 1 is unhealthy, then direct offline server 1,
And prompt administrative staff's server 1 unhealthy.
Load balancer improves to above-mentioned that there are operation conditions when the operation conditions for determining presence server occurs abnormal
The health detection frequency of abnormal server, so as to timely detect that the above-mentioned server there are operation conditions exception is
No health.
Embodiment two:
As shown in fig.4, a kind of pair of server carries out the detailed process of the method for health detection such as in the embodiment of the present application
Under:
Step 400: the first detection frequency based on setting carries out health detection to each server respectively, wherein on
The first detection frequency is stated lower than the first given threshold.
Step 410: monitoring the operation conditions of each server, and judge the operation shape of each above-mentioned server respectively
Whether condition is normal.
Step 420: determining, for above-mentioned abnormal server, to set there are when the server of operation conditions exception
First detection frequency error factor be setting second detection frequency, and according to it is above-mentioned second detect frequency to above-mentioned abnormal service
Device continues health detection, wherein above-mentioned second detection frequency is higher than the second given threshold, and above-mentioned first given threshold is less than
Above-mentioned second given threshold.
Embodiment three:
Above-described embodiment is described in further detail using specific application scenarios below, as shown in fig.5, the application
In embodiment, load balancer is as follows to the detailed process of the server X method for carrying out health detection:
Step 500: the outflow of load balancer real time monitoring server X.
Specifically, load balancer carries out sampling operation to the outflow of each server, and generates phase according to sampled result
The outflow curve graph answered.
Step 510: load balancer calculates first outflow in current calculation cycle and adopts according to the calculating cycle of setting
The slope r of sampling point and the straight line where the last one outflow sampled point, and judge r whether less than 0, if so then execute step
520, it is no to then follow the steps 500.
Specifically, load balancer calculates separately the corresponding outflow curve of each server according to the calculating cycle of setting
In figure, the slope of first outflow sampled point and the straight line where the last one outflow sampled point in current calculation cycle,
And judge whether calculated slope r is negative.
For example, it is assumed that load balancer calculates the corresponding slope r=-50 of current calculation cycle, due to -50 < 0, then
Execute step 520.
In another example, it is assumed that the corresponding slope r=30 of the calculated current calculation cycle of load balancer is connect due to 30 > 0
Execution step 500.
Step 520: load balancer judges whether the absolute value of slope r is greater than predetermined threshold value A, if so, executing step
Rapid 530, otherwise, execute step 500.
For example, it is assumed that the absolute value that load balancer calculates the corresponding slope r of current calculation cycle is 50, pre-determined threshold
Value is 40, then, due to 50 > 40, then execute step 430.
In another example, it is assumed that the absolute value of the corresponding slope r of the calculated current calculation cycle of load balancer is 50, is preset
Threshold value is 80, then, due to 50 < 80, then execute step 400.
Step 530: load balancer is directed to server X, and health detection frequency is promoted to 3s/ times from 20s/ times, continues
Health detection is carried out to server X.
Specifically, load balancer by health detection frequency after being promoted to 3s/ times for 20s/ times, to server X continue into
Row health detection further can obtain corresponding health detection result according to health detection each time respectively.
Step 540: whether load balancer according to health detection result judges server X healthy, if it is not, thening follow the steps
550;If so, thening follow the steps 560.
Step 550: load balancer determines that server X is unhealthy, offline server X.
Step 560: load balancer determines server X health, is the health of health by the health detection result of server
Detection number adds 1.
Step 570: load balancer judges whether the health detection result of server X reaches for the health detection number of health
To preset number, if so, thening follow the steps 580, otherwise, step 530 is executed.
Step 580: load balancer is directed to server X, and health detection frequency is restored from 3s/ times to 20s/ times, is continued
Health detection is carried out to server X.
Example IV:
As shown in fig.6, a kind of pair of server carries out the detailed process of the method for health detection such as in the embodiment of the present application
Under:
Step 600: health detection is carried out at least one server respectively based on the first detection frequency.
Step 610: the operation conditions of monitoring server.
Step 620: when the operation conditions of determining server occurs abnormal, for there is abnormal server, by setting
First detection frequency error factor is the second detection frequency of setting, and abnormal clothes occurs to described according to the second detection frequency
Business device carries out health detection, wherein the second detection frequency is higher than the first detection frequency.
Based on the above embodiment, as shown in fig.7, in the embodiment of the present application, a kind of pair of server carries out health detection
Device includes at least detection unit 70, monitoring unit 71 and switch unit 72, wherein
Detection unit 70 carries out health detection to each server respectively for the first detection frequency based on setting,
Wherein, the first detection frequency is lower than the first given threshold;
Monitoring unit 71 for monitoring the operation conditions of each server, and judges each described server respectively
Operation conditions it is whether normal;
Switch unit 72, for determining there are when the server of operation conditions exception, for the abnormal server,
By the set first detection frequency error factor as the second detection frequency of setting, and according to the second detection frequency to the exception
Server continue health detection, wherein it is described second detection frequency be higher than the second given threshold, it is described first setting threshold
Value is less than second given threshold.
Preferably, the detection unit 70 is specifically used for when carrying out health detection to a server:
Health detection request message is sent to a server, and judges whether one server can be according to default
It is required that returning to corresponding response message;
If one server can return to corresponding response message according to preset requirement, it is determined that one service
Device health;
If one server can not return to corresponding response message according to preset requirement, it is determined that one clothes
Business device is unhealthy.
Preferably, the monitoring unit 71 is specifically used for when monitoring the operation conditions of each server:
Execute following operation respectively for each server:
It is sampled, and is drawn using the time as abscissa based on outflow of the sampling period of setting to a server,
The outflow of one server is the curve graph of ordinate;
Calculating cycle based on setting determines that first outflow sampled point goes out to flow with the last one in current calculation cycle
Measure the straight line where sampled point, and calculate the slope of the straight line, wherein calculating cycle=N* sampling period, N be more than or equal to
1 positive integer.
Preferably, when whether the operation conditions for judging each server respectively normal, the monitoring unit 71
It is specifically used for:
Execute following operation respectively for each server:
For a server, judge that first outflow sampled point and the last one outflow are adopted in current calculation cycle
Whether the slope of the straight line where sampling point is less than 0, and the absolute value of the slope is greater than predetermined threshold value;
If so, it is abnormal to determine that the operation conditions of one server occurs;Otherwise, it is determined that one server
Operation conditions is normal.
Preferably, when continuing health detection to the abnormal server according to the second detection frequency of setting,
The switch unit 72 is specifically used for:
Following operation is executed respectively for each of abnormal server server:
During carrying out health detection to a server according to the second detection frequency of setting, however, it is determined that any one
The one server of result characterization of secondary health detection is unhealthy, then offline one server, however, it is determined that continuous N time is strong
The result of health detection characterizes one server health, then is directed to one server, by the second detection frequency of setting
Rate is switched to the first detection frequency of setting, and continues health to one server according to the first detection frequency
Detection, wherein M is given threshold.
In conclusion in the embodiment of the present application, during carrying out health detection to server, based on setting first
It detects frequency and health detection is carried out to each server respectively, wherein the first detection frequency is lower than the first given threshold, monitoring
The operation conditions of each server, and judge whether the operation conditions of each server is normal respectively, determining there is fortune
It is the set by the set first detection frequency error factor for above-mentioned abnormal server when the server of row situation exception
Two detection frequencies, and health detection is continued to above-mentioned abnormal server according to the second detection frequency, wherein the second detection
Frequency is higher than the second given threshold, and the first given threshold is less than the second given threshold.
Using the method provided by the embodiments of the present application for carrying out health detection to server, server is not being monitored
When operation conditions occurs abnormal, health is carried out to each server according to lower the first detection frequency for being lower than the first given threshold
Detection, in this way, server is greatly lowered for responding the power consumption of health detection, so that the performance of server is improved, and
When monitoring abnormal server occur there are operation conditions, according to higher the second detection frequency for being higher than the second given threshold
There is abnormal server to operation conditions and carries out health detection in rate, in this way, ensuring that unsound server can be timely
It is detected, ensure that health detection efficiency.
It should be understood by those skilled in the art that, embodiments herein can provide as method, system or computer program
Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the application
Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the application, which can be used in one or more,
The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces
The form of product.
The application is referring to method, the process of equipment (system) and computer program product according to the embodiment of the present application
Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions
The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs
Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce
A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real
The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy
Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates,
Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or
The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting
Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or
The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one
The step of function of being specified in a box or multiple boxes.
Although the preferred embodiment of the application has been described, it is created once a person skilled in the art knows basic
Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as
It selects embodiment and falls into all change and modification of the application range.
Obviously, those skilled in the art can carry out various modification and variations without departing from this Shen to the embodiment of the present application
Please embodiment spirit and scope.In this way, if these modifications and variations of the embodiment of the present application belong to the claim of this application
And its within the scope of equivalent technologies, then the application is also intended to include these modifications and variations.
Claims (10)
1. the method that a kind of pair of server carries out health detection characterized by comprising
The first detection frequency based on setting carries out health detection to each server respectively, wherein the first detection frequency
Rate is lower than the first given threshold;
The operation conditions of each server is monitored, and judges whether the operation conditions of each server is normal respectively;
Determining, for the abnormal server, to detect frequency for the first of setting there are when the server of operation conditions exception
Rate is switched to the second detection frequency of setting, and continues to be good for the abnormal server according to the second detection frequency
Health detection, wherein the second detection frequency is higher than the second given threshold, and first given threshold is less than second setting
Threshold value.
2. the method as described in claim 1, which is characterized in that carry out health detection to a server, specifically include:
Health detection request message is sent to a server, and judges whether one server can be according to preset requirement
Return to corresponding response message;
If one server can return to corresponding response message according to preset requirement, it is determined that one server is strong
Health;
If one server can not return to corresponding response message according to preset requirement, it is determined that one server
It is unhealthy.
3. the method as described in claim 1, which is characterized in that the operation conditions for monitoring each server specifically includes:
Execute following operation respectively for each server:
It is sampled, and is drawn using the time as abscissa based on outflow of the sampling period of setting to a server, it is described
The outflow of one server is the curve graph of ordinate;
Calculating cycle based on setting determines that first outflow sampled point and the last one outflow are adopted in current calculation cycle
Straight line where sampling point, and calculate the slope of the straight line, wherein calculating cycle=N* sampling period, N are more than or equal to 1
Positive integer.
4. method as claimed in claim 3, which is characterized in that whether the operation conditions of each server described in judging respectively
Normally, it specifically includes:
Execute following operation respectively for each server:
For a server, first outflow sampled point and the last one outflow sampled point in current calculation cycle are judged
Whether the slope of the straight line at place is less than 0, and the absolute value of the slope is greater than predetermined threshold value;
If so, it is abnormal to determine that the operation conditions of one server occurs;Otherwise, it is determined that the operation of one server
Situation is normal.
5. method according to any of claims 1-4, which is characterized in that according to the second detection frequency of setting to described different
Normal server continues health detection, specifically includes:
Following operation is executed respectively for each of abnormal server server:
During carrying out health detection to a server according to the second detection frequency of setting, however, it is determined that any primary strong
The one server of result characterization of health detection is unhealthy, then offline one server, however, it is determined that continuous N time health inspection
The result of survey characterizes one server health, then is directed to one server, and the second detection frequency of setting is cut
It is changed to the first detection frequency of setting, and healthy inspection is continued to one server according to the first detection frequency
It surveys, wherein M is given threshold.
6. the device that a kind of pair of server carries out health detection characterized by comprising
Detection unit carries out health detection to each server respectively for the first detection frequency based on setting, wherein institute
The first detection frequency is stated lower than the first given threshold;
Monitoring unit for monitoring the operation conditions of each server, and judges the operation of each server respectively
Whether situation is normal;
Switch unit, for determining, for the abnormal server, to set there are when the server of operation conditions exception
First detection frequency error factor be setting second detection frequency, and according to it is described second detect frequency to the abnormal service
Device continues health detection, wherein the second detection frequency is higher than the second given threshold, and first given threshold is less than
Second given threshold.
7. a kind of storage medium, which is characterized in that be stored with the program for carrying out health detection to server, described program quilt
When processor is run, following steps are executed:
The first detection frequency based on setting carries out health detection to each server respectively, wherein the first detection frequency
Rate is lower than the first given threshold;
The operation conditions of each server is monitored, and judges whether the operation conditions of each server is normal respectively;
Determining, for the abnormal server, to detect frequency for the first of setting there are when the server of operation conditions exception
Rate is switched to the second detection frequency of setting, and continues to be good for the abnormal server according to the second detection frequency
Health detection, wherein the second detection frequency is higher than the second given threshold, and first given threshold is less than second setting
Threshold value.
8. a kind of communication device, which is characterized in that including one or more processors;And
One or more computer-readable mediums are stored with instruction on the readable medium, and described instruction is by one or more
When a processor executes, so that described device executes the method as described in any one of claims 1 to 5.
9. one or more computer-readable mediums, which is characterized in that be stored with instruction, described instruction quilt on the readable medium
When one or more processors execute, so that communication equipment executes the method as described in any one of claims 1 to 5.
10. the method that a kind of pair of server carries out health detection characterized by comprising
Health detection is carried out at least one server respectively based on the first detection frequency;
The operation conditions of monitoring server;
When the operation conditions of determining server occurs abnormal, for there is abnormal server, frequency is detected by the first of setting
It is switched to the second detection frequency of setting, and abnormal server progress health occurs to described according to the second detection frequency
Detection, wherein the second detection frequency is higher than the first detection frequency.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710508458.1A CN109150644A (en) | 2017-06-28 | 2017-06-28 | A kind of pair of server carries out the method and device of health detection |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710508458.1A CN109150644A (en) | 2017-06-28 | 2017-06-28 | A kind of pair of server carries out the method and device of health detection |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109150644A true CN109150644A (en) | 2019-01-04 |
Family
ID=64803494
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710508458.1A Pending CN109150644A (en) | 2017-06-28 | 2017-06-28 | A kind of pair of server carries out the method and device of health detection |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109150644A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110417614A (en) * | 2019-06-18 | 2019-11-05 | 平安科技(深圳)有限公司 | Cloud Server self checking method, device, equipment and computer readable storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS58151146A (en) * | 1982-03-03 | 1983-09-08 | Nec Corp | Remote monitor system |
CN101316268A (en) * | 2008-07-04 | 2008-12-03 | 中国科学院计算技术研究所 | Detection method and system for exception stream |
CN104159306A (en) * | 2014-07-22 | 2014-11-19 | 华为技术有限公司 | Method, device and system for controlling radio resources |
CN106817267A (en) * | 2015-11-27 | 2017-06-09 | 华为技术有限公司 | A kind of fault detection method and equipment |
-
2017
- 2017-06-28 CN CN201710508458.1A patent/CN109150644A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS58151146A (en) * | 1982-03-03 | 1983-09-08 | Nec Corp | Remote monitor system |
CN101316268A (en) * | 2008-07-04 | 2008-12-03 | 中国科学院计算技术研究所 | Detection method and system for exception stream |
CN104159306A (en) * | 2014-07-22 | 2014-11-19 | 华为技术有限公司 | Method, device and system for controlling radio resources |
CN106817267A (en) * | 2015-11-27 | 2017-06-09 | 华为技术有限公司 | A kind of fault detection method and equipment |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110417614A (en) * | 2019-06-18 | 2019-11-05 | 平安科技(深圳)有限公司 | Cloud Server self checking method, device, equipment and computer readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9739801B2 (en) | Analytical gateway device for measurement devices | |
CN105516347B (en) | A kind of method and device of the load balancing allotment of streaming media server | |
JP6236587B2 (en) | System and method for optimizing and managing demand response and distributed energy resources | |
WO2017107577A1 (en) | Node probing method and device, path selection method and device, and network system | |
CN110460732B (en) | Network quality monitoring method and device and communication server | |
CN107992410B (en) | Software quality monitoring method and device, computer equipment and storage medium | |
US9588156B2 (en) | Monitoring voltage stability of a transmission corridor | |
JP2013109742A (en) | Method and system for detecting electrical appliances based on user feedback information | |
JP5520338B2 (en) | Electrical equipment detection and power consumption monitoring system | |
CN110166271B (en) | Method and device for detecting network node abnormality | |
CN103166980B (en) | Internet data pulls method and system | |
CN106685752B (en) | A kind of information processing method and terminal | |
CN109617758B (en) | Node network quality calculation method and device, server and computer storage medium | |
CN105373118A (en) | Intelligent equipment data acquisition method | |
CN113438106A (en) | Content distribution network processing method and device and electronic equipment | |
CN109150644A (en) | A kind of pair of server carries out the method and device of health detection | |
CN105530110B (en) | A kind of network fault detecting method and related network elements | |
CN106209404B (en) | Analyzing abnormal network flow method and system | |
CN105245591B (en) | A kind of monitoring method and system of the experience of desktop cloud performance | |
KR101292933B1 (en) | Method, apparatus, and computer-readable recording medium for identifying appliance, and power monitoring system | |
US9356848B2 (en) | Monitoring apparatus, monitoring method, and non-transitory storage medium | |
CN110674124B (en) | Abnormal data detection method and system and intelligent router | |
CN110007940B (en) | Gray scale release verification method, system, server and readable storage medium | |
KR101256916B1 (en) | Method for quality measurement of mobile device increasing qos in cloud-based infrastructure and the system thereby | |
CN114095394B (en) | Network node fault detection method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190104 |