即使在Jmeter中完成测试后,线程仍保持运行 [英] Threads keep running even after test finishes in Jmeter

查看:743
本文介绍了即使在Jmeter中完成测试后,线程仍保持运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用3256个线程的jmeter上运行24小时负载测试.但是即使在28小时之后,某些线程仍会继续运行,并且不会下降.运行中有几个错误.

I am running 24 Hr load test on jmeter with 3256 threads. But even after 28 hrs some of the threads keep running and does not get ramp down. There are several errors in the run.

即使我选择停止线程,关闭所有线程,请耐心等待",弹出窗口会显示并永久保留,并且没有线程在逐渐减少.

Even when I choose to stop the threads,"Shutting down all the threads, please be patient" Pop up appears and stays forever and no threads are ramping down.

供您参考:-线程数3256;加速期-300;循环计数192 考虑脚本中的所有思考/等待时间,场景应运行24小时.

For your information:- Number of threads-3256; Ramp up period-300; Loop Count-192 Considering all the think/wait time in the script , scenario should run for 24Hrs.

如何强制关闭所有线程.

How can I close all the threads forcefully.

推荐答案

有以下可用选项:

  1. JMeter正在侦听端口4445上的关闭消息.JMeter安装的/bin文件夹中有2个脚本:
    • shutdown.cmd(sh)-向所有线程发送正常关闭请求
    • stoptest.cmd(sh)-强制停止线程
  1. JMeter is listening to shutdown messages on port 4445. There are 2 scripts in /bin folder of your JMeter installation:
    • shutdown.cmd(sh) - send graceful shutdown request to all threads
    • stoptest.cmd(sh) - force stop threads

使用带有以下代码的 Beanshell Sampler :

SampleResult.setStopTestNow(true);

但是,通过这种方式,您可能会由于强制关闭测试线程而导致很多错误,这些错误将出现在测试结果中.

However in that way you can get lots of errors caused by force shutting down of test threads which will be in your test results.

实际上,我认为您所遇到的行为是由负载生成器(JMeter)端缺乏资源引起的.尝试遵循 JMeter性能和调优技巧指南中的建议,以查看是否有帮助(您无需等待所有的24小时,只要等到所有线程都加速运行就足够了).

Actually I think that behavior your're experiencing is being caused by lack of resources on your load generator (JMeter) side. Try following recommendations from JMeter Performance and Tuning Tips guide to see if it helps (you don't need to wait all 24h, it will be enough to wait till all threads are ramped up).

如果调整JMeter参数无济于事,则您需要考虑分布式测试,并从多个主机生成负载.

If adjusting JMeter parameters won't help it looks like that you'll need to consider distributed testing and generate the load from more than one host.

这篇关于即使在Jmeter中完成测试后,线程仍保持运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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