1
votes

I want to run below scenario with Jmeter, is it possible?. Please help on this

Scenario

I have 20 queries, These queries should run concurrently with 5 threads and each thread should complete all 20 queries.

But at any given point time all threads should run different queries (.i.e one thread query should not match with other query).

2

2 Answers

1
votes

This is a great reason for using Critical Section Controller

The Critical Section Controller ensures that its children elements (samplers/controllers, etc.) will be executed by only one thread as a named lock will be taken before executing children of controller.

Insert Critical Section Controller as a parent for each query with different lock name and by that each query will be execute once at a time

0
votes

Depending on where do you keep these "queries" the options are in:

  1. Use i.e. JSR223 PreProcessor to remove the "current" query from the list prior to executing the query with the given thread and JSR223 PostProcessor to add the query back to the list after the execution is done. Make sure to store the queries globally using JMeter Properties.
  2. Use HTTP Simple Table server for the same given the same approach: remove the query from the list before starting and adding it back after request finishes. You can install HTTP Simple Table server using JMeter Plugins Manager.