If we want to put load on a website using 5000 users from a single machine.
With limited cpu and ram contribution will restrict us from putting load of 5000 users on the website as our ram and cpu has limited capacity. So it is not recommend to put a load of 5000 users from a single machine as it might display wrong results.
So distribution mode comes into play. So we will connect to 5 more machines and give 1000 users to each of those 5 machine .Jmeter Gui will be our machine and Slave 1 ,slave 2 are those machines and all these slave machines will hit the server at the same time.
Configuration.
Go to slave machine.
- Open jmeter folder.Go to bin folder.
- Open jmeter.poperties file and search for ssl. By default it is set to false.Set it to true and remove the hash from the beginning on line that is un-comment it.
- Then click the jmeter-server bat file in the bin folder and run it.It will show us the ip address on this slave machine. Note it down
Then go to master machine.
- Go to jmeter folder. Set the same properties i.e open jmeter.properties file search ssl uncomment it and set it to true.
- Then search for remote_hosts and instead of the address 127.0.0.1 etc to the op address we just got from slave machine.That means now on our master machine now when we run a jmeter test instead of our local machine it will redirect the traffic to the slave machine ip address now.
- Restart jmeter
After all these conf changes.
- Then on our master machine ,open jmeter and to run the test instead of clicking the play button as we normally do,click run on the top and from drop down choose remote start and then choose the slave ip where we want to run it.
- Then go to slave machine and open the cmd for jmeter-server bat which we had already started before to check the ip address and we will see our test running there.(Please note if the test didnt start running here for 2,3 mins just hit enter on this cmd it might start running then.
Then we can go the master machine once the cmd of slave machine says test is finished and go to view results tree and check results.So test ran on slave machine but we see results on master machine.
Few things about master slave machines.
- Both should run same verison of jmeter.
- Both should be connected to same subnetwork I,e same wifi etc.
- Both the machines should be as similar as possible i.e same OS ,same directories etc.