Load Testing · Junior · Question 53 of 75

Why add sleep(1) at the end of a k6 iteration?

export default function () {
  http.get('https://test.k6.io');
  sleep(1);
}
Show the answer

Correct answer: To add think time so each VU doesn't fire requests nonstop

Explanation

Without pauses, each VU hammers the server as fast as responses come back. That's fine for some tests but doesn't model real users.

Further reading

Problem with a question

Load Testing · Junior · question 53

Test yourself

Take the Load Testing · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz