When executing a load test in JMeter, one of first elements you’ll need to configure is the Thread Group.
Within the thread, three of the elements you need to configure are:
Number of Threads (users) - The maximum number of users you want to run.
Ramp-Up Period (in seconds) - Defines how long it takes for JMeter to ramp up from zero users to X number of threads.
Loop Count - Defines how many times you want each user to run your script.
For example, if you define Number of Threads to 600 (users), Ramp Up to 300 (seconds) and Loop Count to Forever, your test will start off with zero users and will add 2 users every second, so after 300 seconds you’ll have a total of 600 users running your script.
Since loop count is forever the users will run the script over and over until the test is “over”.
If you’re running JMeter locally the test will never be over. If you’re running in BlazeMeter, the default test session time is 1 hour which means BlazeMeter will shut down the test after 1 hour.
If you were to have chosen Loop Count to 200 then each virtual user will run your script 200 times and then stop.
This is all fairly straight forward when running locally on a single server. When running a JMeter test in the cloud with BlazeMeter, you have even more control.
BlazeMeter provides 3 options for defining the number of load servers and users per server:
Manual (JMeter Engines tab with Override un-checked)
Preparing to Load Test
First, we need to record our test plan in JMeter. Everyone has their own plan, but obviously and super important, the script needs to be correct (aka error free).
You can also use our Chrome Extension to record a JMeter script right from your browser.
Test Creation and Configuration
Let’s create a test. You need to be logged in (if you don't have an account, sign up, no cc required for the free account).
Specify the test name, upload your .jmx file, select the JMeter version and a load origin location for your test.
1. Fully Automatic Load Test
Upload the test script created in JMeter (note, BlazeMeter will automatically fill in the data under Thread Group).
When defining the number of users, the system will automatically configure the following in order to handle the required load*(Please note that allocated capacity is dependent on the tier you are subscribed to):
Number of load engines (1 to 500)
Number of threads (users) per load engine (1 to 1000)
If you select, for example 4,000 concurrent users, BlazeMeter will use:
10 load servers and 400 users per load server if your account supports 10 load servers
5 load servers and 800 users per server if your account supports 5 load servers
For this test we've chosen a single JMeter console and 100 threads.
Now, let’s get this test running!
Load test results
The system has automatically selected the proper configuration. If you have a look at the graph, you’ll see that the number of users that are loading the tested web site gradually grows and approaches the mark of 100 users.
JMeter is only used to record the test script, the rest of the settings are configured in BlazeMeter and the system will choose the right configuration for you.
2. Semi-Automatic Load Test
Semi-Automatic mode is almost the same as Fully-Automatic mode, but it does have one crucial difference: You can select both the number of load engines and the number of threads per load engine. For this test I’ve chosen 5 JMeter Engines and 20 Threads Per Engine.
Load test results: This graph looks very similar to the prior one (Fully-Automatic).
In both cases we used 100 users. In Fully Automatic mode, BlazeMeter chose to use a single server and in Semi Automatic mode we told BlazeMeter to use 5 JMeter Engines and 20 threads per engine.
This option is often used when your JMeter script is resource intensive and you want to make sure the load servers are not being over-burdened. A rule of thumb is to make sure your load engine is not constantly using more than 75% CPU or Memory (small spikes are usually OK). You can see your server load in the report monitoring tab.
Another common scenario is when you are using a load balancer and need to make sure you are distributing your load across multiple IPs. Each load server is a dedicated machine with it’s own IP address so running with 10 servers means traffic will originate from 10 different IPs.
As a rule of thumb you should aim for the number of load servers being three times the number of web servers. So if you have three web servers behind your load balancer you should use 9 load servers.
3. Manual Load Test
While using this method, all settings, except for the number of engines, will be used from the values in your JMeter script. This is usually used when you have more than one thread group, when you have different configurations for each thread group or if you are using a non default thread group (e.g "ultimate thread group").
To use the manual method, uncheck theOverride basic JMeter thread group parameters option, otherwise BlazeMeter will automatically override every thread group in the script with those values.
For the first variant of testing we’ve selected the following configuration:
We set it to 5 JMeter Engines
For the second configuration, we set 100 Threads in JMeter.
Then slide the handy little slider to JMeter Console only.
The first configuration (5 server and 20 threads per server), test results:
The second configuration (1 server and 100 threads per server), test results: