iperezmel78
iperezmel78

Reputation: 445

Jmeter 5 - loop controller concurrency

I have a load test plan in JMeter as follows:

Test Plan
|- Thread Group
   |- BeanShell Sampler (CSV Read)
   |- Loop Controller
      |- Counter
      |- HTTP Request${counter_value}
   |- View Results Tree

Http requests are made depending on the csv lines read and that's the reason for the loop controller. When all the requests are made and go to the View Results Tree information I see that requests are made sequentially (HTTP Request1 first then HTTP Request2 and so on). So, is there a way to do concurrent requests without using any external plugins or am I wrong about how concurrency is done when using a loop controller?

Upvotes: 0

Views: 1638

Answers (3)

Dmitri T
Dmitri T

Reputation: 167992

You cannot achieve concurrency by using Loop Controller, it can only be used for repeating its children.

The actual concurrency can be achieved by adding more threads (virtual users) on Thread Group level

enter image description here

Given above setup JMeter will start concurrent 10 users which will be executing requests for 60 seconds.

I would also recommend reconsidering using Beanshell Sampler, since JMeter 3.1 it's recommended to switch to JSR223 Test Elements and Groovy language. Moreover JMeter provides CSV Data Set Config and/or CSVRead() function which can be used for reading data from the external CSV files.

Upvotes: 0

sunny_teo
sunny_teo

Reputation: 1999

You can use Synchronizing Timer to achieve concurrency.

Check the below links for more information.

How to Use the Parallel Controller in JMeter:- https://www.blazemeter.com/blog/how-to-use-the-parallel-controller-in-jmeter/

How to Load Test AJAX/XHR Enabled Sites With JMeter:-

https://blazemeter.com/blog/how-load-test-ajaxxhr-enabled-sites-jmeter/

Hope this helps.

Upvotes: 0

Amol Chavan
Amol Chavan

Reputation: 3970

Loop counter wont create concurrent requests. From your question, it seems that you want change number of threads dynamically. Here are the related questions which may give you some perspective :-

  1. Increase number of threads in JMeter during execution

  2. Change the thread count of test plan in JMeter, at run time

Upvotes: 1

Related Questions