Depth profiling step loads the number of requests and the final

Outline

Recently, many friends to ask questions about the ladder pressurized and polymerization report the actual number of requests.

It is basically the same confusion, and that is obviously just set yourself up dozens of threads, the last report ran out why the polymerization tens of thousands of requests?

On this issue, the actual operation today and record it, answer all the doubts.

experiment

Or use Baidu to do examples

We parameter setting request thread group pressurizing step, as FIG.

 

 

This figure shows

1: every 2 seconds, 5 thread starts within 1 second

2: After each thread will run 2s and then load the next time a thread to start loading

3: 50 threads will eventually be loaded and running continuously 30s

4:50 threads continue to run after the 30s, would stop every 2 seconds 5 threads, the remaining threads continue to load. Until the complete cessation of all threads

 

To properly understand how to calculate the final number of requests is out. We must know that every second thread in the end how much the release request! !

 

Ladder pressurized stages:

If the average response time for the request is 100ms, then one second iteration can be 10 times

Well, this one second if I start within five threads, then the number is 5 * 10 = 1s This request is made within 50

Then, it runs the 2s minutes before beginning to load the next wave thread. In the last 2 seconds, the number of requests it issues is 2 * 5 * 10 = 100 times

After 2s, thread group 1s and released within five requests and run 2s. Then the 2s this, it sends a request 2 * 10 * 10 = 200 times (in this case, running threads 10)

And so on, until the thread is finished loading before 50, the number of requests we release the thread group is such that

(2 * 5 * 10) + (2 * 10 * 10) + (2 * 15 * 10) + (2 * 20 * 10) + (25 * 10 * 2) + .... + (2 * 45 * 10) = 4500 times

 

Continuous load stages:

Note: Why did not the last 2 * 50 * 10 it? Because after 50 threads from finished loading, we conducted a continuous load of 30s! !

这30s内,我们的总的请求数是30*50*10=15000

 

线程释放阶段:

在30s负载结束之后,我们的线程组开始阶梯式释放

此时,即使是线程组在释放,那么剩余的线程依然在发起请求

(2*45*10)+(2*40*10)+(2*35*10)+(2*30*10)+(2*25*10)+....+(2*5*10)=4500次

 

总的请求数=4500+15000+4500=24000次

 

是不是请求数真的就这么精确呢?其实这样计算也是不准确的

因为随着我们的负载越来越大,对服务器资源的消耗也越来越大,请求的响应时间也会越来越长

响应时间越来越长,那么相应的每秒迭代次数就会变少。我们这里的响应时间仅仅取了个平均值,真实的数据肯定会有误差

 

Guess you like

Origin www.cnblogs.com/Zfc-Cjk/p/11426904.html