跳到主要内容

Automatically Calculate Parameter Signature for Interface Requests

Usage Scenarios

Performance testing for specified interfaces.

Implementation Method

To achieve high-performance concurrency requirements, a self-developed stress testing engine is used, capable of achieving over ten thousand concurrent requests.

The project is open-source, GitHub address: https://github.com/EchoAPI-Team/runnerGo

Stress Test Result Calculation Method

Stress Test ValueMeaningCalculation Method
Total RequestsTotal number of requests sentConcurrency * Rounds
Execution TimeExecution time of the stress test taskEnd time of the task - Start time of the task
Successful RequestsNumber of requests with HTTP status code 200N/A
Failed RequestsNumber of requests with HTTP status code other than 200 or connection exceptionsN/A
Error RateError rate of the stress test(Number of failures / Total requests) * 1000
Total Received DataTotal bytes of data receivedSum of the bytes of each response
Requests Per SecondAverage number of requests per secondTotal requests / Total time
Successful Requests Per SecondAverage number of successful requests per secondTotal successful requests / Total time of successful requests
Bytes Received Per SecondAverage bytes received per secondTotal received bytes / Total time
Maximum Response TimeMaximum execution time of a requestLongest execution time among all requests
Minimum Response TimeMinimum execution time of a requestShortest execution time among all requests
Average Response TimeAverage response timeTotal time / Total requests
10%Time to complete the first 10% of requestsSort all request times in ascending order, take the 10% position
25%Time to complete the first 25% of requestsSort all request times in ascending order, take the 25% position
50%Time to complete the first 50% of requestsSort all request times in ascending order, take the 50% position
75%Time to complete the first 75% of requestsSort all request times in ascending order, take the 75% position
90%Time to complete the first 90% of requestsSort all request times in ascending order, take the 90% position
95%Time to complete the first 95% of requestsSort all request times in ascending order, take the 95% position

Practice

The results of concurrent tests are easily influenced by external factors, so it is necessary to minimize external influences during stress testing.

External factors that affect stress test results include local handle number limits, DNS resolution speed, network quality, server connection limits, etc.

For example, using 10,000 concurrent requests can easily exceed the local maximum handle number limit (usually 1024), causing requests that exceed the handle limit to fail due to handle constraints.

Therefore, choosing an appropriate number of concurrent requests is very important for testing interface performance. More concurrency is not always better.

It is recommended to test with 10, 100, 500, and 1000 concurrent requests first. If the failure rate is less than 1%, then consider gradually increasing the concurrency. Only increasing the number of requests per second in a sustainable manner is a healthy usage method.