You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Alexander Boitsev <a....@gmail.com> on 2020/04/03 15:14:11 UTC
Run single thread in the distributed mode
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
Re: Run single thread in the distributed mode
Posted by Deepak Shetty <sh...@gmail.com>.
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 <a....@gmail.com>
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
>
Re: Run single thread in the distributed mode
Posted by "glinius@live.com" <gl...@live.com>.
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: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org