mishkin
mishkin

Reputation: 6242

how to spread work between multiple requests

I need to test throughput running 8 JDBC requests by 4 threads.

For example, let's say I have 8 jdbc queries q1, q2... q8

If I specify 1 thread total, queries would be run one by one in that order q1,q2,q3..q8 and I get total time to run all 8 queries.

If I specify 4 threads, I need all 8 queries executed only 1 time but spread work across threads:

q1 thread 1
q2 thread 2
q3 thread 3
q4 thread 4
q5 thread 1 (or any thread who would be done processing its first query really)
q6 thread 2 (or any other)
q7 
q8
all done

I tried interleave with loop controller but I get either half of them executed, or 8 queries executed multiple times.

Basically, I need to measure throughput depending on the number of threads - how fast I can complete all 8 queries with 2,4,8 number of threads.

Hope it makes sense

Upvotes: 0

Views: 49

Answers (1)

Dmitri T
Dmitri T

Reputation: 168147

The easiest option is putting your queries into a CSV file and using CSV Data Set Config to parameterize the JDBC Request sampler:

enter image description here

Once done you should be able to define as many threads as you want under Thread Group

enter image description here

So all the threads which you define will take the next value from the CSV file and run the respective query:

enter image description here

Upvotes: 1

Related Questions