News

10 min reading time
Running load tests with Jmeter on BlazeMeter

One of the most important things to know while launching web applications is under which amount of load it will crash. Every server has its limits. Not knowing what those limits are, can cause a lot of damage to your company’s image.

Blazemeter

Before launching a new version of your project, it is recommended to run some load tests on the application. The results of these tests will tell you how much simultaneous visitors your application can handle in its current infrastructure and which server resource is most likely to crash first.

By knowing how much simultaneous users your application can handle, you can alter the configuration of the servers to make sure the infrastructure can handle the predefined number of visitors. You can add alerts to specific thresholds so that you have the time to scale up when your application needs additional resources. By being aware of the limits of your application, you can adjust to an increase of traffic.

With the blocks above you can build up the test scenario’s you determined before. An example can look like this:

As you can see, in this testing scenario we will load the Google homepage and check if the response contains the word “Search”. We will also store a fictional CSRF token from the form in a variable by using a XPath extractor. By adding a cache and cookie manager, we are simulating an actual browser. When the test scenario contains a second request, it will serve the stored images directly from cache instead of loading them from the remote server.

performance1

One of the services that provide distributed visitors for load testing is BlazeMeter. You can create a new load test on BlazeMeter and upload the JMeter configuration file. Next, you can specify on which location you want to run the test. Possible options are AWS, Google Compute or Microsoft Azure. Next you can specify how many simultaneous users you want to simulate. You can spread them across multiple threads and multiple physical engines. Note that the number of users is multiplied by the amount of threads in your JMeter project. Finally, you can choose how long you want to run the test or how many iterations that should be executed. The configuration can look like this:

performance2

After running the load tests, you get a broad variety of results. For the test specified above, the result can look like this:

Off course, these results are not very accurate: Google won’t notice 10 additional users on their system. However, it gives you an idea of what the load results look like. Besides these statistics, it is possible to generate your own statistics with the monitoring tools you like to use. For example: There is a New Relic plugin available to link the data from the load test with the data from New relic.

performance3