What’s the best way to calculate how many bots I need for a load test?
When you create a test scenario in Loadster, the bots number you specify is the total number of concurrent users Loadster should simulate at any given time during the test.
This means that after each bot finishes an iteration of your script, another bot takes its place and starts that same script again. These bots come and go as long as there’s time remaining in your test. Therefore the concurrent number of bots at any time is kept constant, but the total number of unique bots iterations is always increasing.
Loadster uses the iterations counter to show how many total unique bot iterations have run your script. If your script involves making a purchase, for example, the iterations count will indicate how many total purchases have been made in the test.
Estimating Bots From Iteration Count
Let’s say you want to simulate 100,000 iterations of your script (user journeys, transactions, etc) in a 1-hour period, but you don’t know how many concurrent bots that will require.
A basic formula for estimating this is:
ConcurrentUsers = TotalIterations / (EntireTestDuration / ScriptDuration)
Let’s say each iteration of your script normally takes 67 seconds to run.
If we plug in 100000 for the total number of iterations we desire, 3600 for the number of seconds in a full hour (the test duration), and 67 as the duration of a single iteration of our script, we get:
1861 = 100000 / (3600 / 67)
This tells us that 1861 concurrent bots is a good starting point, if we want to generate approximately 100000 of this script in an hour.
Trial and Error
This estimate is merely a starting point, though! A bit of trial and error is still required.
When your site is under load, it’s likely it will get slower. This would cause each iteration of your script to take longer than the 67 seconds it takes when the site is not under load. Once each iteration starts taking longer, the same number of bots will be able to run fewer iterations in a given time period.
That’s why we recommend a bit of trial and error in addition to estimation.
If you’re preparing to run an extended test, run a few shorter tests first, to make sure you’ve got the iteration rate dialed in and are running with the correct number of bots to produce the desired outcome.