[go: up one dir, main page]

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

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

Info

Publication number
CN111625469B
CN111625469B CN202010529116.XA CN202010529116A CN111625469B CN 111625469 B CN111625469 B CN 111625469B CN 202010529116 A CN202010529116 A CN 202010529116A CN 111625469 B CN111625469 B CN 111625469B
Authority
CN
China
Prior art keywords
pressure test
random number
time
service
pressure
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
CN202010529116.XA
Other languages
Chinese (zh)
Other versions
CN111625469A (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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202010529116.XA priority Critical patent/CN111625469B/en
Publication of CN111625469A publication Critical patent/CN111625469A/en
Application granted granted Critical
Publication of CN111625469B publication Critical patent/CN111625469B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention relates to the field of financial science and technology, and discloses a pressure testing method, which comprises the following steps: when a pressure test instruction is received, acquiring pressure test parameters associated with the pressure test instruction; generating a probability random number sequence according to the service request quantity in the pressure test parameter; generating a time random number sequence according to the probability random number sequence and the time period and the index distribution mean value in the pressure test parameter; and sending a service request to a tested server for pressure test according to the time random number sequence to obtain a pressure test result. The invention also discloses a pressure testing device, equipment and a computer readable storage medium. According to queuing theory in operation research, the invention performs pressure test on the service request queue which is sent to obey poisson distribution, so that the pressure test is closer to reality, and the accuracy of the pressure test result is improved.

Description

Pressure testing method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the technical field of financial science and technology (Fintech), and in particular, to a pressure testing method, apparatus, device, and computer readable storage medium.
Background
In recent years, internet financial technology (Fintech) has been rapidly developed, and more technologies (big data, distributed, blockchain Blockchain, artificial intelligence, etc.) are applied in the financial field.
The data volume and the traffic volume of the financial business are exponentially increased, and in this case, higher requirements are put on concurrency and response speed of a server for processing the financial business; in order to improve response efficiency of financial service requests and reduce pressure of a server in the financial field at present, pressure test is usually required to be carried out on the server for processing financial services, a fixed test service request quantity is preset when the server is subjected to pressure test, thousands of service requests or even more are generated almost at the same time, the pressure test result obtained by the method for carrying out pressure test through simple violence is far from the actual situation, the pressure test effect cannot be achieved, and meanwhile, negative interference is very easy to be generated on deployment strategies of subsequent services, so that resource waste is caused.
Disclosure of Invention
The invention mainly aims to provide a pressure testing method, a pressure testing device, pressure testing equipment and a computer readable storage medium, and aims to solve the technical problems that the current pressure testing result is far from the actual situation, the pressure testing effect cannot be achieved, and the subsequent service deployment strategy is easy to be negatively interfered, so that the resource waste is caused.
In order to achieve the above object, the present invention provides a pressure testing method, comprising the steps of:
When a pressure test instruction is received, acquiring pressure test parameters associated with the pressure test instruction;
generating a probability random number sequence according to the service request quantity in the pressure test parameter;
Generating a time random number sequence according to the probability random number sequence and the time period and the index distribution mean value in the pressure test parameter;
and sending a service request to a tested server for pressure test according to the time random number sequence to obtain a pressure test result.
Optionally, the step of generating a probabilistic random number sequence according to the number of service requests in the stress test parameter includes:
inputting the number of service requests in the stress test parameters into a preset random number generator with uniform distribution to obtain probability random numbers with the same number as the number of the service requests;
And arranging the probability random numbers according to the generation sequence to form a probability random number sequence.
Optionally, the step of generating the time random number sequence according to the time period and the exponential distribution mean value in the probability random number sequence and the pressure test parameter includes:
Circulating and inputting the probability random numbers in the probability random number sequence, the time period and the index distribution mean value in the pressure test parameter into a preset negative index distribution inverse function to generate time interval random numbers with the same number as the service request number;
And arranging the time interval random numbers according to the generation sequence to form a time random number sequence.
Optionally, the negative exponential distribution inverse function is ti= -LN (1-Xi)/Lamda, where Ti is expressed as a time interval random number, xi is expressed as a probability random number, lamda is expressed as an exponential distribution mean value, where the exponential distribution mean value refers to the number of service requests that occur in average in a unit time, and the exponential distribution mean value may be obtained by dividing the number of service requests by the time period, or the exponential distribution mean value may also be obtained according to actual statistics.
Optionally, the step of sending a service request to the tested server to perform a pressure test according to the time random number sequence to obtain a pressure test result includes:
calling a sleep function to send a service request to a load gateway when a time point corresponding to a time interval random number in the time random number sequence, wherein the service request at the load gateway is arranged to form a service request queue obeying poisson distribution;
and sending the service request in the service request queue to a tested server connected with the load gateway for pressure test, and obtaining a pressure test result.
Optionally, after the step of sending a service request to the tested server to perform the pressure test according to the time random number sequence and obtaining the pressure test result, the method includes:
acquiring service processing rate and service response time consumption in the pressure test result, comparing the service processing rate with a preset processing rate, and comparing the service response time consumption with the preset response time consumption;
if the service processing rate is matched with the preset processing rate and the service response time is matched with the preset response time, judging that the pressure test is passed;
And if the service processing rate is not matched with the preset processing rate or the service response time is not matched with the preset response time, judging that the pressure test is not passed.
Optionally, after the step of sending a service request to the tested server to perform the pressure test according to the time random number sequence and obtaining the pressure test result, the method includes:
When the pressure test result is that the pressure test fails, acquiring service processing rate and service response time in the pressure test result;
calculating the relative speed value of the service processing speed and the preset processing speed, and calculating the relative time consumption value of the service response time consumption and the preset response time consumption;
And outputting a server deployment adjustment strategy according to the rate relative value and the time-consuming relative value.
In addition, in order to achieve the above object, the present invention also provides a pressure testing apparatus including:
The instruction receiving module is used for acquiring pressure test parameters associated with the pressure test instruction when the pressure test instruction is received;
The probability generation module is used for generating a probability random number sequence according to the service request quantity in the pressure test parameters;
the time generation module is used for generating a time random number sequence according to the probability random number sequence and the time period and the index distribution mean value in the pressure test parameter;
And the service request sending module is used for sending a service request to the tested server for pressure test according to the time random number sequence to obtain a pressure test result.
In addition, in order to achieve the above object, the present invention also provides a pressure test apparatus including: the system comprises a memory, a processor and a computer program stored on the memory and corresponding to the pressure test which can be run on the processor, wherein the computer program corresponding to the pressure test realizes the steps of the pressure test method when being executed by the processor.
In addition, to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a computer program corresponding to a stress test, which when executed by a processor, implements the steps of the stress test method as described above.
The invention provides a pressure test method, a device, equipment and a computer readable storage medium, wherein in the embodiment of the invention, when a pressure test instruction is received, pressure test parameters associated with the pressure test instruction are obtained; generating a probability random number sequence according to the service request quantity in the pressure test parameter; generating a time random number sequence according to the probability random number sequence and the time period and the index distribution mean value in the pressure test parameter; according to the time random number sequence, sending a service request to a tested server for pressure test to obtain a pressure test result, so that the queuing of the service request received in the server accords with poisson distribution (poisson distribution refers to the discrete probability distribution commonly found in statistics and probability science, namely, the frequency of sending the service request accords with the probability of occurrence of random events). According to the embodiment of the invention, the service request queue which is transmitted and obeys poisson distribution is subjected to pressure test according to the queuing theory in the operation study, so that the pressure test is more realistic, and the accuracy of the pressure test result is improved; meanwhile, the accurate pressure test result ensures that the deployment strategy of the subsequent service is more reasonable, and avoids the waste of hardware resources caused by excessive server deployment.
Drawings
FIG. 1 is a schematic diagram of a device architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flow chart of a first embodiment of the pressure testing method of the present invention;
FIG. 3 is a schematic diagram of functional modules of an embodiment of a pressure testing apparatus according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic device structure of a hardware running environment according to an embodiment of the present invention.
In the embodiment of the invention, the pressure test equipment can be a PC or a server, and a Java virtual machine is operated on the pressure test equipment. As shown in fig. 1, the pressure test apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the device structure shown in fig. 1 is not limiting of the device and may include more or fewer components than shown, or may combine certain components, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a computer program corresponding to the stress test may be included in the memory 1005 as one type of computer storage medium.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server, and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be used to call a computer program corresponding to the pressure test stored in the memory 1005 and perform operations in the pressure test method described below.
In the prior art pressure test method, the correctness of the response of the tested server is verified by simply simulating the service request generated by the pressure test equipment, which is far from the actual situation, and the current pressure test situation almost generates thousands, tens of thousands or even more service requests at the same time, so that the mode is simple and violent, the obtained pressure test result is also actually seriously different, and the negative interference to the deployment strategy of the subsequent service is extremely easy to occur, thereby causing the waste of resources, for example, thousands of service requests are sent to the tested server at the same time during the current pressure test, and the service response standard is required to be met, but the service request is not sent as simply as violently as the test situation, so that the pressure test meaning is not great, and the server deployed according to the pressure test result can cause the waste of the hardware resources of the server.
In addition, when part of test tools send requests to a server, only a specified number of service requests are simply and randomly generated, which is different from the actual service request generation situation, so that the actual service request sending scene cannot be really simulated, and the actual pressure test purpose cannot be achieved.
According to the Monte Carlo simulation, the pressure test equipment is a calculation method based on a probability and statistical theory method, and the generation of a distributed simulation random variable is known; from operational research, mathematicians have demonstrated that queuing in real society follows a poisson distribution and that the time intervals of queuing follow a negative exponential distribution. The invention utilizes queuing time intervals to simulate queuing of service requests according to negative exponential distribution, and comprises the following specific steps:
based on the hardware structure, the embodiment of the pressure testing method is provided.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of a pressure testing method according to the present invention, where the pressure testing method includes:
and step S10, when a pressure test instruction is received, acquiring pressure test parameters associated with the pressure test instruction.
The pressure test method in this embodiment is applied to pressure test equipment in financial institutions (banking institutions, insurance institutions, securities institutions, etc.) in the financial industry, the pressure test equipment refers to a hardware platform carrying a corresponding computer program for pressure test, the pressure test equipment is used for performing pressure test on a tested server, a JVM (Java Virtual Machine ) is operated on the tested server, the process requires that the tested server has a relatively strong compression-resistant effect so as to meet the requirements of concurrency and access speed of financial services, the number of the tested servers in this embodiment is not particularly limited, and the tested server can include one or more.
The pressure test equipment is in communication connection with the tested server and the simulation client, the pressure test equipment is a main control node, the simulation client (also called pressure source equipment or pressurizing equipment) is controlled to simulate the real client to send an operation request to the tested server so as to pressurize on the tested server to perform pressure test on the tested server, and it can be understood that the function of the simulation client can be integrated into the pressure test equipment.
In this embodiment, the pressure test device receives a pressure test instruction, where a triggering manner of the pressure test instruction is not specifically limited, that is, the pressure test instruction may be actively triggered by a user, for example, the user clicks a "pressure test" button on the pressure test device to trigger the pressure test instruction; or the pressure test instruction can also be automatically triggered by the pressure test equipment, for example, the pressure test equipment is preset to automatically trigger and trigger the pressure test instruction every 1 day per month, and when the pressure test equipment detects that the preset pressure test condition is met, the pressure test equipment automatically triggers and triggers the pressure test instruction.
When the pressure test equipment receives a pressure test instruction, the pressure test equipment acquires pressure test parameters carried by the pressure test instruction, wherein the pressure test parameters comprise service request quantity, time period and index distribution average value;
That is, the number of service requests refers to the number of service requests K to be sent to the tested server by the pressure test device by the simulation client, and the number of service requests K can be flexibly set according to the service type, for example, the number of service requests is set to be ten thousands, hundreds of thousands or millions;
The time period refers to the time period of the pressure test, and can be also understood as the time period P of the service request queue, which can be 10 minutes, 2 hours and the like;
The exponential distribution mean (Lamda) refers to the number of service requests which occur in average in unit time, the queuing number in unit time, and the exponential distribution mean is consistent with the time period parameter P units in unit time: such as 10 requests per second or 1 ten thousand requests per hour, etc. The setting mode of the index distribution mean value is not particularly limited, that is, the index distribution mean value is obtained by two methods, namely, the first mode is that the index distribution mean value is obtained from the existing system statistics, for example, 2 ten thousand requests per hour or 200 requests per minute are obtained; in a second mode, the index distribution mean value is calculated according to the specific purpose to be simulated and the input parameters K and P, if the simulation is to be performed for 3 hours, 9 ten thousand requests are 3 ten thousand requests per hour, the pressure test is loaded, 60 ten thousand requests are 1 hour, and Lamda is 1 ten thousand requests per minute, namely, the parameters are combined together to be specifically defined, namely, the pressure test equipment sends K service requests to the tested server through the simulation client in P time, and the Lamda requests are averaged in unit time.
In addition, the pressure testing device in this embodiment further determines a server to be tested that needs to perform a pressure test, that is, after the pressure testing device determines the server to be tested, the pressure testing device obtains a test target value, where the test target value refers to a preset pressure test standard value, and for example, the test target value may be TPS (TPS preset processing efficiency, 1000 tasks per second) or ART (preset response time, preset response time 100 ms).
In this embodiment, the pressure test device is preconfigured with pressure test parameters, and when the pressure test is performed on the tested server, the pressure test device performs the pressure test on the tested server according to the pressure test parameters, so that the pressure test is more in line with a real service request sending scene.
And step S20, generating a probability random number sequence according to the service request quantity in the pressure test parameters.
The stress test device generates a probability random number sequence according to the number of service requests in the stress test parameters, and specifically comprises the following steps:
step a1, inputting the number of service requests in the pressure test parameters into a preset random number generator which is uniformly distributed, and obtaining probability random numbers with the same number as the number of the service requests;
and a2, arranging the probability random numbers according to the generation sequence to form a probability random number sequence.
The pressure test equipment inputs the number of service requests in the pressure test parameters to the preset random number generator with uniform distribution, and obtains the probability random number with the same number as the number of the service requests; the pressure test equipment arranges the probability random numbers according to the generation sequence to form a probability random number sequence.
For example, the stress test device randomly generates the service request number K probability random numbers Xi through a preset random number generator with uniform distribution, that is, the stress test device generates a random number generator with uniform distribution obeying the [0,1] interval through the random number generator, the probability value range of just one random event is also [0,1], the stress test device is realized through a computer program corresponding to the random number generator, namely, the stress test device circularly generates K times, one random number Xi is generated each time, the probability random number Xi belongs to the [0,1] interval, and the stress test device arranges the generated probability random numbers Xi according to the generation sequence to form a probability random number sequence X1-Xk.
And step S30, generating a time random number sequence according to the probability random number sequence and the time period and index distribution mean value in the pressure test parameters.
The pressure test equipment generates a time random number sequence according to the time period and the index distribution mean value in the probability random number sequence and the pressure test parameters, and specifically comprises the following steps:
Step b1, circulating a preset negative exponential distribution inverse function into the probability random numbers in the probability random number sequence, the time period and the exponential distribution average value in the pressure test parameter, and generating time interval random numbers with the same number of the service requests;
and b2, arranging the time interval random numbers according to the generation sequence to form a time random number sequence.
According to queuing theory of operation study, the time intervals of individual queuing which are independently and uniformly distributed in the pressure test equipment obey a negative exponential distribution function, and the following formula is adopted:
The pressure test equipment calculates a negative index distribution inverse function according to the negative index distribution function, wherein the negative index distribution inverse function is Ti= -LN (1-Xi)/Lamda, ti is expressed as a time interval random number, xi is expressed as a probability random number, lamda is expressed as an index distribution mean value, the index distribution mean value refers to the number of service requests which occur in average in unit time, and the index distribution mean value can be obtained by dividing the number of service requests by the time period, or can be obtained according to actual statistics.
The pressure test equipment circularly inputs the probability random numbers in the probability random number sequence, the time period and the index distribution average value in the pressure test parameters into a preset negative index distribution inverse function to generate time interval random numbers with the same number of service requests; the pressure test equipment arranges the time interval random numbers according to the generation sequence to form a time random number sequence.
In this embodiment, the probability random number is determined according to the number of service requests, then the time period of the transmission of the probability random number and the service requests is brought into a negative exponential distribution inverse function, the time nodes of the transmission of each service request in the time period are simulated through the negative exponential distribution inverse function, and the pressure test equipment sorts the time nodes to form a time random number sequence.
In this embodiment, the pressure test device generates a time random number sequence, and the pressure test device sends service requests according to the time random number sequence, so that a service request queue formed by sequencing the service requests accords with an actual pressure test scene, specifically:
and step S40, according to the time random number sequence, sending a service request to a tested server to perform pressure test, and obtaining a pressure test result.
The pressure test equipment sends service requests to a tested server according to a time random number sequence to carry out pressure test to obtain a pressure test result, for example, the number of the service requests is 200, the time period is 1 minute, 200 probability random numbers are simulated, namely x1, x2, x3 and x4 are respectively x1, x2, x3, x4 in the probability random number sequence until x200 and the time period of the index distribution average value in the pressure test parameter are circularly imported into a preset negative index distribution inverse function to obtain 200 time random numbers, for example, 0.1s, 0.5s, 1s, 2s, 0.7s, 0.6s, 0.7s and the like, namely, the pressure test equipment divides the 60s time period according to the time random numbers to determine the initial time to be 0s, the degree 0+0.1s sends the first service request, 0+0.1s+0.5s sends the second service request, 0+0.1s+0.5s+1s+0.3s+0.4s sends the seventh service request, 0+0.1s+0.5s+1s+2s sends the fourth service request, 0+0.1s+0.5s+1s+2s+0.5s+2s+2s+0.7s+0s+0s sends the sixth service request, 0+0.1s+0.5s+1s+2s+0.7s+0.3s+0.4s sends the seventh service request until 200 service requests are sent within 1 minute, so that the queuing of the service requests received in the server conforms to the poisson distribution (poisson distribution refers to the probability of a dispersion commonly found in the probability, that is, that the probability of random event transmission occurs). Queuing of service requests received in the server is subject to poisson distribution, so that the obtained pressure test result is more accurate.
It will be appreciated that the current servers are typically present in clusters, and thus, in this embodiment, specific steps are given for testing clustered servers, and performing service request scheduling through a load gateway to complete stress testing, including:
Step c1, when a time point corresponding to a time interval random number in the time random number sequence, calling a sleep function to send a service request to a load gateway, wherein the service request at the load gateway is arranged to form a service request queue obeying poisson distribution;
And step c2, sending the service request in the service request queue to a tested server connected with the load gateway for pressure test, and obtaining a pressure test result.
When the pressure test equipment is at a time point corresponding to the time interval random number in the time random number sequence, a sleep function is called to send service requests to a load gateway arranged in front of a plurality of tested servers, the load gateway is in communication connection with the tested servers, and the service requests at the load gateway are arranged to form a service request queue obeying poisson distribution; and the pressure test equipment sends the service request in the service request queue to a tested server connected with the load gateway for pressure test, and a pressure test result is obtained.
The pressure test equipment is in communication connection with the simulation clients, the pressure test equipment sends a unified scheduling instruction to the simulation clients, and after each simulation client receives the scheduling instruction sent by the pressure test equipment, the simulation clients call sleep functions to send service requests to the tested server, and the service requests are arranged to form a service request queue obeying poisson distribution; the pressure test equipment sends the service request in the service request queue to the load gateway, a message queue formed by the service request in the load gateway accords with the actual and real situation, and the service request is sent to one or more tested servers connected with the load gateway through the load gateway to carry out pressure test, so that a pressure test result is obtained. In this embodiment, the service request is sent to the load gateway, and the load gateway dispatches the service request to a plurality of servers connected with the load gateway, so that whether the server is set reasonably or not can be determined, and waste of hardware resources caused by too many deployed servers is avoided.
When a pressure test instruction is received, the pressure test parameter associated with the pressure test instruction is acquired; generating a probability random number sequence according to the service request quantity in the pressure test parameter; generating a time random number sequence according to the probability random number sequence and the time period and the index distribution mean value in the pressure test parameter; and sending a service request to a tested server for pressure test according to the time random number sequence to obtain a pressure test result. According to the embodiment of the invention, the service request queue which is transmitted and obeys poisson distribution is subjected to pressure test according to the queuing theory in the operation study, so that the pressure test is more realistic, and the accuracy of the pressure test result is improved; meanwhile, the accurate pressure test result ensures that the deployment strategy of the subsequent service is more reasonable, and avoids the waste of hardware resources caused by excessive server deployment.
In this embodiment, the pressure test mode is adopted in financial institutions such as banking institutions, and the financial business server to be tested through the pressure test has higher compression resistance effect, so that the financial institutions can process the financial business more efficiently, and through the test process, the pressure test effect under the distributed architecture is improved, and the requirements of the financial institutions such as banking institutions are met.
Further, based on the first embodiment of the pressure testing method of the present invention, a second embodiment of the pressure testing method of the present invention is presented.
The present embodiment is a step subsequent to step S40 in the first embodiment, and differs from the first embodiment in that:
acquiring service processing rate and service response time consumption in the pressure test result, comparing the service processing rate with a preset processing rate, and comparing the service response time consumption with the preset response time consumption;
if the service processing rate is matched with the preset processing rate and the service response time is matched with the preset response time, judging that the pressure test is passed;
And if the service processing rate is not matched with the preset processing rate or the service response time is not matched with the preset response time, judging that the pressure test is not passed.
The method comprises the steps that a pressure test device obtains service processing speed and service response time consumption in a pressure test result, the pressure test device compares the service processing speed with a preset processing speed (the preset processing speed refers to a preset server service request processing speed in pressure test), and the pressure test device compares service response time consumption with preset response time consumption (the preset response time consumption refers to preset service response average time consumption); if the service processing rate is smaller than or equal to the preset processing rate and the service response time consumption is smaller than or equal to the preset response time consumption, the pressure test equipment judges that the service processing rate is matched with the preset processing rate and the service response time consumption is matched with the preset response time consumption, and the pressure test equipment judges that the pressure test is passed; if the service processing rate is greater than the preset processing rate, or the service response time is greater than the preset response time, the pressure test device determines that the service processing rate is not matched with the preset processing rate, or the service response time is not matched with the preset response time, and the pressure test device determines that the pressure test is not passed.
In the embodiment, the pressure test device compares the service processing rate and the service response time consumption in the pressure test result with the preset processing rate and the preset response time consumption, so that the analysis of the pressure test result is more accurate.
Further, based on the above embodiment of the pressure testing method of the present invention, a third embodiment of the pressure testing method of the present invention is proposed.
The present embodiment is a step subsequent to step S40 in the first embodiment, and differs from the above-described embodiment in that:
When the pressure test result is that the pressure test fails, acquiring service processing rate and service response time in the pressure test result;
calculating the relative speed value of the service processing speed and the preset processing speed, and calculating the relative time consumption value of the service response time consumption and the preset response time consumption;
And outputting a server deployment adjustment strategy according to the rate relative value and the time-consuming relative value.
In the embodiment, when the pressure test result is that the pressure test fails, the pressure test device obtains the service processing rate and the service response time in the pressure test result; the pressure test equipment calculates the relative speed value of the service processing speed and the preset processing speed, and calculates the relative time consumption value of the service response time consumption and the preset response time consumption; according to the rate relative value and the time-consuming relative value, the pressure test device outputs a server deployment adjustment strategy, for example, the pressure test device determines that the rate relative value is 1.5, and then the output server deployment adjustment strategy increases the server deployed by 1.5 times, in this embodiment, the server deployment adjustment strategy can be flexibly set according to other scenes, the service processing rate is far less than the preset processing efficiency, the service response time is far less than the preset response time, and the server deployment amount can be reduced.
In this embodiment, the pressure test device generates the server deployment adjustment policy according to the pressure test device, so that the deployment of the server meets the requirement.
Referring to fig. 3, the present invention also provides an embodiment of a pressure testing apparatus, the pressure testing apparatus including:
The instruction receiving module 10 is configured to obtain a pressure test parameter associated with a pressure test instruction when the pressure test instruction is received;
The probability generation module 20 is configured to generate a probability random number sequence according to the number of service requests in the stress test parameter;
A time generation module 30, configured to generate a time random number sequence according to the probability random number sequence and a time period and an exponential distribution average value in the pressure test parameter;
and the service request sending module 40 is configured to send a service request to the tested server for performing a stress test according to the time random number sequence, so as to obtain a stress test result.
In an embodiment, the probability generating module 20 is further configured to:
the data input unit is used for inputting the number of the service requests in the pressure test parameters to a preset random number generator which is uniformly distributed, and obtaining probability random numbers with the same number as the number of the service requests;
And the data ordering unit is used for arranging the probability random numbers according to the generation order to form a probability random number sequence.
In one embodiment, the time generation module 30 includes:
The data carrying-in unit is used for carrying in a preset negative exponential distribution inverse function along the time period and the exponential distribution average value in the probability random number sequence, the probability random numbers in the pressure test parameters, and generating the time interval random numbers with the same number of the service requests;
and the data ordering unit is used for arranging the time interval random numbers according to the generation sequence to form a time random number sequence.
In an embodiment, the negative exponential distribution inverse function is ti= -LN (1-Xi)/Lamda, where Ti is expressed as a time interval random number, xi is expressed as a probability random number, lamda is expressed as an exponential distribution mean value, where the exponential distribution mean value refers to the number of service requests that occur in average in a unit time, and the exponential distribution mean value may be obtained by dividing the number of service requests by the time period, or the exponential distribution mean value may also be obtained according to actual statistics.
In one embodiment, the service request sending module 40 includes:
the first sending unit is used for calling a sleep function to send a service request to a load gateway when a time point corresponding to a time interval random number in the time random number sequence, wherein the service request at the load gateway is arranged to form a service request queue obeying poisson distribution;
and the second sending unit is used for sending the service request in the service request queue to a tested server connected with the load gateway for pressure test, and obtaining a pressure test result.
In one embodiment, the pressure testing device includes:
the obtaining and comparing unit is used for obtaining the service processing rate and the service response time consumption in the pressure test result, comparing the service processing rate with the preset processing rate, and comparing the service response time consumption with the preset response time consumption;
the first judging unit is used for judging that the pressure test passes if the service processing rate is matched with the preset processing rate and the service response time is matched with the preset response time;
and the second judging unit is used for judging that the pressure test does not pass if the service processing rate is not matched with the preset processing rate or the service response time is not matched with the preset response time.
In one embodiment, the pressure testing device includes:
the acquisition unit is used for acquiring service processing rate and service response time consumption in the pressure test result when the pressure test result is that the pressure test fails;
The calculating unit is used for calculating the rate relative value of the service processing rate and the preset processing rate and calculating the time-consuming relative value of the service response time consumption and the preset response time consumption;
And the strategy output unit is used for outputting a server deployment adjustment strategy according to the rate relative value and the time-consuming relative value.
According to the embodiment of the invention, the service request queue which is transmitted and obeys poisson distribution is subjected to pressure test according to the queuing theory in the operation study, so that the pressure test is more realistic, and the accuracy of the pressure test result is improved; meanwhile, the accurate pressure test result ensures that the deployment strategy of the subsequent service is more reasonable, and avoids the waste of hardware resources caused by excessive server deployment.
The method implemented when each functional module in the pressure test apparatus is executed may refer to each embodiment of the pressure test method of the present invention, which is not described herein again.
The invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention stores thereon a computer program corresponding to a stress test, which when executed by a processor implements the steps of the stress test method as described above.
The method implemented when the computer program corresponding to the pressure test running on the processor is executed may refer to various embodiments of the pressure test method of the present invention, which are not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (9)

1. A pressure testing method, characterized in that the pressure testing method comprises the steps of:
When a pressure test instruction is received, acquiring pressure test parameters associated with the pressure test instruction;
generating a probability random number sequence according to the service request quantity in the pressure test parameter;
Generating a time random number sequence according to the probability random number sequence and the time period and the index distribution mean value in the pressure test parameter;
According to the time random number sequence, sending a service request to a tested server for pressure test to obtain a pressure test result;
The step of generating the time random number sequence according to the time period and the index distribution mean value in the probability random number sequence and the pressure test parameter comprises the following steps:
Circulating and inputting the probability random numbers in the probability random number sequence, the time period and the index distribution mean value in the pressure test parameter into a preset negative index distribution inverse function to generate time interval random numbers with the same number as the service request number;
And arranging the time interval random numbers according to the generation sequence to form a time random number sequence.
2. The stress testing method according to claim 1, wherein the step of generating a sequence of probability random numbers according to the number of service requests in the stress testing parameters comprises:
inputting the number of service requests in the stress test parameters into a preset random number generator with uniform distribution to obtain probability random numbers with the same number as the number of the service requests;
And arranging the probability random numbers according to the generation sequence to form a probability random number sequence.
3. The pressure test method according to claim 1, wherein the negative exponential distribution inverse function is ti= -LN (1-Xi)/Lamda, the Ti is expressed as a time interval random number, the Xi is expressed as a probability random number, the Lamda is expressed as an exponential distribution mean value, the exponential distribution mean value is a number of service requests that occur evenly per unit time, the exponential distribution mean value is obtained by dividing the number of service requests by the time period, or the exponential distribution mean value is obtained by actual statistics.
4. The method for testing pressure according to claim 1, wherein the step of sending a service request to the tested server for testing pressure according to the time random number sequence to obtain a pressure test result comprises the steps of:
calling a sleep function to send a service request to a load gateway when a time point corresponding to a time interval random number in the time random number sequence, wherein the service request at the load gateway is arranged to form a service request queue obeying poisson distribution;
and sending the service request in the service request queue to a tested server connected with the load gateway for pressure test, and obtaining a pressure test result.
5. The method for testing pressure according to claim 1, wherein after the step of sending a service request to a tested server according to the time random number sequence to perform pressure test and obtaining a pressure test result, the method comprises:
acquiring service processing rate and service response time consumption in the pressure test result, comparing the service processing rate with a preset processing rate, and comparing the service response time consumption with the preset response time consumption;
if the service processing rate is matched with the preset processing rate and the service response time is matched with the preset response time, judging that the pressure test is passed;
And if the service processing rate is not matched with the preset processing rate or the service response time is not matched with the preset response time, judging that the pressure test is not passed.
6. The pressure testing method according to any one of claims 1 to 5, wherein after the step of sending a service request to a tested server according to the time random number sequence to perform pressure testing and obtaining a pressure testing result, the method comprises:
When the pressure test result is that the pressure test fails, acquiring service processing rate and service response time in the pressure test result;
calculating the relative speed value of the service processing speed and the preset processing speed, and calculating the relative time consumption value of the service response time consumption and the preset response time consumption;
And outputting a server deployment adjustment strategy according to the rate relative value and the time-consuming relative value.
7. A pressure testing device is characterized in that, the pressure testing device includes:
The instruction receiving module is used for acquiring pressure test parameters associated with the pressure test instruction when the pressure test instruction is received;
The probability generation module is used for generating a probability random number sequence according to the service request quantity in the pressure test parameters;
the time generation module is used for generating a time random number sequence according to the probability random number sequence and the time period and the index distribution mean value in the pressure test parameter;
The service request sending module is used for sending a service request to a tested server for pressure test according to the time random number sequence to obtain a pressure test result;
the time generation module comprises:
The data carrying-in unit is used for carrying in a preset negative exponential distribution inverse function along the time period and the exponential distribution average value in the probability random number sequence, the probability random numbers in the pressure test parameters, and generating the time interval random numbers with the same number of the service requests;
and the data ordering unit is used for arranging the time interval random numbers according to the generation sequence to form a time random number sequence.
8. A pressure testing apparatus, characterized in that the pressure testing apparatus comprises: memory, a processor and a computer program stored on the memory and executable on the processor for stress testing, which when executed by the processor implements the steps of the stress testing method according to any of claims 1 to 6.
9. A computer-readable storage medium, on which a computer program corresponding to a stress test is stored, which, when being executed by a processor, carries out the steps of the stress test method according to any one of claims 1 to 6.
CN202010529116.XA 2020-06-11 2020-06-11 Pressure testing method, device, equipment and computer readable storage medium Active CN111625469B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010529116.XA CN111625469B (en) 2020-06-11 2020-06-11 Pressure testing method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010529116.XA CN111625469B (en) 2020-06-11 2020-06-11 Pressure testing method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN111625469A CN111625469A (en) 2020-09-04
CN111625469B true CN111625469B (en) 2024-09-20

Family

ID=72272747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010529116.XA Active CN111625469B (en) 2020-06-11 2020-06-11 Pressure testing method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN111625469B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113037589B (en) * 2021-03-01 2022-04-22 广东睿住智能科技有限公司 Pressure testing method and device of gateway equipment, testing platform and storage medium
CN113609026B (en) * 2021-08-20 2022-09-16 盐城金堤科技有限公司 Method and device for pressure testing of server
CN113821442B (en) * 2021-09-29 2023-08-08 苏州浪潮智能科技有限公司 Stress testing method, system, terminal and storage medium based on normal distribution
CN114579448A (en) * 2022-03-03 2022-06-03 中国建设银行股份有限公司 A method, device, storage medium and device for simulating transactions

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175110A (en) * 2019-05-31 2019-08-27 深圳前海微众银行股份有限公司 Method for testing pressure, device, system, equipment and computer readable storage medium
CN111176918A (en) * 2019-12-28 2020-05-19 苏州浪潮智能科技有限公司 A server testing method, system, device and computer-readable storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150178646A1 (en) * 2013-12-20 2015-06-25 Sas Institute Inc. Integrated stress testing framework system and method
CN107451048A (en) * 2016-03-31 2017-12-08 阿里巴巴集团控股有限公司 The method and apparatus of pressure simulation test on a kind of line
CN108271201A (en) * 2016-12-30 2018-07-10 联芯科技有限公司 The mobility method for testing pressure and device of wireless terminal
CN108572914B (en) * 2018-03-14 2020-12-18 口碑(上海)信息技术有限公司 Method and device for generating log for pressure test
CN110740079B (en) * 2019-10-16 2021-05-28 北京航空航天大学 A Full-Link Benchmark Test System for Distributed Scheduling System

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110175110A (en) * 2019-05-31 2019-08-27 深圳前海微众银行股份有限公司 Method for testing pressure, device, system, equipment and computer readable storage medium
CN111176918A (en) * 2019-12-28 2020-05-19 苏州浪潮智能科技有限公司 A server testing method, system, device and computer-readable storage medium

Also Published As

Publication number Publication date
CN111625469A (en) 2020-09-04

Similar Documents

Publication Publication Date Title
CN111625469B (en) Pressure testing method, device, equipment and computer readable storage medium
CN111768008B (en) Federal learning method, apparatus, device, and storage medium
CN110175110B (en) Pressure testing method, device, system, equipment and computer readable storage medium
CN105281978B (en) A kind of methods, devices and systems of performance test
Adhikari et al. Analysis of average waiting time and server utilization factor using queueing theory in cloud computing environment
CN107679818A (en) Software project management method, terminal and computer-readable recording medium
CN108492005B (en) Project data processing method and device, computer equipment and storage medium
US8606905B1 (en) Automated determination of system scalability and scalability constraint factors
CN111698303A (en) Data processing method and device, electronic equipment and storage medium
CN110930254B (en) Data processing method, device, terminal and medium based on block chain
CN114924851B (en) Training task scheduling method and device, electronic equipment and storage medium
CN116700920A (en) Cloud primary hybrid deployment cluster resource scheduling method and device
CN110781180B (en) Data screening method and data screening device
CN113763043A (en) Advertisement landing page display method and device, storage medium and computer equipment
CN108650520B (en) Video live broadcast control method, related equipment and computer storage medium
CN119902904A (en) Intelligent computing center model development method and device for inclusive computing power
CN111369281B (en) Online message processing method, device, equipment and readable storage medium
CN114721945B (en) Distribution method and device based on graph database, electronic equipment and storage medium
Van Do et al. Properties of Horizontal Pod Autoscaling Algorithms and Application for Scaling Cloud-Native Network Functions
CN114330879A (en) Order distribution method and system of multi-dimensional constraint
Sajal et al. TraceSplitter: a new paradigm for downscaling traces.
CN118075106A (en) Cloud edge networking-based application continuous integration and deployment method and system
CN106648895A (en) Data processing method and device, and terminal
Zhang et al. BatOpt: Optimizing GPU-based deep learning inference using dynamic batch processing
CN110489201B (en) Container performance testing device and method

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
GR01 Patent grant
GR01 Patent grant