CN-121996479-A - Performance test method and device for equipment
Abstract
The application discloses a performance test method and device of equipment, which can be applied to various scenes such as cloud technology, artificial intelligence, intelligent traffic, internet of vehicles and the like, and the method comprises the steps of obtaining a preset qps upper threshold value and a preset qps lower threshold value of the equipment; the method comprises the steps of testing equipment based on a preset qps lower limit threshold to obtain an initial test result, adopting a dichotomy iteration qps lower limit threshold to obtain a next round qps threshold if the initial timeout rate is larger than or equal to the preset timeout rate threshold, determining a next round qps threshold based on a qps lower limit threshold and a unit iteration qps if the initial timeout rate is larger than or equal to the task conclusion timeout rate threshold and smaller than the preset timeout rate threshold, determining a next round qps threshold based on a preset qps upper limit threshold if the initial timeout rate is smaller than the task conclusion timeout rate threshold, and testing the equipment based on a next round qps threshold to obtain a performance test result. The application can rapidly determine the performance test result of the equipment and improve the test efficiency.
Inventors
- QING YIXUAN
- ZHENG XU
Assignees
- 深圳市腾讯计算机系统有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241107
Claims (15)
- 1.A method of testing the performance of a device, the method comprising: acquiring a preset qps upper limit threshold value and a preset qps lower limit threshold value of the equipment; testing the equipment based on the preset qps lower limit threshold to obtain an initial test result, wherein the initial test result comprises an initial timeout rate; If the initial timeout rate is greater than or equal to a preset timeout rate threshold, iterating the qps lower threshold by a dichotomy to obtain a next round qps threshold, wherein the preset timeout rate threshold is determined based on a task conclusion timeout rate threshold, and the difference between the preset timeout rate threshold and the task conclusion timeout rate threshold is greater than a first threshold, and a test qps corresponding to the task conclusion timeout rate threshold is the maximum qps in the test process; if the initial timeout rate is greater than or equal to the task conclusion timeout rate threshold and less than the preset timeout rate threshold, determining the next round qps threshold based on the qps lower-limit threshold and unit iteration qps; If the initial timeout rate is less than the task conclusion timeout rate threshold, determining the next round qps threshold based on the preset qps upper limit threshold; and testing the equipment based on the next round qps threshold value to obtain a performance test result.
- 2. The method of claim 1, wherein the determining the next round qps threshold based on the qps lower threshold and unit iterations qps if the initial timeout rate is greater than or equal to the task conclusion timeout rate threshold and less than the preset timeout rate threshold comprises: if the initial timeout rate is greater than or equal to the task conclusion timeout rate threshold and less than a task stop timeout rate threshold, determining the next round qps threshold based on the qps lower limit threshold and the unit iteration qps upward iteration, wherein the difference between the task stop timeout rate threshold and the task conclusion timeout rate threshold is less than a second threshold, and the task stop timeout rate threshold is less than the preset timeout rate threshold; If the initial timeout rate is greater than or equal to a task stop timeout rate threshold and less than the preset timeout rate threshold, determining the next round qps threshold based on the qps lower threshold and the unit iteration qps downward iterations.
- 3. The method of claim 1, wherein the testing the device based on the next round qps of thresholds results in performance testing, comprising: Testing the equipment based on the next round qps of threshold values to obtain a first timeout rate and a second timeout rate, wherein the first timeout rate is greater than the task conclusion timeout rate threshold value; obtaining the minimum qps of the first timeout rate in the test process to obtain a first qps; obtaining the maximum qps of the second timeout rate in the test process to obtain a second qps; calculating a difference between the first qps and the second qps to obtain a target difference; If the target difference value is smaller than or equal to the unit iteration qps, triggering to stop the test; And if the target difference value is larger than the unit iteration qps, continuing to execute the next round of testing to obtain a performance test result.
- 4. A method according to any one of claims 1-3, wherein the method further comprises: judging whether the turn satisfying the heavy running mechanism exists or not under the condition that the test turn is larger than a preset threshold value; if the round meeting the heavy running mechanism exists, determining a target qps corresponding to the heavy running mechanism, and executing a heavy running test based on the target qps; If the run-up mechanism is not met, a test result set of each run of the device is obtained, data in the test result set is ordered according to qps, and the third qps of the upward iteration and the fourth qps of the downward iteration are predicted.
- 5. The method of claim 4, wherein said determining whether there is a turn satisfying a heavy running mechanism comprises: Testing the equipment based on a third qps to obtain a third timeout rate; testing the equipment based on a fourth qps to obtain a fourth timeout rate; If the third timeout rate is smaller than the task conclusion timeout rate threshold and the fourth timeout rate is larger than the task conclusion timeout rate threshold, determining that a turn satisfying a heavy running mechanism exists; And if the third timeout rate is greater than or equal to the task conclusion timeout rate threshold and/or the fourth timeout rate is less than or equal to the task conclusion timeout rate threshold, determining that no turn satisfying a heavy running mechanism exists.
- 6. The method of claim 5, wherein determining the target qps corresponding to the rerun mechanism comprises: Calculating a first difference absolute value of the third timeout rate and the task conclusion timeout rate threshold, and calculating a second difference absolute value of the fourth timeout rate and the task conclusion timeout rate threshold; If the first absolute value of the difference is less than or equal to the second absolute value of the difference, determining the first absolute value of the difference as the target qps; and if the first absolute difference value is greater than the second absolute difference value, determining the second absolute difference value as the target qps.
- 7. The method of claim 5, wherein the method further comprises: When the number of re-running times is less than or equal to a preset number of times threshold, re-determining the highest qps in the re-running test process as a third qps, and re-determining the lowest qps in the re-running test process as a fourth qps; jumping to the step of testing the equipment based on the third qps to obtain a third timeout rate; and when the re-running times are greater than a preset times threshold, exiting the re-running test.
- 8. The method of claim 4, wherein the performance test results include a cpu load and a timeout rate, wherein the ordering of the data in the test result set by qps predicts a third qps iteration up and a fourth qps iteration down, comprising: Acquiring a current CPU load corresponding to a current round qps and a current timeout rate; If the current cpu load is greater than or equal to a preset value and the current timeout rate is greater than or equal to the task conclusion timeout rate threshold, calculating the sum of the current round qps and the unit iteration qps to obtain a third qps of upward iteration; the data in the test result set is ranked according to qps, and a fourth qps of the downward iteration is predicted.
- 9. The method of claim 8, wherein the method further comprises: If the current cpu load is greater than or equal to the preset value and the current timeout rate is less than the task conclusion timeout rate threshold, calculating the sum of the current round qps and n times of the unit iterations qps to obtain a third qps of upward iterations, wherein n is greater than or equal to 2; if the current CPU load is smaller than the preset value, predicting a target CPU load based on the current CPU load and a preset CPU load threshold; And fitting to obtain an association relationship between the cpu load and qps based on the cpu load data and qps data in the ordered set of test results, and determining a third qps iterated upwards based on the association relationship and the target cpu load.
- 10. The method of claim 9, wherein the determining a third qps of the upward iterations based on the association and the target cpu load comprises: Calculating the average value of the target cpu load and the target numerical value to obtain a target load threshold; comparing the target load threshold with a preset cpu load threshold, and determining smaller values of the target load threshold and the preset cpu load threshold as screening cpu loads; And determining qps corresponding to the screened cpu load as a third qps iterated upwards based on the association relation.
- 11. The method of claim 8, wherein the ordering of the data in the test result set by qps predicts a fourth qps of a downward iteration, comprising: If the current timeout rate is greater than or equal to the preset timeout rate threshold, determining half of the current round qps as a fourth qps of downward iteration; If the current timeout rate is greater than or equal to a task stop timeout rate threshold and is less than the preset timeout rate threshold, obtaining a fourth qps of downward iteration based on a difference value between the current round qps and n times of the unit iteration qps, wherein n is greater than or equal to 2; if the current timeout rate is less than the task stop timeout rate threshold, calculating a difference between the current round qps and the unit iteration qps to obtain a fourth qps of the downward iteration.
- 12. The method of claim 11, wherein the obtaining a fourth qps of a downward iteration based on a difference of the current round qps and n times the unit iteration qps comprises: Calculating the difference value between the current round qps and the n times of the unit iteration qps to obtain a current qps difference value; if the current qps difference is greater than zero, determining the current qps difference as a fourth qps of the downward iterations; If the current qps difference is less than zero, calculating the difference between the current round qps and the unit iteration qps; if the difference between the current round qps and the unit iteration qps is greater than zero, the difference is determined to be the fourth qps of the downward iteration.
- 13. The method of claim 8, wherein the method further comprises: acquiring a current test result set of a current round; Determining a first current timeout rate corresponding to the current maximum qps and a second current timeout rate corresponding to the current minimum qps based on the current test result set; If the first current timeout rate is less than or equal to a task stop timeout rate threshold, testing based on the third qps of the upward iteration; And if the second current timeout rate is less than or equal to the task conclusion timeout rate threshold, testing based on the fourth qps of the downward iteration.
- 14. The method of claim 13, wherein the method further comprises: acquiring a minimum qps of the current test result set, wherein the timeout rate is greater than or equal to the task conclusion timeout rate threshold, and taking the minimum qps as a third current timeout rate; acquiring the maximum qps of the current test result set with the timeout rate smaller than the task conclusion timeout rate threshold as a fourth current timeout rate; calculating the difference value between the third current time-out rate and the third current time-out rate to obtain a current time-out rate difference value; if the current timeout rate difference is larger than the unit iteration qps, continuing to perform an iteration test through the dichotomy; If the current timeout rate difference is less than or equal to the unit iteration qps, the iteration is complete, and qps when the iteration is complete is determined as the target upper limit qps of the device.
- 15. A performance testing apparatus for a device, the apparatus comprising: The limit threshold acquiring module is used for acquiring a preset qps upper limit threshold and a preset qps lower limit threshold of the equipment; the initial result determining module is used for testing the equipment based on the preset qps lower limit threshold value to obtain an initial test result, wherein the initial test result comprises an initial timeout rate; The first threshold determining module is used for iterating the qps lower threshold by a dichotomy to obtain a next round qps threshold if the initial timeout rate is larger than or equal to a preset timeout rate threshold, wherein the preset timeout rate threshold is determined based on a task conclusion timeout rate threshold, and the difference value between the preset timeout rate threshold and the task conclusion timeout rate threshold is larger than the first threshold; A second threshold determining module, configured to determine, if the initial timeout rate is greater than or equal to the task conclusion timeout rate threshold and is less than the preset timeout rate threshold, the next round qps threshold based on the qps lower limit threshold and unit iteration qps; A third threshold determining module, configured to determine, based on the preset qps upper threshold, the next round qps threshold if the initial timeout rate is less than the task conclusion timeout rate threshold; And the test result determining module is used for testing the equipment based on the next round qps threshold value to obtain a performance test result.
Description
Performance test method and device for equipment Technical Field The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for testing performance of a device. Background The performance test conclusion of the background service equipment is generally the maximum qps supported by a single machine, and the qps is the conclusion of a constraint pressure test request under a certain timeout rate. Because with the increase of qps, the cpu load of the background service device increases, the processing time of the pressure measurement request increases, and thus the timeout rate of the request also increases. The goal of the performance test is to find a stand-alone maximum qps under some timeout rate constraint. In the process of performing the performance test of the equipment in the related technology, a smaller initial qps is usually set, then a proper qps iteration step length is set, and then iteration is performed from small to large until the timeout rate exceeds a threshold value, so as to obtain a performance conclusion qps at the moment. Disclosure of Invention The application provides a performance test method and device for equipment, which can reduce the iteration times in the performance test process, can quickly determine the performance test result of the equipment and improve the test efficiency. In one aspect, the present application provides a method for testing performance of a device, the method comprising: acquiring a preset qps upper limit threshold value and a preset qps lower limit threshold value of the equipment; testing the equipment based on the preset qps lower limit threshold to obtain an initial test result, wherein the initial test result comprises an initial timeout rate; If the initial timeout rate is greater than or equal to a preset timeout rate threshold, iterating the qps lower threshold by a dichotomy to obtain a next round qps threshold, wherein the preset timeout rate threshold is determined based on a task conclusion timeout rate threshold, and the difference between the preset timeout rate threshold and the task conclusion timeout rate threshold is greater than a first threshold, and a test qps corresponding to the task conclusion timeout rate threshold is the maximum qps in the test process; if the initial timeout rate is greater than or equal to the task conclusion timeout rate threshold and less than the preset timeout rate threshold, determining the next round qps threshold based on the qps lower-limit threshold and unit iteration qps; If the initial timeout rate is less than the task conclusion timeout rate threshold, determining the next round qps threshold based on the preset qps upper limit threshold; and testing the equipment based on the next round qps threshold value to obtain a performance test result. Another aspect provides a performance testing apparatus for a device, the apparatus comprising: The limit threshold acquiring module is used for acquiring a preset qps upper limit threshold and a preset qps lower limit threshold of the equipment; the initial result determining module is used for testing the equipment based on the preset qps lower limit threshold value to obtain an initial test result, wherein the initial test result comprises an initial timeout rate; The first threshold determining module is used for iterating the qps lower threshold by a dichotomy to obtain a next round qps threshold if the initial timeout rate is larger than or equal to a preset timeout rate threshold, wherein the preset timeout rate threshold is determined based on a task conclusion timeout rate threshold, and the difference value between the preset timeout rate threshold and the task conclusion timeout rate threshold is larger than the first threshold; A second threshold determining module, configured to determine, if the initial timeout rate is greater than or equal to the task conclusion timeout rate threshold and is less than the preset timeout rate threshold, the next round qps threshold based on the qps lower limit threshold and unit iteration qps; A third threshold determining module, configured to determine, based on the preset qps upper threshold, the next round qps threshold if the initial timeout rate is less than the task conclusion timeout rate threshold; And the test result determining module is used for testing the equipment based on the next round qps threshold value to obtain a performance test result. Another aspect provides an electronic device comprising a processor and a memory having stored therein at least one instruction or at least one program loaded and executed by the processor to implement a method of testing the performance of a device as described above. Another aspect provides a computer storage medium storing at least one instruction or at least one program loaded and executed by a processor to implement a method of performance testing of a device as described above. Another aspec