In my last post I detailed using Jmeter to set up a simple Web Application test. Jmeter can bring a lot of users to the table with just a single workstation and you can affect some real pressure on your system. But there are times when the resources of the server simply exceed the amount of traffic you send its way. For example:
You will still be using the Jmeter GUI just like in my previous post, but in this case it's going to act more like a Field General manipulating his privates. Or perhaps I should say directing his staff. Anyway, the GUI takes your test plan and farms it out to N number of Jmeter servers listening on various IP addresses. That sounds complicated but it's actually pretty easy. Remember our Jmeter .bat files in the "BIN" directory of our Jmeter install? There's one in there called "Jmeter-server.bat". To start a Jmeter server all you need to do is start that batch file on each workstation or client you intend to use and Viola! your Jmeter server is running.
Next, gather the IPs of the workstations running Jmeter server and add them to your jmeter.properties file (also found in the BIN directory). Look for the "remote_hosts" property and add your IP addresses as a comma separated list like so:
remote_hosts=127.0.0.1,10.2.18.1,10.2.18.42Notice I added the 127.0.0.1 address as well. This is because my "master" workstation where I configured my test plan is also going to be running a server and I want to connect to it as well.
Finally, restart your GUI to pick up the IP addresses. Make sure the server is running on all the workstations that are specified (by IP) in the list. To see the list go to Run menu and hover over "Remote Start" - you should see the list of remote hosts you configured in step 2.
To start your test using all servers simply select "remote start all" and the GUI will send the test plan to all servers simultaneously, multiplying your test by the number of workstations you have configured. If you happen to be watching the command line of your "jmeter-server.bat" command, you will see information in the standard console output regarding the starting and stopping of the test.
The GUI (the master workstation) collects all the data from all of the servers and aggregates it for you automatically.
As you might expect there are a couple of nuances to this process:
Tomorrow I will share a script by CF Guru Wil Genovese that can use Jmeter to crawl your site and test each page and link. It uses some advanced Jmeter hocus pocus like regular expressions and looping - pretty nifty stuff.