Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable thread groups externally in JMeter

I am using JMETER with my Powershell script and my JMX (XML for Jmeter) file is already created and I Launch the JMETER in Non-GUI mode and pass the JMX to it.

But previously it was working but I added some more Thread Groups with multiple HTTP requests now there may be some heap size issue.

So I thought of disabling some thread groups from the command line using my Automation script(Powershell).

How to disable some thread groups in the JMX file through the command line?

like image 850
Rohit Luthra Avatar asked Dec 11 '22 14:12

Rohit Luthra


1 Answers

  1. Define number of threads (virtual users) for Thread Groups using __P() function like:

    • ${__P(group1threads,)} - for 1st thread group
    • ${__P(group2threads,)} - for 2nd thread group
    • etc.

      Thread Group via Property

  2. If you want to disable a certain Thread Group - just set "Number of Threads" to 0 via -J command-line argument like:

    jmeter -Jgroup1threads=0 -Jgroup2threads=50 etc
    

However a better idea would be increasing Heap size as JMeter comes with quite low value (512 Mb) by default which is fine for tests development and debugging, but definitely not enough for the real load test. In order to do it locate the following line in JMeter startup script:

HEAP=-Xms512m -Xmx512m

And update the values to be something like 80% of your total available physical RAM. JMeter restart will be required to pick the new Heap size values up. For more information on JMeter tuning refer to 9 Easy Solutions for a JMeter Load Test “Out of Memory” Failure guide.

like image 193
Dmitri T Avatar answered Dec 25 '22 09:12

Dmitri T