Raghav
Raghav

Reputation: 151

Jmeter threads stuck during the load test

I am running a load test using JMeter with 200 users for approx 1hr. So, the observation is that a few threads are stuck even after the duration completes. Like 60 out of 200 get stuck. When I take the thread dump and observe that these threads are in a Runnable state. Any suggestions for resolving this issue? And I do not see anything meaningful from the JMeter log file.

Upvotes: 0

Views: 3765

Answers (3)

sbos61
sbos61

Reputation: 564

You may want to check your HTTP timeouts.

I usually set Connect Timeout to 5000 milliseconds, and Response Time out to 30000. Your values may vary for your specific environment/ application. In this way, if things go bad on the server under test, all requests terminate within the timeout (with errors).

You have also to consider that, if you are retrieving an HTML page with all its embedded objects, and the web server is stuck, you need to wait for multiple timeouts to expire before the operation terminate.

Upvotes: 0

Dmitri T
Dmitri T

Reputation: 168147

This is not a normal behaviour for a JMeter test, most probably it indicates that either JMeter engine is overloaded (not properly configured for high loads) or the machine where JMeter is running is overloaded (i.e. lacks RAM and starts intensive swapping)

  1. Make sure to follow JMeter Best Practices (run your test in non-GUI mode, remove all Listeners and test elements you don't need, increase JMeter heap size, etc.)
  2. Make sure to monitor the essential health metrics of the machine where JMeter is running (CPU, RAM, Network and Disk IO, Swap file usage). You can use JMeter PerfMon Plugin for this if you don't have any better software
  3. It might be the case you'll have to switch to Distributed Testing, 200 virtual users doesn't seem to be a "high" load to me, but it depends on what exactly these users are doing, if they're uploading/downloading large files it may be sufficient to cause the problems

Going forward consider adding the thread dump and jmeter log file contents to your question as it doesn't contain any clues so we can only come up with "blind shot" answers

Upvotes: 1

Masud Jahan
Masud Jahan

Reputation: 2978

You will find an unexpected increase in response time at the end of that time.

This is because of the thread's insufficient ramp-down time. Some of your threads were active and made requests to the server and didn't receive the response but threads were closed forcefully. If your JMeter test is stopped forcefully, all the active threads will be closed immediately. So the requests generated by those threads will get higher response time.

You can use Ultimate Thread Group for graceful shutdown time(ramp-down time) of threads just like the ramp-up time.

Here is an example setting:

enter image description here

Upvotes: 0

Related Questions