简体   繁体   English

JMeter 垃圾收集影响吞吐量计时

[英]JMeter garbage collection affecting the throughput timing

I am currently trying to understand how JMeter's Garbage collection affects the response time.我目前正在尝试了解 JMeter 的垃圾收集如何影响响​​应时间。 According to my reference, I found that the time spent in GC will be added to the overall elapsed time.根据我的参考,我发现在 GC 中花费的时间会被添加到整体经过的时间中。 In my case, I have to either reduce or remove the time taken for GC.就我而言,我必须减少或消除 GC 花费的时间。 More preferably shorter GC pauses.更优选更短的 GC 暂停。 while looking out for my issue.在寻找我的问题的同时。 I have seen this article https://howtojboss.wordpress.com/2012/07/31/concurrent-high-throughput-performance-testing-with-jmeter/ Where they said the solution is to use Concurrent Mark Sweep (CMS) collector.我看过这篇文章https://howtojboss.wordpress.com/2012/07/31/concurrent-high-throughput-performance-testing-with-jmeter/他们说的解决方案是使用并发标记扫描(CMS)收集器.

GC="-XX:+UseConcMarkSweepGC"

But that is not working for my case.但这对我的情况不起作用。 I am getting the same elapsed time after using all the types of garbage collectors like serial, parallel, G1GC, ZGC, and Shenandoah GC.在使用串行、并行、G1GC、ZGC 和 Shenandoah GC 等所有类型的垃圾收集器后,我得到了相同的运行时间。 I have tried these modifications in the JMeter file on the line我在JMeter文件中试过这些修改就行

set GC_ALGO = -XX:+UseG1GC -XX:MaxGCPauseMillis=100 -XX:G1 ReservePercent=20

But whatever the type of GC I use, I am getting the peak at the same time in my graph.但是无论我使用哪种类型的 GC,我都会在我的图表中同时获得峰值。 For example, if I am testing with 50k records, in getting the peak at 3/4 (near 33k), similarly for 5k records getting the peak exactly near 3.3k.例如,如果我使用 50k 记录进行测试,则在 3/4(接近 33k)处获得峰值,同样对于 5k 记录,峰值恰好接近 3.3k。 Have attached the sample graph here: please look at the example Graph .已在此处附上示例图:请查看示例 Graph Please let me know if there are any other ways.请让我知道是否还有其他方法。

I don't think response time peaks are connected with garbage collection, throughput might drop due to the pause while JVM is doing full GC but response times shouldn't change.我不认为响应时间峰值与垃圾收集有关,当 JVM 执行完整 GC 时,吞吐量可能会由于暂停而下降,但响应时间不应该改变。

Try monitoring JMeter's GC activity using JConsole , JVisualVM or JMeter PerfMon Plugin and pay attention to other metrics like CPU, RAM, Swap usage, etc. and correlate the response time peaks with what's going on with JMeter load generator(s)尝试使用JConsoleJVisualVMJMeter PerfMon 插件监控 JMeter 的 GC 活动,并注意其他指标,如 CPU、RAM、Swap 使用率等,并将响应时间峰值与 JMeter 负载生成器的运行情况相关联

If you won't see anything suspicious - repeat the exercise at the system under test side.如果您看不到任何可疑内容 - 在被测系统一侧重复练习。

Also make sure that you're following JMeter Best Practices and try out running JMeter in distributed mode还要确保您遵循JMeter 最佳实践并尝试在分布式模式下运行 JMeter

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

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