Delay between requests

It is uncommon for a visitor to load one single page and then leave your site, it is probably very uncommon that a user loads one page and then immediately loads another page, with no time to read the content on the first page. Humans need a little while to process information on a page before moving on. It is often called “think time” or “page view time”. To simulate this behavor of real, human visitors, we have to add delays to our load script:

 http.request_batch({
     {"GET", "http://test.loadimpact.com/news.php"},
 }) 
 client.sleep(
    math.random(1, 15) -- Sleeps between 1 and 15 seconds before continuing
 )
 http.request_batch({
     {"GET", "http://test.loadimpact.com/news.php"},
 }) 

You can identify and adjust sleeps in our load testing script. The default sleep (if you auto-generate the script) would look like this:

client.sleep(math.random(20000, 40000), 1000) -- Sleep between 20 to 40 seconds

The first two values indicate the interval of unit time to sleep for, while the last value sets the unit of time to use, where the default value is 1 second.

If you’re recording a script, we will take the sleep time from the length of time you paused on the page before clicking on the next link. If you feel that this is not an accurate picture of your actual , feel free to edit it later.

See also:

 

Feedback and Knowledge Base