0
votes

The default behavior of JMeter definitely seems to just duplicate your test plan across servers. So, if the test plan has 10 "threads", running it against X servers will yield 10x threads.

Is there any way to make this more intelligent? For example, maybe I only want one copy of some HTTP thread running even though I have 5 servers to distribute a more intense load.

Another example...I want to ensure that my sampler uses unique IDs for each thread, but my service requires that the usernames be pre-provisioned so they can't be preprovisioned...I haven't been able to find a straightforward way to coordinate this (statelessly) across my distributed servers.

A "simple" implementation might be if JMeter had distributed testing aware variables built in so the client sent the server something like ServerID and ServerCount so that the test plan could use the numeric serverId as a prefix or mod by the server count. Alternatively, JMeter could have an option to shard thread_num so that if you say 10,000 threads and have 10 servers, it will run 1,000 threads on each server with thread_num never being duplicated across the distributed test for a given sampler (Example, skip thread_num if thread_num % serverCount != serverId).

Any thoughts on the best way to accomplish this?

1
I believe Jenkins will give you that flexibility. By design JMeter slaves are dumb nodes and they only know to replicate the script and execute the script.Nachiket Kate

1 Answers

0
votes

One approach to have distributed test-aware variable is to start each jmeter-server with different variable value:

bin/jmeter-server -Jvariable=valuehost1

And then in your test script just use:

${__P(variable)}