search by tags

for the user

adventures into the land of the command line

jmeter, but remotely

so i wanted to do some loadtesting, but with many many concurrent requests and one server just wasn’t cutting it. so we set up ten servers, but then we had the hurdle of “how do we start the test using all of them at the same time?” and “how do we get an aggregated report?”

well…

jmeter server

on each node you want to use as a server to generate load, you need to start the jmeter-server application

./${JMETER_HOME}/bin/jmeter-server

this application will start the rmi process and the jmeter-server process. now that it is running, it will await and accept instructions from a jmeter client

jmeter client

you can execute tests via a client running on your local machine. you need to configure your client with the address(es) of the remote jmeter servers, and ensure you have network connectivity with them. then, on the client, you can start a test like this:

./${JMETER_HOME}/bin/jmeter \
-n \
-t /path/to/testPlans/myGroovyTest.jmx \
-l '/path/to/reports/myGroovyTest.txt' \
-JenvConfig '/path/to/environments/myGroovyEnvironmentConfig.csv' \
-JUserThreadCount 2 \
-JRampUpTime 10 \
-JRampUpSteps 2 \
-JHoldTargetRateTime 1 \
-JLoopCount 1 \
-JwebSocketConnectionTimeInMilliSec 500 \
-JwebSocketResponseBufferTimeInMilliSec 10000 \
-JMessageDelaySeconds 5 \
-e \
-p '/path/to/properties/jmeter.properties' \
-r

The -r option is important, it tells jmeter to try to run remotely, and will look in the jmeter.properties file for the address(es) of your remote hosts

#---------------------------------------------------------------------------
# Remote hosts and RMI configuration
#---------------------------------------------------------------------------

# Remote Hosts - comma delimited
#remote_hosts=127.0.0.1
remote_hosts=123.45.67.89,1.1.1.1,my.groovy.server-1,my.groovy.server-2

You can also specify these addresses as a command line option, rather than specifying the jmeter.properties file, but I didn’t do that.

results

the results .txt file will be put into the directory you specify next to the -l option in the client start command. it will contain aggregated results from all the remote servers that the test was run on. to convert these results into a html dashboard to more convenient viewing, you can run a command like this:

mkdir /path/to/reports/someFolder
./${JMETER_HOME}/bin/jmeter -g /path/to/reports/myGroovyTest.txt -o /path/to/reports/someFolder