CN109815067B - Pressure testing method, pressure testing device, computer equipment and computer readable storage medium - Google Patents

Pressure testing method, pressure testing device, computer equipment and computer readable storage medium Download PDF

Info

Publication number
CN109815067B
CN109815067B CN201811527301.4A CN201811527301A CN109815067B CN 109815067 B CN109815067 B CN 109815067B CN 201811527301 A CN201811527301 A CN 201811527301A CN 109815067 B CN109815067 B CN 109815067B
Authority
CN
China
Prior art keywords
test
server
tested
time
threshold value
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.)
Active
Application number
CN201811527301.4A
Other languages
Chinese (zh)
Other versions
CN109815067A (en
Inventor
余宁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Yuean Network Technology Co ltd
Shenzhen Lian Intellectual Property Service Center
Original Assignee
Guangzhou Yuean Network Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangzhou Yuean Network Technology Co ltd filed Critical Guangzhou Yuean Network Technology Co ltd
Priority to CN201811527301.4A priority Critical patent/CN109815067B/en
Publication of CN109815067A publication Critical patent/CN109815067A/en
Application granted granted Critical
Publication of CN109815067B publication Critical patent/CN109815067B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The embodiment of the invention discloses a pressure testing method, a pressure testing device, computer equipment and a computer readable storage medium. The method is applied to the technical field of performance test, and comprises the following steps: sending test instructions to a preset number of test terminals; receiving test data returned by a server to be tested, and judging whether the load of the server to be tested at the test time is equal to a preset safety load threshold value according to the test data; if not, determining the characteristic quantity of the test terminal in the next test according to the test data returned by the server to be tested; taking the characteristic quantity as a new preset quantity, and continuously sending a test request to a test terminal with the preset quantity; if yes, the test result is output, so that on one hand, the time error of manual operation is avoided, and the accuracy of the pressure test result is improved. On the other hand, the number threshold value of the terminals to be tested, which can be simultaneously served by the server to be tested, can be determined, and the compression resistance of the server to be tested is more intuitively reflected.

Description

Pressure testing method, pressure testing device, computer equipment and computer readable storage medium
Technical Field
The present invention relates to the field of testing technologies, and in particular, to a pressure testing method, a pressure testing device, a computer device, and a computer readable storage medium.
Background
In order to evaluate the performance of a server, stress testing of the server is often required. The pressure test refers to the step of simultaneously sending test requests to the server through a plurality of terminals and testing the compression resistance of the server.
In the prior art, on one hand, the test request is sent to the server simultaneously by manually operating the terminals, and due to time deviation of operation among people, the time of sending the test request by each terminal is inconsistent, so that the test result of the pressure test is inaccurate. On the other hand, the test result in the prior art is simply to indicate whether the server passes the pressure test, and the compressive capacity of the server cannot be intuitively reflected.
Disclosure of Invention
The embodiment of the invention provides a pressure testing method, a pressure testing device, computer equipment and a computer readable storage medium, which aim to solve the problems that the testing result of the pressure testing in the prior art is inaccurate and the compression resistance of a server cannot be intuitively embodied.
In a first aspect, an embodiment of the present invention provides a pressure testing method, including:
Transmitting test instructions to a preset number of test terminals, wherein the test instructions comprise test time, and the test instructions are used for indicating the test terminals to transmit test requests to a server to be tested when the time reaches the test time;
receiving test data returned by a server to be tested, and judging whether the load of the server to be tested at the test time is equal to a preset safety load threshold value according to the test data;
if the load of the server to be tested is not the preset safe load threshold value, determining the characteristic quantity of the test terminal in the next test according to the test data returned by the server to be tested;
taking the characteristic quantity as a new preset quantity, and continuously sending a test request to a test terminal with the preset quantity;
and if the load of the server to be tested is a preset safe load threshold, outputting a test result.
In a second aspect, an embodiment of the present invention further provides a pressure testing apparatus, including:
the first sending unit is used for sending test instructions to a preset number of test terminals, the test instructions comprise test time, and the test instructions are used for indicating the test terminals to send test requests to the server to be tested when the time reaches the test time;
The first judging unit is used for receiving the test data returned by the server to be tested and judging whether the load of the server to be tested at the test time is equal to a preset safety load threshold value or not according to the test data;
the first determining unit is used for determining the characteristic quantity of the test terminal in the next test according to the test data returned by the server to be tested if the load of the server to be tested is not a preset safety load threshold value;
the second sending unit is used for taking the characteristic quantity as a new preset quantity and continuously sending a test request to the test terminals with the preset quantity;
and the output unit is used for outputting a test result if the load of the server to be tested is a preset safety load threshold value.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the method when executing the computer program.
In a fourth aspect, embodiments of the present invention also provide a computer readable storage medium storing a computer program which, when executed by a processor, implements the above method.
The embodiment of the invention provides a pressure testing method, a pressure testing device, computer equipment and a storage medium. Wherein the method comprises the following steps: transmitting test instructions to a preset number of test terminals, wherein the test instructions comprise test time, and the test instructions are used for indicating the test terminals to transmit test requests to a server to be tested when the time reaches the test time; receiving test data returned by a server to be tested, and judging whether the load of the server to be tested at the test time is equal to a preset safety load threshold value according to the test data; if the load of the server to be tested is not the preset safe load threshold value, determining the characteristic quantity of the test terminal in the next test according to the test data returned by the server to be tested; taking the characteristic quantity as a new preset quantity, and continuously sending a test request to a test terminal with the preset quantity; and if the load of the server to be tested is a preset safe load threshold, outputting a test result. By applying the technical scheme of the embodiment of the invention, on one hand, all the test terminals receiving the test instruction can be ensured to simultaneously send the test request to the server to be tested when the current time reaches the test time, so that the time error of manual operation is avoided, and the accuracy of the pressure test result is improved. On the other hand, the number threshold value of the terminals to be tested, which can be simultaneously serviced by the server to be tested under the condition of ensuring normal service can be provided, can be determined, so that the compression resistance condition of the server to be tested is more intuitively embodied.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of an application scenario of a pressure testing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a pressure testing method according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of a pressure testing method according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart of a pressure testing method according to an embodiment of the present invention;
FIG. 5 is a schematic flow chart of a pressure testing method according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a pressure testing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic block diagram of a first judging unit of the pressure testing device according to an embodiment of the present invention;
FIG. 8 is a schematic block diagram of a first judging unit of a pressure testing apparatus according to another embodiment of the present invention;
Fig. 9 is a schematic block diagram of a first determining unit of a pressure testing device according to an embodiment of the present invention;
FIG. 10 is a schematic block diagram of a first determining unit of a pressure testing apparatus according to another embodiment of the present invention; and
fig. 11 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be understood that the terms "comprises" and "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Referring to fig. 1 and fig. 2, fig. 1 is a schematic diagram of an application scenario of a pressure testing method according to an embodiment of the present invention. Fig. 2 is a schematic flow chart of a pressure testing method according to an embodiment of the present invention. The pressure testing method provided by the embodiment of the invention is applied to the testing server 2. The test server 2 sends test instructions to a preset number of test terminals 1, wherein the test instructions are used for indicating the test terminals 1 to send test requests to the server 3 to be tested when the time reaches the test time. The test server 2 receives test data returned by the server 3 to be tested and judges whether the load of the server 3 to be tested at the test time is equal to a preset safety load threshold according to the test data. If the load of the server to be tested 3 is not the preset safe load threshold, the test server 2 determines the characteristic quantity of the test terminal 1 in the next test according to the test data returned by the server to be tested 3; the test server 2 takes the characteristic quantity as a new preset quantity and continues to send test requests to the test terminals 1 with the preset quantity; if the load of the server to be tested 3 is a preset safe load threshold, the test server 2 outputs a test result.
Fig. 2 is a schematic flow chart of a pressure testing method according to an embodiment of the present invention. As shown, the method includes the following steps S1-S5.
S1, sending test instructions to a preset number of test terminals, wherein the test instructions comprise test time, and the test instructions are used for indicating the test terminals to send test requests to the server to be tested when the time reaches the test time.
In specific implementation, a test instruction is sent to a preset number of test terminals. The test instruction includes a test time. The test time is the time when the test terminal sends a test request to the server.
It should be noted that the preset number of initial values (the value at the time of the first test) may be set by those skilled in the art according to experience, for example, in one embodiment, the preset number of initial values is set to 100. And then, the preset quantity can be adjusted according to the test data returned by the server to be tested, and the specific adjustment method is shown in the following step S3.
Correspondingly, after receiving the test instruction, the test terminal analyzes and acquires the test time contained in the test instruction, and judges whether the current time reaches the test time or not in real time. And when the current time reaches the test time, the test terminal sends a test request to the server to be tested. Test requests refer to requests for testing purposes, in one embodiment the test requests are specifically HTTP requests, or in other embodiments the test requests may be other types of requests, as the invention is not specifically limited in this regard.
Through the step S1, all the test terminals receiving the test instruction can be ensured to simultaneously send the test request to the server to be tested when the current time reaches the test time, so that the time error of manual operation is avoided, and the accuracy of the test result is improved.
S2, receiving test data returned by the server to be tested, and judging whether the load of the server to be tested at the test time is equal to a preset safety load threshold according to the test data.
In specific implementation, the server to be tested collects test data obtained by itself at the test time and sends the test data to the test server. The test data reflects the load condition of the server to be tested at the test time. The test data comprise the resource utilization rate, response time and other data of the server to be tested.
The safe load threshold value refers to the maximum load value of the server to be tested in ensuring that the server can normally provide business services for the test terminal. The safe load threshold may be set empirically by those skilled in the art.
In one embodiment, as shown in FIG. 3, the step S2 may include steps S21-S23.
S21, if the test data comprise the resource utilization rate of the server to be tested at the test time, judging whether the resource utilization rate of the server to be tested at the test time is equal to a preset safety resource utilization rate threshold value.
In this embodiment, the test data includes a resource usage rate of the server to be tested at the test time, and the load condition of the server to be tested is represented by the server to be tested at the test time. In specific implementation, whether the resource utilization rate of the server to be tested at the test time is equal to a preset safe resource utilization rate threshold value is judged.
The safe resource utilization rate threshold value refers to the maximum resource utilization rate of the server to be tested in ensuring that the server can normally provide business services for the test terminal. The secure resource usage threshold may be set empirically by one skilled in the art, for example, in one embodiment, the secure resource usage threshold is set to 85%.
S22, if the resource utilization rate of the server at the test time is equal to a preset safety resource utilization rate threshold value, judging that the load of the server to be tested at the test time is equal to a preset safety load threshold value.
In the implementation, if the judging result is that the resource utilization rate of the server at the test time is equal to the preset safety resource utilization rate threshold value, the load of the server to be tested at the test time is judged to be equal to the preset safety load threshold value.
S23, if the resource utilization rate of the server at the test time is not equal to the preset safety resource utilization rate threshold, judging that the load of the server to be tested at the test time is not equal to the preset safety load threshold.
In specific implementation, if the judging result is that the resource utilization rate of the server at the test time is not equal to the preset safety resource utilization rate threshold value, judging that the load of the server to be tested at the test time is not equal to the preset safety load threshold value.
In one embodiment, as shown in FIG. 4, the step S2 may include steps S201-S203.
S201, if the test data comprises the average response time of the server to be tested in the test time, judging whether the average response time of the server to be tested in the test time is equal to a preset safety response time threshold value.
In this embodiment, the test data includes an average response time of the server to be tested at the test time, and the load condition of the server to be tested is represented by the average response time of the server to be tested at the test time.
In specific implementation, whether the average response time of the judgment server in the test time is equal to a preset safety response time threshold value is judged. The average response time is an average value of response time of the server to be tested to the test requests sent by the test terminals. The average response time can be obtained by statistics of the server to be tested. The safety response time threshold value refers to the maximum response time of the server to be tested in ensuring that the server can normally provide business services for the test terminal.
The safety response time threshold may be set by a person skilled in the art according to the actual situation of the server to be tested, for example, in one embodiment, the safety response time threshold is set to 0.5s.
S202, if the average response time of the server at the test time is equal to a preset safety response time threshold, determining that the load of the server to be tested at the test time is equal to the preset safety load threshold.
In specific implementation, if the average response time of the server at the test time is equal to the preset safety response time threshold value as a result of the judgment, the load of the server to be tested at the test time is equal to the preset safety load threshold value.
And S203, if the average response time of the server at the test time is not equal to the preset safety response time threshold, judging that the load of the server to be tested at the test time is not equal to the preset safety load threshold.
In specific implementation, if the average response time of the server at the test time is not equal to the preset safety response time threshold, the load of the server to be tested at the test time is not equal to the preset safety load threshold.
And S3, if the load of the server to be tested is not the preset safety load threshold, determining the characteristic quantity of the test terminal in the next test according to the test data returned by the server to be tested.
An object of the embodiment of the present invention is to determine a threshold value of the number of terminals to be tested that can be simultaneously served by a server to be tested under the condition of ensuring that normal service can be provided. Therefore, if the judgment result is that the load of the server to be tested is not the preset safe load threshold, the number of the test terminals used for the current pressure test is not equal to the number threshold. Therefore, the feature quantity of the test terminal at the next pressure test needs to be determined according to the test data returned by the server to be tested. The feature quantity is the quantity of test terminals which simultaneously send test requests to the server to be tested when the pressure test is carried out next time.
In an embodiment, the test data includes a resource usage rate of the server to be tested at the test time, and in this embodiment, the resource usage rate of the server to be tested is obtained through experimental test and is approximately in a proportional relationship with the number of terminals to be tested. As shown in fig. 5, the step S3 may include steps S31 to S33.
S31, judging whether the resource utilization rate of the server to be tested at the test time is smaller than a preset safe resource utilization rate threshold value.
In specific implementation, whether the resource utilization rate of the server to be tested is smaller than a preset safe resource utilization rate threshold value is judged.
The safe resource utilization rate threshold value refers to the maximum resource utilization rate of the server to be tested in ensuring that the server can normally provide business services for the test terminal. The secure resource usage threshold may be set empirically by one skilled in the art, for example, in one embodiment, the secure resource usage threshold is set to 85%.
S32, if the resource utilization rate of the server to be tested at the test time is smaller than the preset safe resource utilization rate threshold value, according to the following formulaThe number of features N is determined.
In specific implementation, if the resource utilization rate of the server to be tested at the test time is smaller than the preset safe resource utilization rate threshold value, the following formula is adoptedThe number of features N is determined.
In the above formula, N1 is the number of test terminals that send test requests to the test server at the same time in the current test, Q1 is a resource usage threshold of the server to be tested at the test time, and Q0 is a preset security resource usage threshold.
S33, if the resource utilization rate of the server to be tested at the test time is greater than a preset safe resource utilization rate threshold value, according to the following formulaThe number of features N is determined.
In specific implementation, if the resource utilization rate of the server to be tested at the test time is greater than the preset safe resource utilization rate threshold value, the following formula is adopted The number of features N is determined.
In the above formula, N1 is the number of test terminals that send test requests to the test server at the same time in the current test, Q1 is a resource usage threshold of the server to be tested at the test time, and Q0 is a preset safe resource usage threshold.
In an embodiment, the test data includes an average response time of the server to be tested at the test time, and in this embodiment, the average response time of the server to be tested obtained through experimental test approximately has an exponential relationship with the number of terminals to be tested. The step S3 may include: by the formulaThe number of features N is determined.
In the above formula, N1 is the number of test terminals that send test requests to the test server at the same time in the current test, t1 is the average response time of the server to be tested at the test time, and t0 is the preset safety response time.
And S4, taking the characteristic quantity as a new preset quantity, and continuously sending a test request to the test terminals with the preset quantity.
In specific implementation, the feature quantity obtained in the step S3 is taken as a new preset quantity, and a test instruction is continuously sent to the test terminals with the preset quantity so as to perform the next pressure test on the server to be tested, and the cycle is performed until the number of the terminals to be tested is determined when the load of the server to be tested is a preset safety load threshold value.
The method can determine the quantity threshold value of the terminals to be tested, which can be simultaneously serviced by the server to be tested under the condition of ensuring normal business service, so that the compression resistance condition of the server to be tested can be more intuitively reflected. Meanwhile, the quantity threshold can also be used as an important reference when the servers are deployed, and the quantity of the servers needing to be deployed can be determined according to the quantity threshold and the required target traffic.
S5, if the load of the server to be tested is a preset safe load threshold, outputting a test result.
In specific implementation, if the judgment result is that the load of the server to be tested is a preset safety load threshold, outputting a test result.
When the load of the server to be tested is a preset safety load threshold, the number of terminals to be tested, namely the threshold of the number of terminals to be tested which can be simultaneously serviced by the server to be tested under the condition of ensuring normal service can be provided.
By applying the technical scheme of the embodiment of the invention, on one hand, all the test terminals receiving the test instruction can be ensured to simultaneously send the test request to the server to be tested when the current time reaches the test time, so that the time error of manual operation is avoided, and the accuracy of the pressure test result is improved. On the other hand, the number threshold value of the terminals to be tested, which can be simultaneously serviced by the server to be tested under the condition of ensuring normal service can be provided, can be determined, so that the compression resistance condition of the server to be tested is more intuitively embodied.
Fig. 6 is a schematic block diagram of a pressure testing apparatus 60 according to an embodiment of the present invention. As shown in fig. 6, the present invention also provides a pressure testing device 60 corresponding to the above pressure testing method. The stress testing device 60 comprises means for performing the stress testing method described above, which device may be configured in a server. Specifically, referring to fig. 6, the pressure testing apparatus 60 includes a first transmitting unit 61, a first judging unit 62, a first determining unit 63, a second transmitting unit 64, and an output unit 65.
The first sending unit 61 is configured to send a test instruction to a preset number of test terminals, where the test instruction includes a test time, and the test instruction is configured to instruct the test terminal to send a test request to the server to be tested when the time reaches the test time;
the first judging unit 62 is configured to receive test data returned by the server to be tested, and judge whether the load of the server to be tested at the test time is equal to a preset safety load threshold according to the test data;
a first determining unit 63, configured to determine, according to test data returned by the server to be tested, a feature number of the test terminal at the next test, if the load of the server to be tested is not a preset safety load threshold;
A second transmitting unit 64, configured to take the feature quantity as a new preset quantity, and continue to transmit a test request to a preset quantity of test terminals;
and the output unit 65 is configured to output a test result if the load of the server to be tested is a preset safe load threshold.
In one embodiment, as shown in fig. 7, the first determining unit 62 includes a second determining unit 621, a first determining unit 622, and a second determining unit 623.
A second judging unit 621, configured to judge whether the resource usage rate of the server to be tested at the test time is equal to a preset safe resource usage rate threshold value if the test data includes the resource usage rate of the server to be tested at the test time;
a first determining unit 622, configured to determine that the load of the server to be tested at the test time is equal to a preset safe load threshold if the resource usage of the server at the test time is equal to a preset safe resource usage threshold;
a second determining unit 623, configured to determine that the load of the server to be tested at the test time is not equal to the preset safe load threshold if the resource usage of the server at the test time is not equal to the preset safe resource usage threshold.
In one embodiment, as shown in fig. 8, the first determining unit 62 includes a third determining unit 624, a third determining unit 625, and a fourth determining unit 626.
A third determining unit 624, configured to determine whether the average response time of the server to be tested at the test time is equal to a preset safety response time threshold if the test data includes the average response time of the server to be tested at the test time;
a third determining unit 625, configured to determine that the load of the server to be tested at the test time is equal to a preset safety load threshold if the average response time of the server at the test time is equal to the preset safety response time threshold;
a fourth determining unit 626, configured to determine that the load of the server to be tested at the test time is not equal to the preset safety load threshold if the average response time of the server at the test time is not equal to the preset safety response time threshold.
In an embodiment, as shown in fig. 9, the first determining unit 63 includes a fourth judging unit 631, a second determining unit 632, and a third determining unit 633.
A fourth judging unit 631 for judging whether the resource usage rate of the server to be tested at the test time is less than a preset safe resource usage rate threshold;
A second determining unit 632, configured to, if the resource usage of the server under test at the test time is less than the preset safe resource usage threshold, determine according to the following formulaDetermining a feature quantity N;
a third determining unit 633, configured to, if the resource usage rate of the server under test at the test time is greater than a preset safe resource usage rate threshold, determine that the resource usage rate of the server under test is greater than the preset safe resource usage rate threshold according to the following formulaDetermining a feature quantity N;
wherein N1 is the number of test terminals which simultaneously send test requests to the test server in the current test, Q1 is a resource utilization threshold of the server to be tested at the test time, and Q0 is a preset safe resource utilization threshold.
In an embodiment, as shown in fig. 10, the first determining unit 63 includes a fourth determining unit 634.
A fourth determining unit for passing through the formulaDetermining a feature quantity N;
wherein N1 is the number of test terminals simultaneously sending test requests to the test server in the current test, t1 is the average response time of the server to be tested in the test time, and t0 is the preset safety response time.
It should be noted that, as will be clearly understood by those skilled in the art, the specific implementation process of the pressure testing device 6060 and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, the description is omitted here.
The pressure testing device 60 described above may be implemented in the form of a computer program that is executable on a computer apparatus as shown in fig. 11.
Referring to fig. 11, fig. 11 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a server. The server may be an independent server or a server cluster formed by a plurality of servers.
With reference to FIG. 11, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a stress test method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The internal memory 504 provides an environment for the execution of a computer program 5032 in the non-volatile storage medium 503, which computer program 5032, when executed by the processor 502, causes the processor 502 to perform a stress test method.
The network interface 505 is used for network communication with other devices. It will be appreciated by those skilled in the art that the structure shown in FIG. 11 is merely a block diagram of some of the structures associated with the present inventive arrangements and does not constitute a limitation of the computer device 500 to which the present inventive arrangements may be applied, and that a particular computer device 500 may include more or fewer components than shown, or may combine some of the components, or have a different arrangement of components.
Wherein the processor 502 is configured to execute a computer program 5032 stored in a memory to implement the steps of:
transmitting test instructions to a preset number of test terminals, wherein the test instructions comprise test time, and the test instructions are used for indicating the test terminals to transmit test requests to a server to be tested when the time reaches the test time;
receiving test data returned by a server to be tested, and judging whether the load of the server to be tested at the test time is equal to a preset safety load threshold value according to the test data;
if the load of the server to be tested is not the preset safe load threshold value, determining the characteristic quantity of the test terminal in the next test according to the test data returned by the server to be tested;
Taking the characteristic quantity as a new preset quantity, and continuously sending a test request to a test terminal with the preset quantity;
and if the load of the server to be tested is a preset safe load threshold, outputting a test result.
In an embodiment, when the step of determining, according to the test data, whether the load of the server to be tested at the test time is equal to the preset safe load threshold is implemented by the processor 502, the following steps are specifically implemented:
if the test data comprise the resource utilization rate of the server to be tested in the test time, judging whether the resource utilization rate of the server to be tested in the test time is equal to a preset safety resource utilization rate threshold value;
if the resource utilization rate of the server at the test time is equal to a preset safety resource utilization rate threshold value, judging that the load of the server to be tested at the test time is equal to a preset safety load threshold value;
if the resource utilization rate of the server at the test time is not equal to the preset safety resource utilization rate threshold value, judging that the load of the server to be tested at the test time is not equal to the preset safety load threshold value.
In an embodiment, when the step of determining, according to the test data, whether the load of the server to be tested at the test time is equal to the preset safe load threshold is implemented by the processor 502, the following steps are specifically implemented:
If the test data comprise the average response time of the server to be tested in the test time, judging whether the average response time of the server to be tested in the test time is equal to a preset safety response time threshold value or not;
if the average response time of the server in the test time is equal to a preset safety response time threshold, judging that the load of the server to be tested in the test time is equal to a preset safety load threshold;
if the average response time of the server in the test time is not equal to the preset safety response time threshold, judging that the load of the server to be tested in the test time is not equal to the preset safety load threshold.
In an embodiment, when the step of determining the feature quantity of the test terminal in the next test according to the test data returned by the server to be tested is implemented by the processor 502, the following steps are specifically implemented:
judging whether the resource utilization rate of the server to be tested at the test time is smaller than a preset safe resource utilization rate threshold value;
if the resource utilization rate of the server to be tested at the test time is smaller than the preset safe resource utilization rate threshold value, the method is based on the following formulaDetermining a feature quantity N;
if the resource utilization rate of the server to be tested at the test time is greater than the preset safe resource utilization rate threshold value, the method is based on the following formula Determining a feature quantity N;
wherein N1 is the number of test terminals which simultaneously send test requests to the test server in the current test, Q1 is a resource utilization threshold of the server to be tested at the test time, and Q0 is a preset safe resource utilization threshold.
In an embodiment, when the step of determining the feature quantity of the test terminal in the next test according to the test data returned by the server to be tested is implemented by the processor 502, the following steps are specifically implemented:
by the formulaDetermining a feature quantity N;
wherein N1 is the number of test terminals simultaneously sending test requests to the test server in the current test, t1 is the average response time of the server to be tested in the test time, and t0 is the preset safety response time.
It should be appreciated that in embodiments of the present application, the processor 502 may be a Central processing unit (Central ProcessingUnit, CPU), and the processor 502 may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf Programmable gate arrays (FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Those skilled in the art will appreciate that all or part of the flow in a method embodying the above described embodiments may be accomplished by computer programs instructing the relevant hardware. The computer program may be stored in a storage medium that is a computer readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer readable storage medium. The storage medium stores a computer program. The computer program, when executed by a processor, causes the processor to perform the steps of:
transmitting test instructions to a preset number of test terminals, wherein the test instructions comprise test time, and the test instructions are used for indicating the test terminals to transmit test requests to a server to be tested when the time reaches the test time;
receiving test data returned by a server to be tested, and judging whether the load of the server to be tested at the test time is equal to a preset safety load threshold value according to the test data;
if the load of the server to be tested is not the preset safe load threshold value, determining the characteristic quantity of the test terminal in the next test according to the test data returned by the server to be tested;
Taking the characteristic quantity as a new preset quantity, and continuously sending a test request to a test terminal with the preset quantity;
and if the load of the server to be tested is a preset safe load threshold, outputting a test result.
In an embodiment, when the processor executes the computer program to implement the step of determining, according to the test data, whether the load of the server to be tested at the test time is equal to a preset safe load threshold, the specific implementation steps include:
if the test data comprise the resource utilization rate of the server to be tested in the test time, judging whether the resource utilization rate of the server to be tested in the test time is equal to a preset safety resource utilization rate threshold value;
if the resource utilization rate of the server at the test time is equal to a preset safety resource utilization rate threshold value, judging that the load of the server to be tested at the test time is equal to a preset safety load threshold value;
if the resource utilization rate of the server at the test time is not equal to the preset safety resource utilization rate threshold value, judging that the load of the server to be tested at the test time is not equal to the preset safety load threshold value.
In an embodiment, when the processor executes the computer program to implement the step of determining, according to the test data, whether the load of the server to be tested at the test time is equal to a preset safe load threshold, the specific implementation steps include:
If the test data comprise the average response time of the server to be tested in the test time, judging whether the average response time of the server to be tested in the test time is equal to a preset safety response time threshold value or not;
if the average response time of the server in the test time is equal to a preset safety response time threshold, judging that the load of the server to be tested in the test time is equal to a preset safety load threshold;
if the average response time of the server in the test time is not equal to the preset safety response time threshold, judging that the load of the server to be tested in the test time is not equal to the preset safety load threshold.
In an embodiment, when the processor executes the computer program to implement the step of determining the feature quantity of the test terminal at the next test according to the test data returned by the server to be tested, the specific implementation steps include:
judging whether the resource utilization rate of the server to be tested at the test time is smaller than a preset safe resource utilization rate threshold value;
if the resource utilization rate of the server to be tested at the test time is smaller than the preset safe resource utilization rate threshold value, the method is based on the following formula Determining a feature quantity N;
if the resource utilization rate of the server to be tested at the test time is greater than the preset safe resource utilization rate threshold value, the method is based on the following formulaDetermining a feature quantity N; />
Wherein N1 is the number of test terminals which simultaneously send test requests to the test server in the current test, Q1 is a resource utilization threshold of the server to be tested at the test time, and Q0 is a preset safe resource utilization threshold.
In an embodiment, when the processor executes the computer program to implement the step of determining the feature quantity of the test terminal at the next test according to the test data returned by the server to be tested, the specific implementation steps include:
by the formulaDetermining a feature quantity N;
wherein N1 is the number of test terminals simultaneously sending test requests to the test server in the current test, t1 is the average response time of the server to be tested in the test time, and t0 is the preset safety response time.
The storage medium may be a U-disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, or other various computer-readable storage media that can store program codes.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied in electronic hardware, in computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of function in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the several embodiments provided by the present invention, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not performed.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be combined, divided and deleted according to actual needs. In addition, each functional unit in the embodiments of the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The integrated unit may be stored in a storage medium if implemented in the form of a software functional unit and sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention is essentially or a part contributing to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a terminal, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention.
In the foregoing embodiments, the descriptions of the embodiments are focused on, and for those portions of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present invention without departing from the spirit or scope of the invention. Thus, it is intended that the present invention also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.
While the invention has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the invention. Therefore, the protection scope of the invention is subject to the protection scope of the claims.

Claims (9)

1. A method of pressure testing, comprising:
sending test instructions to a preset number of test terminals, wherein the test instructions comprise test time, and the test instructions are used for indicating the test terminals to send test requests to a server to be tested when the time reaches the test time;
Receiving test data returned by a server to be tested, and judging whether the load of the server to be tested at the test time is equal to a preset safety load threshold value according to the test data;
if the load of the server to be tested is not the preset safe load threshold value, determining the characteristic quantity of the test terminal in the next test according to the test data returned by the server to be tested;
taking the characteristic quantity as a new preset quantity, and continuously sending a test request to a test terminal with the preset quantity;
if the load of the server to be tested is a preset safe load threshold, outputting a test result;
the determining the feature quantity of the test terminal in the next test according to the test data returned by the server to be tested comprises the following steps:
judging whether the resource utilization rate of the server to be tested at the test time is smaller than a preset safe resource utilization rate threshold value;
if the resource utilization rate of the server to be tested at the test time is smaller than the preset safe resource utilization rate threshold value, the method is based on the following formulaDetermining a feature quantity N;
if the resource utilization rate of the server to be tested at the test time is greater than the preset safe resource utilization rate threshold value, the method is based on the following formulaDetermining a feature quantity N;
Wherein N1 is the number of test terminals which simultaneously send test requests to the test server in the current test, Q1 is a resource utilization threshold of the server to be tested at the test time, and Q0 is a preset safe resource utilization threshold.
2. The pressure testing method according to claim 1, wherein the determining, according to the test data, whether the load of the server under test at the test time is equal to a preset safety load threshold value includes:
if the test data comprise the resource utilization rate of the server to be tested in the test time, judging whether the resource utilization rate of the server to be tested in the test time is equal to a preset safety resource utilization rate threshold value;
if the resource utilization rate of the server at the test time is equal to a preset safety resource utilization rate threshold value, judging that the load of the server to be tested at the test time is equal to a preset safety load threshold value;
if the resource utilization rate of the server at the test time is not equal to the preset safety resource utilization rate threshold value, judging that the load of the server to be tested at the test time is not equal to the preset safety load threshold value.
3. The pressure testing method according to claim 1, wherein the determining, according to the test data, whether the load of the server under test at the test time is equal to a preset safety load threshold value includes:
If the test data comprise the average response time of the server to be tested in the test time, judging whether the average response time of the server to be tested in the test time is equal to a preset safety response time threshold value or not;
if the average response time of the server in the test time is equal to a preset safety response time threshold, judging that the load of the server to be tested in the test time is equal to a preset safety load threshold;
if the average response time of the server in the test time is not equal to the preset safety response time threshold, judging that the load of the server to be tested in the test time is not equal to the preset safety load threshold.
4. The pressure testing method according to claim 1, wherein the determining the feature quantity of the test terminal at the next test according to the test data returned from the server to be tested comprises
By the formulaDetermining a feature quantity N;
wherein N1 is the number of test terminals simultaneously sending test requests to the test server in the current test, t1 is the average response time of the server to be tested in the test time, and t0 is the preset safety response time.
5. A pressure testing device, comprising:
The first sending unit is used for sending test instructions to a preset number of test terminals, the test instructions comprise test time, and the test instructions are used for indicating the test terminals to send test requests to the server to be tested when the time reaches the test time;
the first judging unit is used for receiving the test data returned by the server to be tested and judging whether the load of the server to be tested at the test time is equal to a preset safety load threshold value or not according to the test data;
the first determining unit is used for determining the characteristic quantity of the test terminal in the next test according to the test data returned by the server to be tested if the load of the server to be tested is not a preset safety load threshold value;
the second sending unit is used for taking the characteristic quantity as a new preset quantity and continuously sending a test request to the test terminals with the preset quantity;
the output unit is used for outputting a test result if the load of the server to be tested is a preset safety load threshold value;
the determining the feature quantity of the test terminal in the next test according to the test data returned by the server to be tested comprises the following steps:
judging whether the resource utilization rate of the server to be tested at the test time is smaller than a preset safe resource utilization rate threshold value;
If the resource utilization rate of the server to be tested at the test time is smaller than the preset safe resource utilization rate threshold value, the method is based on the following formulaDetermining a feature quantity N;
if the resource utilization rate of the server to be tested at the test time is greater than the preset safe resource utilization rate threshold value, the method is based on the following formulaDetermining a feature quantity N;
wherein N1 is the number of test terminals which simultaneously send test requests to the test server in the current test, Q1 is a resource utilization threshold of the server to be tested at the test time, and Q0 is a preset safe resource utilization threshold.
6. The pressure testing device according to claim 5, wherein the first judging unit includes:
the second judging unit is used for judging whether the resource utilization rate of the server to be tested in the test time is equal to a preset safe resource utilization rate threshold value if the test data comprise the resource utilization rate of the server to be tested in the test time;
the first judging unit is used for judging that the load of the server to be tested at the test time is equal to a preset safety load threshold value if the resource utilization rate of the server at the test time is equal to the preset safety resource utilization rate threshold value;
And the second judging unit is used for judging that the load of the server to be tested in the test time is not equal to the preset safety load threshold value if the resource utilization rate of the server in the test time is not equal to the preset safety resource utilization rate threshold value.
7. The pressure testing device according to claim 5, wherein the first judging unit includes:
the third judging unit is used for judging whether the average response time of the server to be tested in the test time is equal to a preset safety response time threshold value if the test data comprise the average response time of the server to be tested in the test time;
the third judging unit is used for judging that the load of the server to be tested at the test time is equal to a preset safety load threshold value if the average response time of the server at the test time is equal to the preset safety response time threshold value;
and the fourth judging unit is used for judging that the load of the server to be tested at the test time is not equal to the preset safety load threshold value if the average response time of the server at the test time is not equal to the preset safety response time threshold value.
8. A computer device, characterized in that it comprises a memory on which a computer program is stored and a processor which, when executing the computer program, implements the method according to any of claims 1-4.
9. A computer readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method according to any of claims 1-4.
CN201811527301.4A 2018-12-13 2018-12-13 Pressure testing method, pressure testing device, computer equipment and computer readable storage medium Active CN109815067B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811527301.4A CN109815067B (en) 2018-12-13 2018-12-13 Pressure testing method, pressure testing device, computer equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811527301.4A CN109815067B (en) 2018-12-13 2018-12-13 Pressure testing method, pressure testing device, computer equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109815067A CN109815067A (en) 2019-05-28
CN109815067B true CN109815067B (en) 2023-11-03

Family

ID=66602898

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811527301.4A Active CN109815067B (en) 2018-12-13 2018-12-13 Pressure testing method, pressure testing device, computer equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109815067B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111414300A (en) * 2020-03-27 2020-07-14 北京字节跳动网络技术有限公司 Method and device for pressure test of server
CN112926868B (en) * 2021-03-11 2024-04-09 郑州畅威物联网科技有限公司 Voltage regulating equipment load state evaluation method, equipment and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810048A (en) * 2014-03-11 2014-05-21 国家电网公司 Automatic adjusting method and device for thread number aiming to realizing optimization of resource utilization
CN106649057A (en) * 2015-10-28 2017-05-10 北京国双科技有限公司 Method and device for testing server pressure

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7340680B2 (en) * 2004-06-14 2008-03-04 Sap Aktiengesellschaft SAP archivlink load test for content server

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810048A (en) * 2014-03-11 2014-05-21 国家电网公司 Automatic adjusting method and device for thread number aiming to realizing optimization of resource utilization
CN106649057A (en) * 2015-10-28 2017-05-10 北京国双科技有限公司 Method and device for testing server pressure

Also Published As

Publication number Publication date
CN109815067A (en) 2019-05-28

Similar Documents

Publication Publication Date Title
CN109815332B (en) Loss function optimization method, loss function optimization device, computer equipment and storage medium
CN107222426B (en) Flow control method, device and system
CN109474463B (en) IoT edge equipment trust evaluation method, device and system and proxy server
CN109167812B (en) Method for evaluating service quality and determining adjustment strategy, server and storage medium
CN110247856B (en) Server resource release method and device
CN109815019B (en) Task scheduling method and device, electronic equipment and readable storage medium
CN109815067B (en) Pressure testing method, pressure testing device, computer equipment and computer readable storage medium
CN112015557A (en) Resource adjusting method and device and server
JP2017510169A5 (en)
EP3499818A1 (en) Method and device for load processing
CN110096305B (en) Gray scale distribution method, device, equipment and storage medium
CN111078387A (en) Interrupt aggregation device and method thereof
CN109842518B (en) Content distribution network disaster tolerance method and device, computer equipment and storage medium
CN111538572A (en) Task processing method, device, scheduling server and medium
CN117041981A (en) Wireless sensor network anomaly detection method based on trust value evaluation
CN112732560A (en) Method and device for detecting file descriptor leakage risk
CN109858632B (en) Method and device for determining threshold
CN108804152B (en) Method and device for adjusting configuration parameters
CN108418730B (en) Network flow testing method, device, equipment and computer readable storage medium
CN111159009A (en) Pressure testing method and device for log service system
CN112596985B (en) IT asset detection method, device, equipment and medium
WO2022033579A1 (en) Federated learning method, device and system
JP5937955B2 (en) Packet transfer delay measuring apparatus, method and program
CN108833214B (en) Industrial control network detection method, device and system
CN112350880B (en) Overload detection method, system, computer readable storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20231008

Address after: Room 801, 802, and 803, 8th floor, Building 1, No. 233 Kezhu Road, Huangpu District, Guangzhou City, Guangdong Province, 510000 (office only)

Applicant after: Guangzhou Yuean Network Technology Co.,Ltd.

Address before: 518000 Room 202, block B, aerospace micromotor building, No.7, Langshan No.2 Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen LIAN intellectual property service center

Effective date of registration: 20231008

Address after: 518000 Room 202, block B, aerospace micromotor building, No.7, Langshan No.2 Road, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen LIAN intellectual property service center

Address before: 518000 Room 201, building A, No. 1, Qian Wan Road, Qianhai Shenzhen Hong Kong cooperation zone, Shenzhen, Guangdong (Shenzhen Qianhai business secretary Co., Ltd.)

Applicant before: PING AN PUHUI ENTERPRISE MANAGEMENT Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant