CN105337786A - Server performance detection method, apparatus and equipment - Google Patents
Server performance detection method, apparatus and equipment Download PDFInfo
- Publication number
- CN105337786A CN105337786A CN201410353696.6A CN201410353696A CN105337786A CN 105337786 A CN105337786 A CN 105337786A CN 201410353696 A CN201410353696 A CN 201410353696A CN 105337786 A CN105337786 A CN 105337786A
- Authority
- CN
- China
- Prior art keywords
- server
- detection
- information
- performance
- interval duration
- 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.)
- Granted
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 411
- 230000004044 response Effects 0.000 claims abstract description 118
- 238000000034 method Methods 0.000 claims abstract description 81
- 238000013507 mapping Methods 0.000 claims abstract description 42
- 238000012360 testing method Methods 0.000 claims description 88
- 230000008569 process Effects 0.000 description 43
- 238000010586 diagram Methods 0.000 description 14
- 230000008859 change Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 8
- 230000006870 function Effects 0.000 description 7
- 230000001960 triggered effect Effects 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 238000005516 engineering process Methods 0.000 description 5
- 238000005538 encapsulation Methods 0.000 description 4
- 230000002159 abnormal effect Effects 0.000 description 3
- 230000006855 networking Effects 0.000 description 3
- 238000011056 performance test Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 125000004122 cyclic group Chemical group 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 238000005728 strengthening Methods 0.000 description 1
Landscapes
- Computer And Data Communications (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
An embodiment of the invention provides a server performance detection method, an apparatus and equipment. The method comprises the following steps that detection equipment sends a first detection message to a detected server and the first detection message carries first information; the detection equipment receives a first response message returned by the detected server corresponding to the first detection message and the first response message carries second information; the second information and the first information possess a mapping relation; the detection equipment determines whether the detected server is in a available state; based on a condition that the detection equipment determines that the detected server is in the available state, the detection equipment acquires first interval time between the first detection message and the first response message; the detection equipment determines a performance grade of the detected server according to the first interval time. Rationality and accuracy of a server performance detection result can be increased.
Description
Technical Field
The invention relates to the technical field of communication, in particular to a method, a device and equipment for detecting server performance.
Background
With the continuous development of information technology and the gradual increase of user access amount, the performance of a single server cannot meet the access requirements of a large number of users, and at present, a stable and reliable network access service is provided for the users mostly by deploying a plurality of groups of servers.
In order to make the multiple groups of servers provide good access service for users, after receiving an access request of a client user, the access request can be distributed to multiple servers through a service load balancing technology, and the multiple servers collectively respond to the access request. Therefore, the response condition of the access request mainly depends on the performance of the server distributed for the user in the load balancing process, and if the performance of the server distributed for the user is good, the response time is short, and the user experience is good; if the server allocated to the user fails, the response time is prolonged, and the user experience is reduced. In order to obtain service performance information of a server, a scheme for detecting a performance state of the server exists at present, and the following takes DNS service as an example to simply introduce the performance detection scheme:
firstly, the load balancing device sends a detection message to a DNS server, wherein the detection message carries an identification code transactioniD. And then, responding to the load balancing equipment by the DNS server, feeding back a response message to the load balancing equipment, wherein the response message carries the identification code acquired by the DNS server from the detection message. And finally, judging the performance of the DNS server by the load balancing equipment according to the identification code. The main reason is that when the DNS server normally works, the identification code obtained by the DNS server should be kept consistent with the identification code in the detection message, so if the load balancing device determines that the identification code carried in the response message is the same as the identification code in the detection message, the server state is considered to be available and can be allocated to the user for use in the load balancing process; otherwise, the server state is considered unavailable and cannot be allocated to the user for the moment.
According to the above process, the current performance test is only to determine whether the server is available, but it is known that the server can work normally and can not provide good service for the user. Thus, if load balancing is performed only according to the current performance detection result, the allocation reasonableness of the server may be reduced, so that the response time of the server for providing service for the user is too long, and the server may not be able to provide service for the user in a serious case.
Disclosure of Invention
The server performance detection method, the device and the equipment provided by the embodiment of the invention are used for improving the reasonability and the accuracy of a detection result when the server performance is detected.
Therefore, the embodiment of the invention provides the following technical scheme:
in a first aspect, a method for detecting server performance is provided, where the method includes:
the method comprises the steps that a detection device sends a first detection message to a detected server, wherein the first detection message carries first information;
the detection equipment receives a first response message returned by the detected server corresponding to the first detection message, wherein the first response message carries second information, and the second information and the first information have a mapping relation;
the detection equipment determines whether the server under test is in an available state;
determining that the server under test is in an available state based on the detection device, wherein the detection device acquires a first interval duration between the first detection message and the first response message;
and the detection equipment determines the performance level of the tested server according to the first interval duration.
In a first possible implementation manner of the first aspect, the detection device is configured with a preset database, where the preset database stores the first information, and before the detection device sends the first detection packet to the server under test, the method further includes:
and the detection equipment reads the first information from the preset database and generates the first detection message by using the first information.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, if the preset database further stores first level information of the first information, the determining, by the detection device, a performance level of the server under test according to the first interval duration includes:
and the detection equipment determines the performance level of the tested server according to the first interval duration and the first level information.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, the first level information is set according to a frequency that a network resource identified by the first information is accessed or a category to which the first information belongs.
With reference to any one of the first to third possible implementation manners of the first aspect, in a fourth possible implementation manner of the first aspect, the preset database further stores a correspondence between the identity of the server under test and the first information, and before the detecting device sends the first detection packet to the server under test, the method further includes:
and the detection equipment selects the identity of the server to be detected from the corresponding relation according to the first information.
With reference to any one of the first to fourth possible implementation manners of the first aspect, in a fifth possible implementation manner of the first aspect, the method further includes, based on the determination that the server under test is in an available state by the detection device, that the method further includes:
the detection equipment sends a second detection message to the tested server, wherein the second detection message carries third information;
the detection equipment receives a second response message returned by the detected server corresponding to the second detection message, wherein the second response message carries fourth information, and a mapping relation exists between the fourth information and the third information;
the detection equipment acquires a second interval duration between the second detection message and the second response message;
the method for determining the performance level of the tested server by the detection equipment according to the first interval duration comprises the following steps:
the detection equipment determines the performance grade of the tested server according to the second interval duration, and calculates the average value of the performance grade of the tested server by using the performance grade determined according to the first interval duration and the performance grade determined according to the second interval duration; or,
the detection equipment calculates the interval duration mean value by utilizing the first interval duration and the second interval duration, and determines the performance grade of the tested server according to the interval duration mean value.
With reference to the first aspect or any one of the first to fifth possible implementation manners of the first aspect, in a sixth possible implementation manner of the first aspect, the method further includes:
determining that the tested server is in an unavailable state based on the detection equipment, and returning to the step of executing the first detection message sent to the tested server by the detection equipment until a preset condition is met; the preset condition is a preset execution time or a preset execution time length.
With reference to the first aspect or any one of the first to sixth possible implementation manners of the first aspect, in a seventh possible implementation manner of the first aspect, the server to be tested is a DNS server, the first detection packet is a DNS request packet, the first response packet is a DNS response packet, the first information is a first domain name, and the second information is an IP address.
In a second aspect, an apparatus for detecting server performance is provided, the apparatus comprising:
the device comprises a sending unit, a receiving unit and a sending unit, wherein the sending unit is used for sending a first detection message to a tested server, and the first detection message carries first information;
a receiving unit, configured to receive a first response packet returned by the server under test corresponding to the first detection packet, where the first response packet carries second information, and a mapping relationship exists between the second information and the first information;
a state determining unit, configured to determine whether the server under test is in an available state;
an obtaining unit, configured to obtain a first interval duration between the first detection packet and the first response packet based on the determination that the server under test is in an available state by the state determining unit;
and the grade determining unit is used for determining the performance grade of the tested server according to the first interval duration acquired by the acquiring unit.
In a first possible implementation manner of the second aspect, the apparatus is configured with a preset database, where the preset database holds the first information, and the apparatus further includes:
and the reading unit is used for reading the first information from the preset database before the sending unit sends the first detection message to the tested server, and generating the first detection message by using the first information.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, if the preset database further stores the first level information of the first information, then the preset database stores the first level information of the first information
The level determining unit is specifically configured to determine the performance level of the server under test according to the first interval duration and the first level information; the first level information is set according to the frequency of the network resource being accessed identified by the first information or the category to which the first information belongs.
With reference to the first or second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the preset database further stores a corresponding relationship between the identity of the server under test and the first information, and before the detecting device sends the first detection packet to the server under test, the apparatus further includes:
and the selecting unit is used for selecting the identity of the tested server from the corresponding relation according to the first information before the sending unit sends the first detection message to the tested server.
With reference to the second or third possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the server under test is determined to be in an available state based on the state determination unit,
the sending unit is further configured to send a second detection packet to the tested server, where the second detection packet carries third information;
the receiving unit is further configured to receive a second response packet returned by the detected server corresponding to the second detection packet, where the second response packet carries fourth information, and a mapping relationship exists between the fourth information and the third information;
the obtaining unit is further configured to obtain a second interval duration between the second detection packet and the second response packet;
the level determining unit is specifically configured to determine the performance level of the server to be tested according to the second interval duration, and calculate a performance level average of the server to be tested by using the performance level determined according to the first interval duration and the performance level determined according to the second interval duration; or,
the level determining unit is specifically configured to calculate an interval duration average value by using the first interval duration and the second interval duration, and determine the performance level of the measured server according to the interval duration average value.
With reference to the second aspect or any one of the first to fourth possible implementation manners of the second aspect, in a fifth possible implementation manner of the second aspect, the sending unit is further configured to determine, based on the state determining unit, that the server under test is in an unavailable state, and continue to send the first detection packet to the server under test until a preset condition is met; the preset condition is a preset execution time or a preset execution time length.
In a third aspect, a server performance detection device is provided, where the device includes: a processor, memory, and a network interface;
the memory for storing program instructions and data;
the processor is used for reading the instructions and data stored in the memory and executing the following operations:
triggering the network interface to send a first detection message to a tested server, wherein the first detection message carries first information;
receiving a first response message returned by the tested server corresponding to the first detection message through the network interface, wherein the first response message carries second information, and a mapping relation exists between the second information and the first information;
determining whether the server under test is available;
acquiring a first interval duration between the first detection message and the first response message based on the fact that the tested server is determined to be in the available state;
and determining the performance grade of the tested server according to the first interval duration.
In a first possible implementation manner of the third aspect, the detection device is configured with a preset database, where the preset database stores the first information, and before the triggering the network interface to send the first detection packet to the server under test, the processor is further configured to perform the following operations:
and reading the first information from the preset database, and generating the first detection message by using the first information.
With reference to the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, if the preset database further stores first level information of the first information, the determining, by the processor, the performance level of the server under test according to the first interval duration includes:
determining the performance level of the tested server according to the first interval duration and the first level information; the first level information is set according to the frequency of the network resource being accessed identified by the first information or the category to which the first information belongs.
With reference to the first or second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect, the preset database further stores a corresponding relationship between the identity of the server under test and the first information, and before the triggering the network interface to send the first detection packet to the server under test, the processor is further configured to perform the following operations:
and selecting the identity of the server to be tested from the corresponding relation according to the first information.
With reference to any one of the first to third possible implementation manners of the third aspect, in a fourth possible implementation manner of the third aspect, based on the determination that the server under test is in the available state, the processor is further configured to:
triggering the network interface to send a second detection message to the tested server, wherein the second detection message carries third information;
receiving a second response message returned by the tested server corresponding to the second detection message through the network interface, wherein the second response message carries fourth information, and a mapping relation exists between the fourth information and the third information;
acquiring a second interval duration between the second detection message and the second response message;
the determining the performance level of the server to be tested according to the first interval duration includes:
determining the performance grade of the tested server according to the second interval duration, and calculating the average value of the performance grade of the tested server by using the performance grade determined according to the first interval duration and the performance grade determined according to the second interval duration; or,
and calculating an interval time average value by using the first interval time and the second interval time, and determining the performance grade of the tested server according to the interval time average value.
With reference to the third aspect or any one of the first to fourth possible implementation manners of the third aspect, in a fifth possible implementation manner of the third aspect, the processor is further configured to perform the following operations:
based on the fact that the tested server is determined to be in an unavailable state, returning to execute the operation of triggering the network interface to send the first detection message to the tested server until a preset condition is met; the preset condition is a preset execution time or a preset execution time length.
According to the server performance detection method, device and equipment provided by the embodiment of the invention, when the server performance detection is required, the detection equipment sends the first detection message to the detected server and receives the first response message returned by the detected server aiming at the first detection message, so that the detection equipment can determine the working state of the detected server by using the first detection message and the first response message, and when the detected server is in an available state, the performance level of the detected server is determined according to the first interval duration between the first detection message and the first response message. The interval duration can reflect the response speed of the processing request of the tested server to a certain extent, so that the embodiment of the invention can determine the performance grade of the tested server with more discrimination by combining the working state and the response speed of the tested server, and improve the accuracy of the performance detection result. Therefore, the rationality of load balancing of the load balancing equipment based on the performance detection result of the embodiment of the invention is improved, and the distributed servers can be ensured to provide good-quality access service for client users.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
FIG. 1 is a schematic diagram of networking for DNS server performance detection according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a recursive query in accordance with an embodiment of the invention;
FIG. 3 is a flowchart illustrating a method for detecting server performance according to an embodiment of the present invention;
FIG. 4-1 is a timing diagram illustrating a process of detecting server performance according to an embodiment of the present invention;
FIG. 4-2 is another timing diagram illustrating a server performance detection process according to an embodiment of the invention;
FIGS. 4-3 are timing diagrams illustrating another exemplary server performance testing process according to the present invention;
FIG. 5 is a schematic diagram of a server performance detection apparatus according to an embodiment of the present invention;
fig. 6 is a schematic configuration diagram of a server performance detection device according to an embodiment of the present invention.
Detailed Description
In order to make the technical field of the invention better understand the scheme of the invention, the following detailed description of the embodiments of the invention is provided in conjunction with the accompanying drawings and the implementation mode.
Before the technical solution of the embodiment of the present invention is introduced, a specific application scenario of the present invention is explained.
The service load balancing technology provides a cheap, effective and transparent method for expanding the bandwidth of network equipment and servers, increasing the throughput, strengthening the network data processing capacity and improving the flexibility and the usability of the network. When load balancing is needed, the load balancing equipment distributes access requests of client users to a plurality of servers, and the plurality of servers provide access services for the client users in parallel.
In order to enable a server to provide good service for a client user, at present, the performance of the server is mainly reflected by a working state (which can be embodied as an available state and an unavailable state) of the server, and then a load balancing device selects a server allocated to the client user from the available state servers by using a load balancing algorithm. The following explains the existing server performance detection process with reference to the DNS (domain name system) performance detection networking diagram shown in fig. 1, in which the first DNS server (128.18.52.55) serves as the server under test.
Firstly, under the condition that the operation of the whole network interface is ensured to be normal (the interface state can be understood to be UP), the load balancing device (128.18.52.51) initiates a DNS request (i.e. the detection message in the foregoing) to the DNS server (128.18.52.55) under test by using the DNS protocol, for example, the DNS request requests to access the server corresponding to the domain name www.huawei.com, and at this time, the DNS request at least carries the domain name and the identification code (the identification code is generated by the DNS request sender, and is used for identifying the query and the response and pairing the query and the response corresponding to each other.
Secondly, after receiving the DNS request, the tested DNS server performs the following three actions: firstly, performing domain name resolution to obtain an IP address of a server corresponding to a domain name; secondly, acquiring an identification code in the DNS request; thirdly, the IP address and the identification code are added to the DNS response (i.e. the response message in the foregoing), and the DNS response is sent to the load balancing device.
Finally, after receiving the DNS response, the load balancing equipment judges whether the identification code in the response is consistent with the identification code in the request, and if so, the working state of the tested DNS server is judged to be an available state; if the DNS server is not in accordance with the DNS server to be tested, the working state of the DNS server to be tested is judged to be in an unavailable state, and correspondingly, the load balancing equipment modifies the algorithm for allocating the server to the user, and the DNS server in the unavailable state is not allocated to the user for use temporarily.
Based on the existing server performance detection scheme, it can be ensured that the server allocated to the user can provide the access service for the user, but it cannot be ensured that the server can provide the access service with good quality for the user. The following exemplifies factors that affect the quality of service of the server.
Factor one, the DNS server does not locally cache the mapping of domain names to IP addresses.
After receiving http:// www.huawei.com input by a user, the client sends a DNS request to a DNS server allocated to the client by the load balancing device (such a DNS server allocated to the client may be referred to as a LocalDNS server). Correspondingly, after receiving the DNS request, the LocalDNS server first queries whether an effective mapping relationship of www.huawei.com is cached in its local cache:
if yes, domain name resolution is directly carried out according to the mapping relation to obtain the IP address of the server corresponding to www.huawei.com, and therefore the LocalDNS server can respond to the client request in a short time and with low resource consumption, and high-quality access service is provided for the user.
If not, then a recursive query is performed, as shown in FIG. 2. The LocalDNS server selects one root DNS server from a list of locally pre-configured root DNS servers and sends a request for query www.huawei.com to it. Since the authoritative DNS server corresponding to the top level domain is recorded in the root DNS server, the root DNS server returns the IP address of the authoritative DNS server corresponding to the com domain to the LocalDNS server in this example. Thus, the LocalDNS server can continue to initiate www.huawei.com a domain name resolution request to the authoritative DNS server corresponding to the com domain, and the authoritative DNS server corresponding to the com domain returns the IP address of the authoritative domain server corresponding to the huawei. Finally, the LocalDNS server continues to send www.huawei.com domain name resolution requests to the authorized domain server corresponding to huawei.com, the authorized domain server corresponding to huawei.com returns www.huawei.com the IP address of the corresponding server to the LocalDNS server, then the LocalDNS server returns the resolved IP address to the client browser, and the browser sends an http get instruction to the 80 port of the IP address of the server corresponding to www.huawei.com, so that the server can respond to the client request and return the content of the client user request to the client request.
As can be seen from the recursive query process, when the local uncached domain name of the LocalDNS server has no mapping relationship with the IP address, the LocalDNS server needs to spend a long time and much resource consumption to respond to the client request, so that the access quality provided for the user is poor.
Factor two, the DNS server carries a greater load.
When the DNS server is available, the amount of load carried by the server may also affect the quality of service of the server. Generally, the number of server load-bearing loads and the server response time length are in inverse proportion, that is, the smaller the number of server load-bearing loads, the shorter the time for the server to respond to the client request; otherwise the longer the response time. Still taking the performance monitoring networking diagram shown in fig. 1 as an example, the number of loads carried by the first DNS server (128.18.52.55) is close to full, the second DNS server (128.18.52.56) is relatively idle, and if both are available, the load balancing device may allocate the two servers to the client during the load balancing process. Generally, when a client sends an access request to a server allocated to the client, no weighting or restriction process is performed, which may cause new load to be continuously added to the first DNS server and new DNS requests to be continuously added, so that the first DNS server is overloaded and even crashed.
In summary, it can be known that the performance of the server cannot be correctly reflected by the existing server performance detection scheme, so that the rationality of allocating servers to the client in the load balancing process is affected, and the quality (e.g., long response time) and the cost (e.g., much resource consumption) of providing services to the client by the allocated servers are poor (e.g., long response time). The technical scheme provided by the embodiment of the invention aims to provide a novel method for detecting the performance of the server, and improve the accuracy of the detection result, thereby providing certain technical support for improving the rationality of the load balancing process, improving the service quality of the distributed server and the like.
Referring to fig. 3, a flow chart of a server performance detection method according to an embodiment of the present invention is shown, which may include the following steps:
step 101, a detection device sends a first detection message to a detected server, wherein the first detection message carries first information.
In order to improve the accuracy of the performance detection of the server, the embodiment of the invention needs to detect the response speed of the server in addition to the working state of the server, and determine the performance level of the server according to the two aspects of information. Specifically, the response speed of the server can be reflected by the time of the server responding to the access request, for this reason, the detection device may first send a first detection packet to the server under test, wait for receiving a first response returned by the server under test for the first detection packet, and take the interval duration between the first detection packet and the first response packet as the time of the server responding to the access request.
As an example, the detection device may receive first information input externally, generate a first detection message, and send the first detection message to the server under test. Taking the server to be tested as the DNS server as an example, after the detection device receives the domain name www.huawei.com input from the outside, the detection device may generate a DNS request carrying at least the domain name www.huawei.com using the DNS protocol. Under the scheme, the detection equipment can utilize the first information specified externally to carry out performance detection on the server to be detected. It should be noted that the first information may be input to the detection device by an external detection person in a manner of a command line, or may also be input to the detection device by an external device (such as a load balancing device, a client, etc.), which is not limited in this embodiment of the present invention.
Or, as an example, the detection device may further be configured with a preset database, and the preset database stores the first information, so that when performance detection is required, the detection device may read the first information from the preset database, generate the first detection packet, and send the first detection packet to the server under test. Taking a server to be tested as a DNS server as an example, the detection device receives externally input trigger information, that is, can read first information (e.g., www.huawei.com) from the database, and generates a DNS request carrying at least www.huawei.com using a DNS protocol. According to the scheme, the detection equipment can randomly read the first information from the database and actively utilize the first information to carry out performance detection on the server to be detected. It should be noted that the trigger information may be an externally input trigger instruction, or may also be an externally input DNS request (a domain name carried by the DNS request is different from a domain name carried by the first detection packet, for example, the domain name carried by the DNS request as the trigger information is www.baidu.com, and after receiving the trigger information, the detection device reads the domain name www.huawei.com from the database, replaces www.baidu.com in the original DNS request, and generates the first detection packet). Similarly, the trigger information may be input by an external device or an external detection person, and the input source, the expression form, and the like of the trigger information may not be specifically limited in the embodiments of the present invention.
102, the detection device receives a first response message returned by the detected server corresponding to the first detection message, wherein the first response message carries second information, and the second information and the first information have a mapping relationship.
After sending a first detection message to a server to be detected, a detection device starts to wait for receiving a first response message fed back by the server to be detected, wherein the first response message at least carries second information, and the second information has a mapping relation with first information in the first detection message. Still taking the tested server as the DNS server as an example, the first detection message is a DNS request, the first information is a domain name requested to be accessed, the first response message is a DNS response message, the second information is an IP address of a server providing a service corresponding to the domain name, and the mapping relationship is a mapping relationship between the domain name and the IP address.
Step 103, the detection device determines whether the server under test is in an available state.
The detection device sends the first detection message to the tested server, and receives the first response message returned by the tested server, and then step 103 may be executed to determine whether the working state of the tested server is the available state.
As an example, the detection device may determine the operating status of the server under test according to the identification code. That is, the first detection message carries the identification code in addition to the first information, and the first response message carries the identification code in addition to the second information, so that the detection device can determine whether the working state of the detected server is the available state according to the identification code as described above, and the specific process is not repeated here.
Or, as an example, the detection device may further determine the working state of the server under test according to externally input indication information. Specifically, the external device (e.g., the load balancing device, the client, etc.) may determine the working state of the server under test according to the identification code carried in the first detection packet and the first response packet, and add the determination result to the indication information and send the indication information to the detection device, as described above; or, after knowing the working state of the server to be detected, the external detection personnel inputs the working state of the server to be detected to the detection device in a command line manner, which is not specifically limited in the embodiment of the present invention.
And 104, determining that the detected server is in an available state based on the detection equipment, wherein the detection equipment acquires a first interval duration between the first detection message and the first response message.
And 105, the detection equipment determines the performance level of the tested server according to the first interval duration.
In step 103, if the detection device determines that the detected server is in the available state, the detection device may obtain a first interval duration between the first detection packet and the first response packet, and further determine the performance level of the detected server by using the first interval duration. Specifically, the shorter the interval duration is, the faster the response speed of the tested server is, and the better the performance is; otherwise, the slower the response speed of the tested server is, the worse the performance is. If it is assumed that a lower level of server performance indicates better server performance, the relationship Y ═ f (D) between interval duration (D) and performance level (Y) may be embodied as a positive proportional relationship Y ═ kD, where k is a scaling factor, and may be embodied as any positive number as needed.
As an example, the server performance level may be divided into two levels, from low to high: good performance (which may be defined as level 1) and poor performance (which may be defined as level 2), so that an interval duration threshold is set, and when the first interval duration does not exceed the threshold, the performance level of the tested server is determined to be good performance; and when the duration of the first interval exceeds the threshold, determining the performance level of the tested server as poor performance. Or, a performance threshold may be set, that is, after the k value is configured, the performance value Y of the server to be tested corresponding to the first interval duration is calculated according to Y ═ kD, and when Y does not exceed the performance threshold, the performance level of the server to be tested is determined to be good; and when Y exceeds the performance threshold, determining the performance level of the tested server as poor performance. Specifically, the threshold setting, the k value configuration, and the like may be determined according to actual use requirements, and this may not be specifically limited in the embodiment of the present invention.
In addition, considering that there may be multiple factors that affect the interval duration, for example, whether the mapping relationship is cached locally in the tested server, the number of the load carried by the tested server, the processing capability of the tested server itself, the network environment between the tested server and the detection device, and the like, as an example, the factors that affect the interval duration may be arbitrarily combined, the relationship between the interval duration and the server performance level under each combination may be counted, and the server performance level may be divided into multiple levels. For example, the performance of the final partition is, in order from high to low: the performance level of the server under test can be determined more precisely by setting thresholds between the performance levels according to the statistics of the combinations, such as good performance (which can be defined as level 1), good performance (which can be defined as level 2), medium performance (which can be defined as level 3), and poor performance (which can be defined as level 4). Specifically, the threshold for distinguishing the performance level may be embodied as an interval duration threshold, so that the detection device may compare the first interval duration with each interval duration threshold to determine the performance level of the detected server; or, the threshold for distinguishing the performance level may also be embodied as a performance threshold, so that the detection device may calculate the performance value Y of the tested server by using the configured k value and the first interval duration D, and compare the performance value Y with each performance threshold to determine the performance level of the tested server. Specifically, factors affecting the interval duration, combinations formed by the factors, the divided performance levels, the threshold setting, the k value configuration, and the like may all be determined according to actual use requirements, and this may not be specifically limited in the embodiment of the present invention.
In summary, after the embodiment of the present invention determines that the detected server is in the available state, the performance level of the detected server is further determined by combining the interval duration between the detection packet and the response packet, because the interval duration can reflect the response speed of the detected server for processing the request to a certain extent, the accuracy of the server performance detection result can be improved, so that the rationality of the load balancing device for performing load balancing based on the performance detection result of the embodiment of the present invention is improved, and the allocated server can be ensured to provide good quality access service for the client user.
It should be noted that the detection device in the embodiment of the present invention may be an independent device, and is connected between the client and the server to be tested; or, the function of the detection device may also be integrated in the load balancing device without changing the connection relationship of the existing network, which may not be specifically limited in the embodiment of the present invention.
In addition, it should be further noted that, as exemplified above, the server under test in the embodiment of the present invention may be embodied as a DNS server, or the server under test may also be embodied as a call center server, a content distribution server in a CDN (content distribution network), and the like, and a server in which the mapping relationship between the first information and the second information may be cached locally. If the server to be tested is a call center server, the first detection message is a call request, the first information is an account number (generally, the account number can be embodied as a telephone number of the called user) of the called user, the first response message is a call response, the second information is a client IP address corresponding to the called user, and the mapping relation is a mapping relation between the account number and the IP address. If the server to be tested is a content distribution server, the first detection message is a content access request, the first information is content information (which may be embodied as a URL, a keyword, a title, and the like corresponding to the content) requesting access, the first response message is a content access response, the second information is an IP address of the cache server, and the mapping relationship is a mapping relationship between the content information and the IP address of the cache server.
The following explains the performance detection process of the embodiment of the present invention by taking a DNS server as an example.
Example 1
For a DNS server to be tested, a plurality of domain names are stored in a preset database configured by a detection device, which may be specifically shown in table 1 below:
numbering | Domain name |
1 | www.huawei.com |
2 | www.baidu.com |
3 | www.sina.com |
4 | www.cnki.net |
… | … |
Referring to the timing diagram shown in fig. 4-1, the performance testing process of the present embodiment may include the following steps:
1. com, so that the detecting device may be triggered to read a domain name for detection from the preset database, for example, the read domain name is www.huawei.com (i.e., the first information above).
2. And the detection equipment changes the message encapsulation mode of the DNS request, and changes www.sina.com in the DNS request to www.huawei.com to form a new DNS request. As an example, the detection device may unpack the Queries field of the DNS request and add the domain Name for detection to the Name of the Queries field to form a new DNS request.
3. The detection device sends a modified DNS request (i.e., the first detection packet in the foregoing) to the DNS server to be detected, where the request carries domain name www.huawei.com and identification number TransactionID.
4. The DNS server under test receives the DNS request sent by the detection device, performs domain name resolution to obtain an IP address (i.e., the second information above) having a mapping relationship with www.huawei.com, adds the IP address and the identification code obtained from the DNS request to a DNS reply message (i.e., the first response message above), and sends the DNS reply message to the detection device.
5. The detection equipment receives a DNS response message sent by a DNS server to be detected, and determines the following two pieces of information:
(1) the working state status(s) of the DNS server to be tested can be obtained by comparing the identification codes, and is not described herein again. As an example, when the DNS server under test is in the unavailable state, S may be recorded as 0, and when the DNS server under test is in the available state, S may be recorded as 1.
(2) Recording the time for sending the DNS request and the time for receiving the DNS reply message, and obtaining the interval duration delay (d) (i.e., the first interval duration in the above).
6. When the DNS server under test is determined to be in an available state (i.e., S ═ 1), the detection device calculates a performance value Y ═ kD × S of the DNS server under test by using the interval duration D, where a value of k may be determined as needed, and is generally a positive number.
7. And the detection equipment compares the calculated performance value Y with a preset performance threshold value to obtain the performance grade of the DNS server to be detected. Thus, the server performance detection process of the embodiment of the invention is completed.
It should be noted that, after the detection device is triggered to start performance detection, as described in embodiment 1, only one domain name for detection is read from the preset database, and the domain name is used to perform performance detection on the DNS server to be detected; or, the performance detection may also be performed in a cyclic manner, that is, according to the scheme shown in embodiment 1, after the performance detection is completed by using one read domain name, another domain name may also be continuously read from the preset database, and the performance detection is continuously performed on the DNS server to be detected, which is performed in such a cyclic manner until the performance detection is performed by using each domain name in the database, or until the performance detection process is controlled to stop. Therefore, the performance detection results of at least two domain names can be averaged, and the average value is used as the performance detection result of the DNS server to be detected, so that the accuracy of the performance detection result of the embodiment of the invention is further improved.
In addition, in the embodiment of the present invention, after performing performance detection for one time by using a certain domain name, the domain name may be read from the read database again, and performance detection is performed for one time by using the domain name again. The reason is that factors affecting the performance of the server may change at any time, for example, the mapping relationship between the domain name www.huawei.com and the IP address is not cached initially by the DNS server to be tested, but in the process of performing the server performance detection for the first time by using the domain name www.huawei.com, the DNS server to be tested obtains the mapping relationship in a recursive query manner and caches the mapping relationship locally in the DNS server to be tested, so that the factors affecting the performance of the server change; or, the performance detection result of the tested DNS server may change due to a change in the loading condition of the tested DNS server, a change in the number of requests processed by the tested DNS server, a change in the network environment between the tested DNS server and the detection device, and the like, so that the same domain name may be used to perform multiple performance detections on the tested DNS server, and thus, the accuracy of the performance detection result in the embodiment of the present invention may be further improved. As an example, the last performance detection result corresponding to a certain domain name may be used as the performance detection result of the DNS server to be tested, or an average value of multiple performance detection results corresponding to the domain name may be used as the performance detection result of the DNS server to be tested, which is not specifically limited in the embodiment of the present invention.
Example 2
For the DNS server to be tested, a preset database configured by the detection device stores a plurality of domain names and level information corresponding to each domain name, which can be specifically shown in table 2 below:
numbering | Domain name | Level information |
1 | www.huawei.com | 1 |
2 | www.baidu.com | 2 |
3 | www.sina.com | 2 |
4 | www.cnki.net | 1 |
… | … | … |
In this embodiment, a corresponding level information is further set for the domain name in the database, and the performance level of the server to be tested is determined by combining the working state, the interval duration and the level information of the server to be tested. Referring to the timing diagram shown in fig. 4-2, the performance testing process of the present embodiment may include the following steps:
steps 1 to 5 are the same as steps 1 to 5 of example 1, and are not described herein again.
6. When the DNS server under test is determined to be in an available state (i.e., S is 1), the detection device calculates a performance value Y of the DNS server under test by using the interval duration D and the level information X, where k and m may be determined as needed and are generally positive numbers.
7. And the detection equipment compares the calculated performance value Y with a preset performance threshold value to obtain the performance grade of the DNS server to be detected. Thus, the server performance detection process of the embodiment of the invention is completed.
Specifically, the level information of the domain name may be set according to the frequency at which the network resource identified by the domain name is accessed, and as an example, the level information may be embodied as: common (corresponding to level 1), less common (corresponding to level 2), and not common (corresponding to level 3, not shown in table 2). Or, the level information corresponding to the domain name can be set according to the category to which the domain name belongs, that is, the levels of various service categories can be set according to the access habits of the user. If the user frequently visits the communication technology website, the service class can be set to level 1, so that when the server corresponding to a domain name can provide the communication technology service for the user, the level information of the domain name can be set to 1.
In addition, when Y ═ kD + mX ═ S is combined, it can be seen that the relationship between the level information and the performance level should be kept consistent with the relationship between the interval duration and the performance level, that is, if the interval duration and the performance level are in a direct proportional relationship, the level information and the performance level should also be in a direct proportional relationship. In this case, the lower the level information corresponding to the domain name (i.e., the higher the access frequency or the conformity to the access habit of the user), the smaller the interval duration between the detection packet and the response packet, the smaller the computed server performance value Y, and the lower the determined server performance level (i.e., the better the performance).
In addition, the process of setting the level information for the domain name may be executed by the detection device, or may be executed by another external device and then loaded to the detection device.
Note that, the values of the coefficients k and m in Y ═ kD + mX · S may be configured as needed. The following explains ways of configuring values of k and m by taking two specific scenarios as examples.
In a first scenario, values of k and m are configured to distinguish the influence of the interval duration and the level information on the calculation of the server performance value Y, that is, weights of the interval duration and the level information are set by configuring the values of k and m.
And in a second scenario, when the interval duration and the magnitude of the level information are inconsistent, the reasonability of the calculated server performance value Y is ensured by configuring the values of k and m. If the level information X corresponding to a domain name is 1 and the interval duration D is 30ms, the value of m may be configured as m is 10, and the value of k may be configured as k is 1, so that the calculated server performance value Y is 40, and the value of the performance value Y is more reasonable. It should be noted that, in this way, in order to ensure the accuracy and consistency of the calculated performance values in the detection process, the values of k and m should be kept unchanged, and the values of k and m are adjusted unless the interval duration and the magnitude of the level information change due to the change of the current network and other reasons.
It should be noted that, in order to further improve the accuracy of the performance detection result in the embodiment of the present invention, as described in embodiment 1, after completing performance detection once by using a read domain name, the embodiment may further continue to read another domain name from the preset database, and continue to perform performance detection on the DNS server to be detected, and the process is cycled until performing performance detection once by using each domain name in the database, or until being controlled to stop the performance detection process. Or after a certain domain name is used for performance detection once, the domain name can be read from the reading database again, and performance detection is performed once again by using the domain name. In this regard, the embodiments of the present invention are not particularly limited.
Example 3
On the basis of the above embodiment, the preset database configured by the detection device may further store the identity of a plurality of servers and the corresponding relationship between the identity of each server and the domain name. Of course, on the basis of table 2 shown in embodiment 2, the database may further store the level information corresponding to each domain name, which is specifically shown in table 3 below:
the performance detection process may include the steps of:
on the basis of the schemes shown in the above embodiments 1 and 2, after the detection device performs step 1 to read the domain name for detection (i.e. the above first information), the following steps may also be performed: and the detection equipment selects the identity of the server to be detected from the corresponding relation stored in the preset database according to the first information. In this way, the detection device can send the modified DNS request to the server under test with the selected id. It should be noted that, the step of selecting the id of the tested server may be performed before step 2, may also be performed after step 2, or may be performed simultaneously with step 2, which is not specifically limited in the embodiment of the present invention, as long as the tested server is selected before step 3 is performed.
That is to say, after the domain name used in the performance detection process is determined by the detection device, if the domain name for detection is www.baidu.com, the identity 1 of the detected server corresponding to the domain name can be searched from the preset database, so that the detection device can know who the current detected object is, and then send the detection message to the detected server with the identity 1. Or, the detecting device may also determine a plurality of domain names for detection, and if the domain names for detection are www.baidu.com and www.huawei.com, the detecting device may search for the identifier 1 of the detected server corresponding to the 2 domain names, and then send a detection packet to the detected server having the identifier 1 (in this case, the detecting device sends two detection packets to the detected server first, and the two detection packets carry different domain names, respectively).
It should be noted that the tested servers with different ids may correspond to the same domain name, that is, multiple servers may all perform domain name resolution on a certain domain name. As shown in the example in table 3 above, the detected servers with the identifiers 1 and 2 both correspond to the domain name www.huawei.com, and after the detection device determines the domain name www.huawei.com used in the performance detection process, the detection device may perform performance detection on the detected servers with the identifiers 1 and 2 respectively by using the domain name, or may also preset a detection rule, and when this occurs, the detection device only uses the domain name to perform performance detection on the detected server specified by the rule, which is not specifically limited in the embodiment of the present invention.
Similarly, in order to improve the accuracy of the performance detection result in the embodiment of the present invention, as described in embodiment 1, the embodiment may also use different domain names to perform multiple performance detections on the same tested server, or may also use the same domain name to perform multiple performance detections on the same tested server, which is not limited in the embodiment of the present invention.
Example 4
As described above, in the embodiments of the present invention, the same server under test may be subjected to multiple performance tests by using different domain names, so as to improve the accuracy of the performance test result in the embodiments of the present invention. The following explains the process of calculating the performance level of the tested server with id 1 using www.baidu.com and www.huawei.com, taking the example of table 3 as an example.
Referring to the timing diagrams shown in fig. 4-3, the performance testing process of the present embodiment may include the following steps:
1. com, and is triggered to read a domain name for detection from a preset database, such as www.baidu.com (i.e., the first information above).
2. The detection device searches a preset database, selects the server identity 1 corresponding to the domain name www.baidu.com, and determines the DNS server with the identity as the DNS server to be detected.
3. And the detection equipment changes the message encapsulation mode of the DNS request, and changes www.sina.com in the DNS request to www.baidu.com to form a new DNS request.
4. The detection device sends a modified DNS request (i.e., the first detection packet in the foregoing) to the DNS server to be detected, where the request carries domain name www.baidu.com and identification number TransactionID.
5. The DNS server under test receives the DNS request sent by the detection device, performs domain name resolution to obtain an IP address (i.e., the second information above) having a mapping relationship with www.baidu.com, adds the IP address and the identification code obtained from the DNS request to a DNS reply message (i.e., the first response message above), and sends the DNS reply message to the detection device.
6. The detection equipment receives a DNS response message sent by a DNS server to be detected, and determines the following two pieces of information:
(1) the working state status(s) of the DNS server to be tested can be obtained by comparing the identification codes, and is not described herein again. As an example, when the DNS server under test is in the unavailable state, S may be recorded as 0, and when the DNS server under test is in the available state, S may be recorded as 1.
(2) Recording the time for sending the first detection message and the time for receiving the first response message to obtain the interval duration delay (d) (i.e. the first interval duration).
7. And when the detection equipment determines that the DNS server to be detected is in an available state, calculating a performance value Y1 of the DNS server to be detected corresponding to the first interval duration by using Y ═ kD + mX ×.S.
8. The detection device continues to read other domain names corresponding to the DNS server under test from the preset database, for example, the read domain name is www.huawei.com (i.e. the third information in the embodiment of the present invention)
9. And the detection equipment changes the message encapsulation mode of the DNS request, and changes www.sina.com in the DNS request to www.huawei.com to form a new DNS request.
10. The detection device sends a modified DNS request (i.e., the second detection packet in the embodiment of the present invention) to the DNS server to be detected, where the request carries the domain name www.huawei.com and the identification code (which may be the same as or different from the identification code in the first detection packet, and this may not be specifically limited in the embodiment of the present invention).
11. The DNS server under test receives the DNS request sent by the detection device, performs domain name resolution to obtain an IP address (i.e., the fourth information in the foregoing) having a mapping relationship with www.huawei.com, adds the IP address and the identification code obtained from the DNS request to a DNS reply message (i.e., the second response message in the embodiment of the present invention), and sends the DNS reply message to the detection device.
12. The detection device receives a DNS reply message sent by the DNS server to be detected, records the time for sending the second detection message and the time for receiving the second response message, and obtains an interval duration delay (d) (i.e., the second interval duration in the embodiment of the present invention). It should be noted that, in order to simplify the processing, after the server is determined to be in the available state in the last detection process, the detection process may not perform the working state detection any more, and certainly, in order to ensure the accuracy of the detection result and prevent the working state of the server from changing in the two detection processes and affecting the detection result, the detection process may also perform the working state detection on the DNS server to be detected again by using the identification code, which is not specifically limited in the embodiment of the present invention.
13. And when the detection device determines that the DNS server to be detected is in an available state, calculating a performance value Y2 of the DNS server to be detected corresponding to the second interval duration by using Y ═ kD + mX ×.S.
14. And the detection equipment calculates the performance average value Y which is (Y1+ Y2)/2, and compares the performance average value Y with a preset performance threshold value to obtain the performance grade of the DNS server to be detected. Thus, the server performance detection process of the embodiment of the invention is completed.
In addition, as an example, after the first interval duration and the second interval duration are recorded, the interval duration mean is calculated by using the first interval duration and the second interval duration, then the performance value Y3 of the DNS server to be tested corresponding to the interval duration mean is calculated by using Y ═ kD + mX × S, and then the performance level of the DNS server to be tested is obtained by comparing Y3 with a preset performance threshold. Or after the performance grade of the DNS server to be tested is obtained by the first interval duration and the performance grade of the DNS server to be tested is obtained by the second interval duration, the two performance grades are averaged, and the obtained performance grade average value is used as the performance grade of the DNS server to be tested.
It should be noted that, as shown in this embodiment, after the performance value Y1 corresponding to the first interval duration is obtained through calculation (i.e., after step 7), the detection device may read other domain names from the preset database; or, after the packet encapsulation mode of the DNS request is changed to obtain a new DNS request (i.e., after any step of steps 3 to 7), other domain names corresponding to the DNS server to be tested may be read, which is not specifically limited in the embodiment of the present invention.
Example 5
As can be seen from the above description, the embodiment of the present invention further determines the performance level of the measured server by using the interval duration (or, by using the interval duration and the level information) only when the working state of the measured server is the available state; and when the working state of the tested server is the unavailable state, judging that the tested server has a fault, and temporarily failing to provide the access service. However, in the actual application process, the condition that the tested server is in an unavailable state may be caused by a server failure, or may be caused by abnormal conditions such as flash, jitter, and the like. In order to further improve the accuracy of performance detection in the embodiments of the present invention and eliminate performance detection result errors caused by abnormal conditions, the detection device may further perform the following steps based on the above embodiments: determining that the tested server is in an unavailable state based on the detection equipment, and returning to the step of executing the first detection message sent to the tested server by the detection equipment until a preset condition is met; the preset condition is a preset execution time or a preset execution time length.
On the basis of the scheme described in embodiment 1 above, if the detection device records that the operating state of the DNS server under test is an unavailable state (i.e., S is 0) in step 5, as an example, the detection device may directly determine that the DNS server under test has a fault, stop the performance detection process, and temporarily not allocate it to the client user for use any more; or, as another example, the detection device may further return to perform step 3, continue to send the modified DNS request to the DNS server to be tested, perform the working state detection on the DNS server to be tested again, and continue to perform the subsequent step of determining the performance level of the server if the detected DNS server is currently in the available state; if the detected DNS server is still in an unavailable state currently, judging whether the preset condition is met currently, if so, stopping the performance detection process, and temporarily not allocating the detected DNS server to the client user for use; and if not, continuing to return to the step 3 until the preset condition is met.
Corresponding to the method shown in fig. 3, an embodiment of the present invention further provides a server performance detection apparatus, which, referring to the schematic diagram shown in fig. 5, may include:
a sending unit 201, configured to send a first detection packet to a server under test, where the first detection packet carries first information;
a receiving unit 202, configured to receive a first response packet returned by the detected server corresponding to the first detection packet, where the first response packet carries second information, and a mapping relationship exists between the second information and the first information;
a state determining unit 203, configured to determine whether the server under test is in an available state;
an obtaining unit 204, configured to determine, based on the state determining unit, that the server under test is in an available state, and obtain a first interval duration between the first detection packet and the first response packet;
a level determining unit 205, configured to determine a performance level of the server under test according to the first interval duration acquired by the acquiring unit.
In summary, after determining that the detected server is in the available state, the detection apparatus in the embodiments of the present invention further determines the performance level of the detected server by combining the interval duration between the detection packet and the response packet, because the interval duration can reflect the response speed of the processing request of the detected server to a certain extent, the accuracy of the performance detection result of the server can be improved, so that the rationality of the load balancing device for performing load balancing based on the performance detection result of the embodiments of the present invention is improved, and it is further ensured that the allocated server can provide good quality access service for the client user.
Optionally, the detection apparatus may be configured with a preset database, where the preset database stores the first information, so that after the detection apparatus is triggered, the detection apparatus may read the first information from the preset database and actively use the first information to perform performance detection on the server under test, and correspondingly, the apparatus further includes: and the reading unit is used for reading the first information from the preset database before the sending unit sends the first detection message to the tested server, and generating the first detection message by using the first information.
The specific process can be described in the above example 1, and is not described herein again. In addition, after the detection device is triggered, only the first information can be read from the preset database, and the performance of the server to be detected is detected by using the first information; in addition, the detection device can also read other information from the preset database in a circulating reciprocating way, and perform multiple performance detections on the same server to be detected; alternatively, the same information may be used to perform multiple performance detections on the same server under test, which is not specifically limited in the embodiments of the present invention and will not be further described here.
Optionally, if the preset database further stores first level information of the first information, the level determining unit is specifically configured to determine the performance level of the server under test according to the first interval duration and the first level information; the first level information is set according to the frequency of the network resource being accessed identified by the first information or the category to which the first information belongs.
Therefore, the detection device can determine the performance level of the tested server by combining the working state, the interval duration and the level information of the tested server, and the specific process can be described in embodiment 2 above and is not described herein again.
Optionally, the preset database further stores a correspondence between the identity of the server under test and the first information, and before the detection device sends the first detection packet to the server under test, the apparatus further includes: and the selecting unit is used for selecting the identity of the tested server from the corresponding relation according to the first information before the sending unit sends the first detection message to the tested server.
Therefore, the detection device can actively perform performance detection on different servers, and the specific process can be described in embodiment 3 above, which is not described herein again.
Optionally, determining that the server under test is in an available state based on the state determination unit,
the sending unit is further configured to send a second detection packet to the tested server, where the second detection packet carries third information;
the receiving unit is further configured to receive a second response packet returned by the detected server corresponding to the second detection packet, where the second response packet carries fourth information, and a mapping relationship exists between the fourth information and the third information;
the obtaining unit is further configured to obtain a second interval duration between the second detection packet and the second response packet;
the level determining unit is specifically configured to determine the performance level of the server to be tested according to the second interval duration, and calculate a performance level average of the server to be tested by using the performance level determined according to the first interval duration and the performance level determined according to the second interval duration; or,
the level determining unit is specifically configured to calculate an interval duration average value by using the first interval duration and the second interval duration, and determine the performance level of the measured server according to the interval duration average value.
In this way, a plurality of pieces of information (which may be embodied as the first information and the third information, and certainly, as an example, more pieces of information may also be read for performance detection, which is not limited in the embodiments of the present invention) read from the preset database are used to perform performance detection on the same server under test for a plurality of times, so as to improve the accuracy of the performance detection result in the embodiments of the present invention, and the specific process may be described in embodiment 4 above, and is not described here again.
Optionally, the sending unit is further configured to determine, based on the state determining unit, that the server under test is in an unavailable state, and continue to send the first detection packet to the server under test until a preset condition is met; the preset condition is a preset execution time or a preset execution time length.
Therefore, performance detection result errors caused by abnormal conditions can be eliminated, and accuracy of the performance detection result of the embodiment of the invention is improved.
It should be noted that the server performance detection apparatus provided in this apparatus embodiment may be integrated in a load balancing device, and applied to the method embodiment shown in fig. 3 above to implement the function of the detection device therein. For other additional functions that can be implemented by the server performance detection apparatus and other interaction processes with the DNS server to be detected, please refer to the description of the detection device in the method embodiment, which is not described herein again.
In addition, when the detection device provided in the above embodiment performs server performance detection, only the division of the above functional modules is taken as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions.
The embodiment of the invention also provides a device for detecting the performance of the server. Referring to the schematic diagram shown in fig. 6, the server performance detecting apparatus may include: a processor 301, a memory 302, a network interface 303, a bus system 304.
The bus system 304 is used to couple the various hardware components of the detection device together.
The network interface 303 is configured to implement communication connection between the detection device and at least one other network element, and may use the internet, a wide area network, a local area network, a metropolitan area network, or the like.
The memory 302 is used to store program instructions and data.
The processor 301 is configured to read instructions and data stored in the memory 302, and perform the following operations:
triggering the network interface to send a first detection message to a tested server, wherein the first detection message carries first information;
receiving a first response message returned by the tested server corresponding to the first detection message through the network interface, wherein the first response message carries second information, and a mapping relation exists between the second information and the first information;
determining whether the server under test is available;
acquiring a first interval duration between the first detection message and the first response message based on the fact that the tested server is determined to be in the available state;
and determining the performance grade of the tested server according to the first interval duration.
The processor 301 may be an integrated circuit chip having signal processing capability. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The instructions may be implemented and controlled by a processor to perform the methods disclosed by the embodiments of the invention. The processor may also be a general purpose processor, a Digital Signal Processor (DSP), an application specific integrated circuit (application specific integrated circuit), an off-the-shelf programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
The general purpose processor may be a microprocessor or the processor may be any conventional processor, decoder, etc. The steps of a method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art.
The bus system 304 may include a power bus, a control bus, and a status signal bus, in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 304 in fig. 6.
Optionally, the detection device is configured with a preset database, where the preset database stores the first information, and before the triggering of the network interface to send the first detection packet to the server under test, the processor is further configured to perform the following operations:
and reading the first information from the preset database, and generating the first detection message by using the first information.
Optionally, if the preset database further stores first level information of the first information, the processor determines the performance level of the server under test by performing the following operations:
determining the performance level of the tested server according to the first interval duration and the first level information; the first level information is set according to the frequency of the network resource being accessed identified by the first information or the category to which the first information belongs.
Optionally, the preset database further stores a correspondence between the identity of the server under test and the first information, and before the network interface is triggered to send the first detection packet to the server under test, the processor is further configured to perform the following operations:
and selecting the identity of the server to be tested from the corresponding relation according to the first information.
Optionally, based on determining that the server under test is in an available state, the processor is further configured to:
triggering the network interface to send a second detection message to the tested server, wherein the second detection message carries third information;
receiving a second response message returned by the tested server corresponding to the second detection message through the network interface, wherein the second response message carries fourth information, and a mapping relation exists between the fourth information and the third information;
acquiring a second interval duration between the second detection message and the second response message;
the processor determines a performance level of the server under test by:
determining the performance grade of the tested server according to the second interval duration, and calculating the average value of the performance grade of the tested server by using the performance grade determined according to the first interval duration and the performance grade determined according to the second interval duration; or,
and calculating an interval time average value by using the first interval time and the second interval time, and determining the performance grade of the tested server according to the interval time average value.
Optionally, the processor is further configured to:
based on the fact that the tested server is determined to be in an unavailable state, the step of triggering the network interface to send a first detection message to the tested server is returned to be executed until a preset condition is met; the preset condition is a preset execution time or a preset execution time length.
It should be noted that the server under test in the embodiment of the present invention may be a DNS server, a call center server, a content distribution server, or the like, and may locally cache a mapping relationship between the first information and the second information. If the server to be tested is a DNS server, the first detection message is a DNS request message, the first response message is a DNS response message, the first information is a first domain name, and the second information is an IP address. If the server to be tested is a call center server, the first detection message is a call request, the first information is an account number of the called user, the first response message is a call response, the second information is a client IP address corresponding to the called user, and the mapping relation is the mapping relation between the account number and the IP address. If the server to be detected is a content distribution server, the first detection message is a content access request, the first information is content information which is requested to be accessed, the first response message is a content access response, the second information is an IP address of the cache server, and the mapping relation is the mapping relation between the content information and the IP address of the cache server.
In summary, after determining that the detected server is in the available state, the detection device in the embodiment of the present invention further determines the performance level of the detected server by combining the interval duration between the detection packet and the response packet, because the interval duration can reflect the response speed of the processing request of the detected server to a certain extent, the accuracy of the performance detection result of the server can be improved, so that the rationality of the load balancing device for performing load balancing based on the performance detection result of the embodiment of the present invention is improved, and the allocated server can be ensured to provide good quality access service for the client user. In addition, the same tested server can be subjected to multiple performance detections by using different domain names, or the same tested server can be subjected to multiple performance detections by using the same domain name, so that the accuracy of the server performance detection result in the embodiment of the invention is further improved.
It should be noted that the server performance detection device provided in this embodiment may be integrated in a load balancing device, and applied to the method embodiment shown in fig. 3 above to implement the function of the detection device therein. For other additional functions that can be implemented by the server performance detection apparatus and other interaction processes with the DNS server to be detected, please refer to the description of the detection device in the method embodiment, which is not described herein again.
As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the above embodiment methods can be implemented by software plus a general hardware platform. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the method according to the embodiments or some parts of the embodiments.
It should be noted that, in the present specification, all the embodiments are described in a progressive manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus and system embodiments, since they are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described embodiments of the apparatus and system are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only an alternative embodiment of the present invention and is not intended to limit the scope of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principle of the present invention, and such improvements and modifications should be considered as the protection scope of the present invention.
Claims (12)
1. A method for detecting performance of a server, the method comprising:
the method comprises the steps that a detection device sends a first detection message to a detected server, wherein the first detection message carries first information;
the detection equipment receives a first response message returned by the detected server corresponding to the first detection message, wherein the first response message carries second information, and the second information and the first information have a mapping relation;
the detection equipment determines whether the server under test is in an available state;
determining that the server under test is in an available state based on the detection device, wherein the detection device acquires a first interval duration between the first detection message and the first response message;
and the detection equipment determines the performance level of the tested server according to the first interval duration.
2. The method according to claim 1, wherein the detection device is configured with a preset database, and the preset database stores the first information, and before the detection device sends the first detection packet to the server under test, the method further comprises:
and the detection equipment reads the first information from the preset database and generates the first detection message by using the first information.
3. The method of claim 2, wherein the preset database further stores first level information of the first information, and the determining, by the detection device, the performance level of the server under test according to the first interval duration includes:
and the detection equipment determines the performance level of the tested server according to the first interval duration and the first level information.
4. The method of claim 3, wherein the first level information is set according to a frequency with which the network resource identified by the first information is accessed or a category to which the first information belongs.
5. The method of claim 3 or 4, wherein based on the detection device determining that the server under test is available, the method further comprises:
the detection equipment sends a second detection message to the tested server, wherein the second detection message carries third information;
the detection equipment receives a second response message returned by the detected server corresponding to the second detection message, wherein the second response message carries fourth information, and a mapping relation exists between the fourth information and the third information;
the detection equipment acquires a second interval duration between the second detection message and the second response message;
the method for determining the performance level of the tested server by the detection equipment according to the first interval duration comprises the following steps:
the detection equipment determines the performance grade of the tested server according to the second interval duration, and calculates the average value of the performance grade of the tested server by using the performance grade determined according to the first interval duration and the performance grade determined according to the second interval duration; or,
the detection equipment calculates the interval duration mean value by utilizing the first interval duration and the second interval duration, and determines the performance grade of the tested server according to the interval duration mean value.
6. The method according to any one of claims 1 to 5, further comprising:
determining that the tested server is in an unavailable state based on the detection equipment, and returning to the step of executing the first detection message sent to the tested server by the detection equipment until a preset condition is met; the preset condition is a preset execution time or a preset execution time length.
7. The method according to any one of claims 1 to 6, wherein the server under test is a DNS server, the first detection packet is a DNS request packet, the first response packet is a DNS reply packet, the first information is a first domain name, and the second information is an IP address.
8. An apparatus for server performance detection, the apparatus comprising:
the device comprises a sending unit, a receiving unit and a sending unit, wherein the sending unit is used for sending a first detection message to a tested server, and the first detection message carries first information;
a receiving unit, configured to receive a first response packet returned by the server under test corresponding to the first detection packet, where the first response packet carries second information, and a mapping relationship exists between the second information and the first information;
a state determining unit, configured to determine whether the server under test is in an available state;
an obtaining unit, configured to obtain a first interval duration between the first detection packet and the first response packet based on the determination that the server under test is in an available state by the state determining unit;
and the grade determining unit is used for determining the performance grade of the tested server according to the first interval duration acquired by the acquiring unit.
9. The apparatus of claim 8, wherein the server under test is determined to be in an available state based on the state determination unit,
the sending unit is further configured to send a second detection packet to the tested server, where the second detection packet carries third information;
the receiving unit is further configured to receive a second response packet returned by the detected server corresponding to the second detection packet, where the second response packet carries fourth information, and a mapping relationship exists between the fourth information and the third information;
the obtaining unit is further configured to obtain a second interval duration between the second detection packet and the second response packet;
the level determining unit is specifically configured to determine the performance level of the server to be tested according to the second interval duration, and calculate a performance level average of the server to be tested by using the performance level determined according to the first interval duration and the performance level determined according to the second interval duration; or,
the level determining unit is specifically configured to calculate an interval duration average value by using the first interval duration and the second interval duration, and determine the performance level of the measured server according to the interval duration average value.
10. The apparatus according to claim 8 or 9,
the sending unit is further configured to determine that the tested server is in an unavailable state based on the state determining unit, and continue to send the first detection packet to the tested server until a preset condition is met; the preset condition is a preset execution time or a preset execution time length.
11. A server performance detection device, the device comprising: a processor, memory, and a network interface;
the memory for storing program instructions and data;
the processor is used for reading the instructions and data stored in the memory and executing the following operations:
triggering the network interface to send a first detection message to a tested server, wherein the first detection message carries first information;
receiving a first response message returned by the tested server corresponding to the first detection message through the network interface, wherein the first response message carries second information, and a mapping relation exists between the second information and the first information;
determining whether the server under test is available;
acquiring a first interval duration between the first detection message and the first response message based on the fact that the tested server is determined to be in the available state;
and determining the performance grade of the tested server according to the first interval duration.
12. The device of claim 11, wherein based on determining that the server under test is in an available state, the processor is further configured to:
triggering the network interface to send a second detection message to the tested server, wherein the second detection message carries third information;
receiving a second response message returned by the tested server corresponding to the second detection message through the network interface, wherein the second response message carries fourth information, and a mapping relation exists between the fourth information and the third information;
acquiring a second interval duration between the second detection message and the second response message;
the determining the performance level of the server to be tested according to the first interval duration includes:
determining the performance grade of the tested server according to the second interval duration, and calculating the average value of the performance grade of the tested server by using the performance grade determined according to the first interval duration and the performance grade determined according to the second interval duration; or,
and calculating an interval time average value by using the first interval time and the second interval time, and determining the performance grade of the tested server according to the interval time average value.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410353696.6A CN105337786B (en) | 2014-07-23 | 2014-07-23 | A kind of server performance detection method, device and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410353696.6A CN105337786B (en) | 2014-07-23 | 2014-07-23 | A kind of server performance detection method, device and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105337786A true CN105337786A (en) | 2016-02-17 |
CN105337786B CN105337786B (en) | 2019-07-19 |
Family
ID=55288098
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410353696.6A Active CN105337786B (en) | 2014-07-23 | 2014-07-23 | A kind of server performance detection method, device and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105337786B (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106341401A (en) * | 2016-08-31 | 2017-01-18 | 新疆信息产业有限责任公司 | Communication terminal detection service system and method |
CN107071820A (en) * | 2017-04-19 | 2017-08-18 | 努比亚技术有限公司 | A kind of method of mobile terminal and switch contents Distributor |
CN107241240A (en) * | 2017-06-30 | 2017-10-10 | 广州君海网络科技有限公司 | Game server state monitoring method, apparatus and system |
CN109660425A (en) * | 2018-12-13 | 2019-04-19 | 网宿科技股份有限公司 | A kind of monitoring method determines method, monitoring device and storage medium |
CN110248138A (en) * | 2018-03-08 | 2019-09-17 | 华为技术有限公司 | The method and apparatus for carrying out audio/video conference |
CN110519789A (en) * | 2019-08-02 | 2019-11-29 | 京信通信系统(中国)有限公司 | Method for testing performance, device, computer equipment and storage medium |
CN110519121A (en) * | 2019-08-09 | 2019-11-29 | 网宿科技股份有限公司 | A kind of method and device of subregion task detection |
CN110691139A (en) * | 2019-10-11 | 2020-01-14 | 北京字节跳动网络技术有限公司 | Data transmission method, device, equipment and storage medium |
CN111049948A (en) * | 2019-12-30 | 2020-04-21 | 杭州迪普科技股份有限公司 | Domain name detection method and device |
CN111343237A (en) * | 2020-02-07 | 2020-06-26 | 广州亚美信息科技有限公司 | Server cluster communication method, communication device and computer storage medium |
CN112104498A (en) * | 2016-11-17 | 2020-12-18 | 贵州白山云科技股份有限公司 | DNS service quality evaluation method, device, medium and equipment |
CN114629823A (en) * | 2022-05-16 | 2022-06-14 | 鹏城实验室 | Server testing and monitoring method and device, terminal equipment and storage medium |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1514588A (en) * | 2002-12-17 | 2004-07-21 | �Ҵ���˾ | Method and system for detecting operation risk of anode |
CN1937534A (en) * | 2006-09-20 | 2007-03-28 | 杭州华为三康技术有限公司 | Load balance realizing method and load balance device |
CN101090345A (en) * | 2007-07-20 | 2007-12-19 | 哈尔滨工程大学 | Performance test method for network storage system |
CN102668455A (en) * | 2009-09-24 | 2012-09-12 | 3Rd布兰德私人有限公司(公司注册号200719143G) | Network monitoring and analysis tool |
CN103138995A (en) * | 2011-11-24 | 2013-06-05 | 中兴通讯股份有限公司 | Method and device for server performance test |
CN103560928A (en) * | 2013-10-22 | 2014-02-05 | 东软集团股份有限公司 | Method and system for testing forwarding performance of network equipment |
CN103778050A (en) * | 2013-12-30 | 2014-05-07 | 国网山东省电力公司 | Database server high-availability performance detecting system |
CN103888306A (en) * | 2012-12-19 | 2014-06-25 | 阿里巴巴集团控股有限公司 | Message forwarding system performance test method and performance test device |
-
2014
- 2014-07-23 CN CN201410353696.6A patent/CN105337786B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1514588A (en) * | 2002-12-17 | 2004-07-21 | �Ҵ���˾ | Method and system for detecting operation risk of anode |
CN1937534A (en) * | 2006-09-20 | 2007-03-28 | 杭州华为三康技术有限公司 | Load balance realizing method and load balance device |
CN101090345A (en) * | 2007-07-20 | 2007-12-19 | 哈尔滨工程大学 | Performance test method for network storage system |
CN102668455A (en) * | 2009-09-24 | 2012-09-12 | 3Rd布兰德私人有限公司(公司注册号200719143G) | Network monitoring and analysis tool |
CN103138995A (en) * | 2011-11-24 | 2013-06-05 | 中兴通讯股份有限公司 | Method and device for server performance test |
CN103888306A (en) * | 2012-12-19 | 2014-06-25 | 阿里巴巴集团控股有限公司 | Message forwarding system performance test method and performance test device |
CN103560928A (en) * | 2013-10-22 | 2014-02-05 | 东软集团股份有限公司 | Method and system for testing forwarding performance of network equipment |
CN103778050A (en) * | 2013-12-30 | 2014-05-07 | 国网山东省电力公司 | Database server high-availability performance detecting system |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106341401A (en) * | 2016-08-31 | 2017-01-18 | 新疆信息产业有限责任公司 | Communication terminal detection service system and method |
CN112104498A (en) * | 2016-11-17 | 2020-12-18 | 贵州白山云科技股份有限公司 | DNS service quality evaluation method, device, medium and equipment |
CN112104498B (en) * | 2016-11-17 | 2023-04-07 | 贵州白山云科技股份有限公司 | DNS service quality evaluation method, device, medium and equipment |
CN107071820A (en) * | 2017-04-19 | 2017-08-18 | 努比亚技术有限公司 | A kind of method of mobile terminal and switch contents Distributor |
CN107241240A (en) * | 2017-06-30 | 2017-10-10 | 广州君海网络科技有限公司 | Game server state monitoring method, apparatus and system |
CN110248138A (en) * | 2018-03-08 | 2019-09-17 | 华为技术有限公司 | The method and apparatus for carrying out audio/video conference |
CN110248138B (en) * | 2018-03-08 | 2021-06-29 | 华为技术有限公司 | Method and device for audio and video conference |
CN109660425A (en) * | 2018-12-13 | 2019-04-19 | 网宿科技股份有限公司 | A kind of monitoring method determines method, monitoring device and storage medium |
CN110519789A (en) * | 2019-08-02 | 2019-11-29 | 京信通信系统(中国)有限公司 | Method for testing performance, device, computer equipment and storage medium |
CN110519789B (en) * | 2019-08-02 | 2023-11-28 | 京信网络系统股份有限公司 | Performance detection method, device, computer equipment and storage medium |
CN110519121B (en) * | 2019-08-09 | 2021-08-27 | 网宿科技股份有限公司 | Method and device for detecting regional tasks |
CN110519121A (en) * | 2019-08-09 | 2019-11-29 | 网宿科技股份有限公司 | A kind of method and device of subregion task detection |
CN110691139B (en) * | 2019-10-11 | 2022-07-15 | 北京字节跳动网络技术有限公司 | Data transmission method, device, equipment and storage medium |
CN110691139A (en) * | 2019-10-11 | 2020-01-14 | 北京字节跳动网络技术有限公司 | Data transmission method, device, equipment and storage medium |
CN111049948A (en) * | 2019-12-30 | 2020-04-21 | 杭州迪普科技股份有限公司 | Domain name detection method and device |
CN111049948B (en) * | 2019-12-30 | 2022-07-29 | 杭州迪普科技股份有限公司 | Domain name detection method and device |
CN111343237A (en) * | 2020-02-07 | 2020-06-26 | 广州亚美信息科技有限公司 | Server cluster communication method, communication device and computer storage medium |
CN114629823A (en) * | 2022-05-16 | 2022-06-14 | 鹏城实验室 | Server testing and monitoring method and device, terminal equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN105337786B (en) | 2019-07-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105337786B (en) | A kind of server performance detection method, device and equipment | |
CN104092650B (en) | A kind of method and apparatus for distributing service request | |
CN107426302B (en) | Access scheduling method, device, system, terminal, server and storage medium | |
CN107395683B (en) | Method for selecting return path and server | |
CN106656800B (en) | Path selection method and system, network acceleration node and network acceleration system | |
US11240156B2 (en) | Techniques for steering network traffic to regions of a cloud computing system | |
US10313362B2 (en) | Systems and methods for real-time configurable load determination | |
EP3668063A1 (en) | Domain name resolution method, server and system | |
CN106302565B (en) | Scheduling method and system of service server | |
CN112153160A (en) | Access request processing method and device and electronic equipment | |
US20100088405A1 (en) | Determining Network Delay and CDN Deployment | |
CN108173937A (en) | Access control method and device | |
CN108737470B (en) | Access request source returning method and device | |
CN108933829A (en) | A kind of load-balancing method and device | |
CN101501669A (en) | Domain name resolution resource allocation | |
CN108124020B (en) | Domain name resolution method, system and equipment | |
CN113472852A (en) | CDN node back-source method, device and equipment | |
CN109921925B (en) | Dial testing method and device | |
CN109657434B (en) | Application access method and device | |
WO2017166524A1 (en) | Domain name parsing method and apparatus | |
CN107819825A (en) | A kind of service scheduling method, device and electronic equipment | |
US10333966B2 (en) | Quarantining an internet protocol address | |
CN111562884B (en) | Data storage method and device and electronic equipment | |
CN106657399B (en) | Background server selection method and device based on middleware | |
CN109032787B (en) | Task allocation method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |