Search code examples
jmeterjmeter-pluginsjmeter-5.0

Run multiple jmeter tasks on a machine, how to specify a port to stop jmeter test


I executed 3 jmeter tasks on an ubuntu server. Now I need to stop one of them (requires report generation). I execute the stoptest.sh script in the bin directory and find that only the first jmeter task started can be stopped. This is the test task with port 4445, which can be seen through the jmeter log at startup. The ports of the other 2 tasks are 4446 and 4447, so how do I specify the port to stop the test? For example, I want to stop the test task with port 4447, but keep the other 2 tests to continue, what should I do? Of course, I will not use the kill -9 jmeter-pid method, because this is a forced exit from the jmeter process, and no test report will be generated


Solution

    1. You can provide the JMeter's shutdown client port as the parameter like:

      ./stoptest.sh 4446 
      

      enter image description here

    2. It's better to use shutdown.sh as this script "asks" JMeter to stop its threads while stoptest.sh "kills" the threads which may result in tons of errors related to threads abnormal termination. The JMeter engine shutdown port can be specified exactly the same way

    3. It is possible to generate the report at any time even during the test execution, if you set jmeter.save.saveservice.autoflush property to true JMeter will save each Sampler execution result into the .jtl file as soon as it's ready