英文:
JMeter behaviour on response time while garbage collecting
问题
我目前正在尝试理解JMeter的垃圾回收如何影响报告的响应时间。
我可以通过下面的图表来表示我的思路:
从JMeter到example.org的HTTP请求 --> JMeter在响应之前执行GC --> GC结束 --> 从example.org接收响应
JMeter如何处理这个情况?GC时间是否会被添加到响应时间中?在收到响应后,GC时间是否会从响应时间中减去?
如果GC时间被添加,这意味着G1GC算法会频繁发生,但暂停时间很短,会影响90百分位响应时间。但ConcurrentMarkSweep会造成较少但更长的暂停,不会真正影响90百分位(对我来说更可接受)。
非常感谢!保重!
Romain
英文:
I'am currently trying to understand how JMeter's Garbage collection affects the response time reported.
I can represent my though by the graph below
HTTP Request from JMeter to example.org --> JMeter perform a GC before the response --> End of GC --> Receiving response from example.org
How does JMeter handle this ? Does the GC time is added to the response time ? GC time is subtracted to the response time after the response is received ?
If the GC time is added, it means that G1GC Algorithm which occur frequently but with short pauses will affect 90 percentile response time. But ConcurrentMarkSweep will make fewer but longer pauses without really affecting 90 percentile (which is more acceptable for me).
Thanks a lot
Take care
Romain
答案1
得分: 1
根据JMeter词汇表:
>经过时间。 JMeter从发送请求之前到收到最后响应之后测量经过的时间。
因此,如果在JVM卡住的同时发生了主要的GC,JMeter将无法收到响应,因此在GC中花费的时间将被添加到总体经过时间中。
您可以查看使用JMeter进行并发、高吞吐量性能测试的文章,其中有人的吞吐量出现了波动:
在切换到CMS GC之后,他得到了以下结果:
因此,请确保:
- 遵循来自解决JMeter负载测试“内存不足”失败的9种简单方法文章的建议。
- 使用例如JVisualVM监视堆使用情况,JMeter应该使用30%到80%的可用堆大小,这样垃圾收集的次数应该较少。
- 如果您无法产生稳定的负载模式,这意味着单个负载发生器不足,您将不得不采用分布式测试。
英文:
As per JMeter Glossary
>Elapsed time. JMeter measures the elapsed time from just before sending the request to just after the last response has been received.
So if a major GC will happen while JVM is stuck JMeter won't receive the response hence the time spent in GC will be added to the overall elapsed time.
You can look at Concurrent, High Throughput Performance Testing with JMeter article where the guy was getting spikes in the throughput like:
and after switching to the CMS GC he got the following:
So make sure to:
- Follow recommendations from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article
- Monitor heap usage using i.e. JVisualVM, JMeter should consume from 30% to 80% of available heap size, this way the number of garbage collections should be less
- If you won't be able to produce a steady load pattern it means that the single load generator is not enough and you will have to go for Distributed Testing
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论