简体   繁体   English

如何获得由参数值计算的预期TPS?

[英]How to obtain the expected TPS., which is calculated by parameters value?

I have used the normal thread group of 40 threads,180000 of throughput, and expected TPS is 3000.., But , Resulted only 2750 tps., How can I improve the TPS?我已经使用了40个线程的普通线程组,吞吐量180000,预期TPS为3000..,但是,结果只有2750 tps。,我该如何提高TPS? I have tried the concurrency thread group along with the shaping timer combination.. Can u pls guide me..,Thanks in Advance.我已经尝试了并发线程组和整形定时器组合..你能指导我..,提前致谢。

TPS or the throughput is controlled by sending the required number of requests to the target server in a unit time (seconds, minutes, hours, etc)通过在单位时间内(秒、分钟、小时等)向目标服务器发送所需数量的请求来控制 TPS 或吞吐量

It is not easy or good practice to control the throughput by changing the number of threads.通过更改线程数来控制吞吐量并不容易或良好做法。 When the server gets slow the throughput gets low and vice-versa.当服务器变慢时,吞吐量变低,反之亦然。

You need to introduce delays when the server responds faster and introduce more threads when the server responds slower.您需要在服务器响应较快时引入延迟,并在服务器响应较慢时引入更多线程。 It is not easy to achieve the desired throughput by setting the thread count.通过设置线程数来实现所需的吞吐量并不容易。

Please note that请注意

throughput will be lower if the server is not capable of handling it, or if other timers or time-consuming test elements prevent it.如果服务器无法处理它,或者如果其他计时器或耗时的测试元素阻止它,吞吐量将会降低。

JMeter has a number of ways to achieve the desired throughput by introducing delays to the requests. JMeter 有多种方法可以通过对请求引入延迟来实现所需的吞吐量。

Using Timers使用定时器

In the above cases, you need to ensure a sufficient number of threads are available to generate the required throughputs.在上述情况下,您需要确保有足够数量的线程可用以生成所需的吞吐量。 This solution is not efficient if a large number of threads are created than the required number of threads.如果创建的线程数超过所需的线程数,则此解决方案效率不高。

The best approach would be the test should create additional threads on-demand and introduce delays between requests as required.最好的方法是测试应该按需创建额外的线程并根据需要在请求之间引入延迟。

In JMeter, you can achieve this with Concurrency Thread Group along with the Throughput Shaping Timer .在 JMeter 中,您可以使用Concurrency Thread Group吞吐量整形计时器来实现这一点。

This video demonstrate the use of the controllers.该视频演示了控制器的使用。

  1. First of all your application must be able to handle such a load.首先,您的应用程序必须能够处理这样的负载。 I don't know what your 180000 of throughput, stanza means,if you put it to the Constant Throughput Timer be aware that:我不知道你的180000 of throughput,节是什么意思,如果你把它放在恒定吞吐量计时器上,请注意:
  • it is precise enough on "minute" level它在“分钟”级别上足够精确

  • it can only "pause" JMeter to "limit" its throughput to the given value它只能“暂停”JMeter 以将其吞吐量“限制”为给定值

    In general you can reach out 3000 TPS with 40 users only if 1 user will make 75 requests per second which means that your application response time should be below 75 milliseconds.一般而言,只有当 1 个用户每秒发出 75 个请求时,您才能与 40 个用户达到 3000 TPS,这意味着您的应用程序响应时间应低于 75 毫秒。

    If response time will be higher - you won't be able to reach 3000 requests per second with 40 users.如果响应时间更长 - 您将无法在 40 个用户的情况下达到每秒 3000 个请求。

  1. Also JMeter should be able to send requests fast enough, so make sure to follow JMeter Best Practices and if this is not sufficient consider using Distributed Testing此外,JMeter 应该能够足够快地发送请求,因此请确保遵循JMeter 最佳实践,如果这还不够,请考虑使用分布式测试

More information: What is the Relationship Between Users and Hits Per Second?更多信息: 用户和每秒点击数之间的关系是什么?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM