负载测试中这两种方案之间的区别 [英] Difference between these 2 scenarios in load testing

查看:204
本文介绍了负载测试中这两种方案之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建一个负载测试,到目前为止,我已经做到了: 线程数100 加速期-100 循环-2

I'm creating a load test, and I have done this so far: threads-100 ramp up period- 100 loop - 2

我的理解是每秒将触发一个线程,并且在完成第一批100个线程之后,将以相同的方式触发另一轮100个线程,它们的触发时间之差为1秒(与第一个循环相同).这样对吗? 另外,如果我有这个会怎样:

My understanding is that 1 thread will be fired per second, and after the first batch of 100 threads is done, another round of 100 threads will be fired in the same way, with the difference between their firing period as 1 sec(same as the first loop). Is this correct? Also, what would be the case if I had this:

threads-200 加速期-200 循环1

threads-200 ramp up period- 200 loop-1

这是否意味着每秒1个线程,总共200个线程?这相当于第一种情况吗?请帮忙,测试时我得到的结果非常奇怪,因此这个问题

Does it mean 1 thread per second and a total of 200 threads? Is this equivalent to the 1st case? Please help, I'm getting very wierd results while testing, hence this question

推荐答案

不是.第二种情况与第一种情况不同.

Nope. 2nd scenario is not the same as the first.

记住这些(假设选择了在需要之前创建延迟线程")

Remember these (assuming 'delay thread creation until needed' is selected)

Thread Creation Rate = ( Ramp up Period ) / (No of Threads).
Thread is executed independently.

第一种情况:

线程创建速率= 1个线程/秒.每秒创建一个线程.因此,在100秒后,您将拥有100个线程/用户.

Thread Creation Rate = 1 thread / sec. Every second, a thread is created. So after 100 sec, you will have 100 threads/users.

创建第一个线程后,它将向第一个发送请求.完成后,除非您已明确设置计时器,否则它不会等待.由于循环计数为2,因此它将发送另一个请求.在这里,每个用户向服务器发送2个请求.但是,只有在第一个请求完成后才发送第二个请求.但是其他线程是否已发送请求/是否获得响应都没关系.

Once the first thread is created, it sends the first the request. once it completes, it does not wait unless you have have explicitly set a timer. Since the loop count is 2, it sends another request. Here, each user sends 2 requests to the server. But the second request is sent only after the first request is complete. but it does not matter other threads have the sent the requests/got their responses or not.

第二种情况:

线程创建速率= 1个线程/秒.因此,在200秒后,您将拥有200个线程/用户. 在此,每个服务器仅向服务器发送一个请求.

Thread Creation Rate = 1 thread / sec. So after 200 sec, you will have 200 threads/users. Here each sends only one request to the server.

有什么区别?

假设,服务器通常需要300秒来处理请求.

Lets assume, the server usually takes 300 seconds to process a request.

第一种情况:

100秒后,有100个用户向服务器发送了请求.在300秒内处理每个请求后,在100秒后,有100个用户等待服务器响应.他们不会发送任何其他请求,直到任何用户得到响应为止.即使在200秒之后,serer也只有100个并发用户.

After 100 seconds, 100 users have sent requests to the server. As each request is processed in 300 seconds, after 100 seconds, 100 users wait for the server to respond. They do not send any other request until any of the users got a response. Even after 200 seconds, the serer has only 100 concurrent users.

第二种情况:

但是,在这里,服务器在200秒后有200个并发用户.与第一种情况相比,我们在服务器上的负载更多.随着负载的增加,服务器的响应时间可能会比第一种情况更长.

But, here, The server has 200 concurrent users after 200 seconds. we have more load on the server compared to the first scenario. Response time of the server might be more compared to the First scenario as the load is more.

这篇关于负载测试中这两种方案之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆