rbill
rbill

Reputation: 11

JMeter behaviour on response time while garbage collecting

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

Upvotes: 1

Views: 1063

Answers (1)

Dmitri T
Dmitri T

Reputation: 168052

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:

enter image description here

and after switching to the CMS GC he got the following:

enter image description here

So make sure to:

  1. Follow recommendations from 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure article
  2. 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
  3. 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

Upvotes: 1

Related Questions