Run single thread in the distributed mode

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Run single thread in the distributed mode

Alexander Boitsev
Hello,

We have a need to run one scenario in a single-thread mode (mandatory)
during a load test. The test is being executed in a distributed mode.
Is there any other workaround than to run a separate JMeter with a
single thread? If we add this scenario to the main load test the number
of single threads always equals the number of JMeter servers we use,
i.e. it is not a single-thread process anymore.

Thank you,
Alexander
Reply | Threaded
Open this post in threaded view
|

Re: Run single thread in the distributed mode

shettyd
Hi
That is the JMeter behavior. You have different ways to get this to work
a. Designate one JVM server to be the "single thread" server that runs the
test by a property that is only on that server , wrap the test step  in an
IF
b. Designate  one server to be the "single thread" server that runs the
test by passing in a command line parameter that indicates which server
needs to run it , wrap the test step in an IF that checks if this is the
matching server
(-GsingleThreadServer=ValueThatIsSpecificToOneServerLikeIPAddress)
c. Sophisticated distributed semaphore (E.g. a DB) - Every server tries to
obtain a lock - The one that succeeds gets to run the test , the ones that
fail , ignore it and carry on (e.g. insert the same row into a temp table
with a primary key defined , there can only be 1 winner)
But it might not be worth it

regards
deepak

On Fri, Apr 3, 2020 at 8:14 AM Alexander Boitsev <[hidden email]>
wrote:

> Hello,
>
> We have a need to run one scenario in a single-thread mode (mandatory)
> during a load test. The test is being executed in a distributed mode.
> Is there any other workaround than to run a separate JMeter with a
> single thread? If we add this scenario to the main load test the number
> of single threads always equals the number of JMeter servers we use,
> i.e. it is not a single-thread process anymore.
>
> Thank you,
> Alexander
>
Reply | Threaded
Open this post in threaded view
|

Re: Run single thread in the distributed mode

glinius@live.com
In reply to this post by Alexander Boitsev
You can go for the  If Controller
<https://www.blazemeter.com/blog/six-tips-for-jmeter-if-controller-usage/>  
and use the following  __jexl3() function
<https://jmeter.apache.org/usermanual/functions.html#__jexl3>   as the
condition like:


> ${__jexl3("${__machineIP()}" == "10.20.30.40",)}

This way If Controller's children will be executed only at the slave machine
having IP address "10.20.30.40".

If your test assumes multiple threads (virtual users) and iterations on
Thread Group
<https://jmeter.apache.org/usermanual/component_reference.html#Thread_Group>  
level you can add more clauses to the If Controller like:


> ${__jexl3("${__machineIP()}" == "10.20.30.40" && "${__threadNum}" == 1 &&
> "${__jm__Thread Group__idx}" == "0",)}





--
Sent from: http://www.jmeter-archive.org/JMeter-User-f512775.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]