0

I have a test plan as following:

Test Plan

My Thread Group contains three requests, one POST and two GETs that should be executed one after another. POST Suggestions returns a token that is used by GET Progress that is executed until it's completed, when it's completed, I'm ready to GET Suggestions.

The problem is that the server is configured to handle only 5 threads at a time, if I generate 6 threads, it processes 5 and the sixth simply dies (Stop Thread) as server answers with 503 Service Unavailable. I want to find such a solution that would leave the sixth, seventh and so on POST requests in some queue until one of the first five threads is finished i.e. there's a place in the pool.

2 Answers2

1

What you're trying to do is wrong, as this means there is an issue in the tested application (which JMeter revealed) and the right way is to fix this issue so that server can handle more request instead of trying to find a way to make JMeter workaround this problem.

Client of the tested application will face the issue you found and not try a workaround.

But if this is voluntary:

enter image description here

enter image description here

enter image description here

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
  • This server limit was created artificially because the queries we're sending to other systems are too heavy. It's no problem to try again several times if server answers with 503 in real life application that will use the API we wrote, but it seems impossible in jmeter :( – Vera Olsson Jan 14 '13 at 15:11
  • It is possible, see http://stackoverflow.com/questions/14066818/need-http-request-not-to-respond-until-it-finds-a-specific-text-in-jmeter/14066890#14066890 – UBIK LOAD PACK Jan 14 '13 at 17:37
  • I already use this approach to GET Progress. I couldn't implement the same logic for POST request without having to run the threads that are done, but I'm still trying… – Vera Olsson Jan 15 '13 at 10:13
  • Sorry this is not clear for me=> "without having to run the threads that are done". – UBIK LOAD PACK Jan 15 '13 at 10:59
  • I use CSV Data Config to configure id for each thread in the thread group. When I start the group, JMeter creates, say, 6 threads each of which uses a unique id in the url. When the first 5 POSTs (that continue to fetch progress and suggestions that take time) are done JMeter tries to run the 6th POST which doesn't have place and returns 503. I want to keep trying to run exactly the thread(s) that returned 503 from the point where it makes a POST request. – Vera Olsson Jan 15 '13 at 11:23
  • Thank you that you got me thinking about this case from another perspective. I also solved the problem with a while loop which checked if the request returned 503 (set it to 503 in User Defined Variables by default) and it has to loop for `POST Suggestions` until all threads are finished. It turned out it does exactly what I need. – Vera Olsson Jan 15 '13 at 12:12
0

Final solution

I solved the problem with the Test Plan above.