2
votes

How can I control the number of threads running on each jmeter slave machines.
i.e. if I have 300 threads in total and 2 slave machines, I want the load to be distributed evenly on both slave machine - 150 threads to run on slave machine A & 150 Threads to run on slave machine B.

I have tried running in non gui mode also with the below commands

Jmeter  -n -t TESTING.jmx  -R 10.27.30.93 –J 6

to make it run on a specific slave server for 6 threads, but its not working.
It invokes the same number of threads saved in the test plan

1

1 Answers

2
votes
  1. Set "Number of Threads" for Thread Group(s) using __P() function like

    ${__P(threads,)}
    

Thread number as property

  1. Amend your JMeter startup script invocation as follows:

    jmeter -n -t TESTING.jmx -R 10.27.30.93 –Gthreads=6
    

    As per JMeter command-line help:

    -G, --globalproperty <argument>=<value>
        Define Global properties (sent to servers)
        e.g. -Gport=123
         or -Gglobal.properties
    
  2. Another option is configure desired number of threads for each remote engine in user.properties file (lives under /bin folder of JMeter installation).

    See Apache JMeter Properties Customization Guide for more information on setting and/or overriding JMeter Properties.