You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loadtest generates requests with a Uniform Distribution arrival pattern, meaning there is the same fixed interval between each new request sent to the server. That isn't very realistic.
In practice, we can simulate a Poisson process by generating inter-arrival times that are Exponential Random numbers with mean = 1/R where R is the request rate we want to send. There are libraries which can help you generate Exponential Random numbers.
So if we want a realistic arrival process with an average rate of 10 req/sec, we should generate a sequence of inter arrival times by generating exponential random numbers each with mean 1/10 = 0.1. On average, this will still give us 10 request per second, but instead of them all having the exact same 0.1 second gap between each one, they will be randomly distributed with periods of no load and then a burst of requests with short gaps.
Todo:
Learn about poisson arrival process
Learn how to generate exponentially distributed random numbers. You can do this in a simple javascript test script, not the real loadtest code. Your script should take a target RPS value and then determine a list of interval times as exponential random values
Use your script to produce 10000 exponential random values and then make a histogram of them. Discuss with @twood02 about how this will produce a different type of load than the normal fixed interval
Modify the loadtest code so that it will use exponential random values for the sleep period between each request instead of a fixed value
Measure the performance of a website with the original loadtest versus this modified version. When the RPS value is the same, which version will have better performance?
Make it so that loadtest can be configured to use either a fixed rate or a Poisson rate as a command line argument or configuration file variable
The text was updated successfully, but these errors were encountered:
Loadtest generates requests with a Uniform Distribution arrival pattern, meaning there is the same fixed interval between each new request sent to the server. That isn't very realistic.
Many natural phenomenon, whether it be people going to the grocery store or meteors flying through the sky, follow what is known as a Poisson Arrival pattern. Here is an article describing what this means:
https://towardsdatascience.com/the-poisson-distribution-and-poisson-process-explained-4e2cb17d459
In practice, we can simulate a Poisson process by generating inter-arrival times that are Exponential Random numbers with
mean = 1/R
whereR
is the request rate we want to send. There are libraries which can help you generate Exponential Random numbers.So if we want a realistic arrival process with an average rate of 10 req/sec, we should generate a sequence of inter arrival times by generating exponential random numbers each with mean 1/10 = 0.1. On average, this will still give us 10 request per second, but instead of them all having the exact same 0.1 second gap between each one, they will be randomly distributed with periods of no load and then a burst of requests with short gaps.
Todo:
The text was updated successfully, but these errors were encountered: