I have a servlet-based application wherein I measure the time taken to complete each request to that servlet. I already compute simple statistics like the mean and maximum; I'd like to produce some more sophisticated analysis however, and to do so I believe I need to properly model these response times.

Surely, I say, response times follow some well-known distribution, and there are good reasons to believe that distribution is the right model. However, I don't know what this distribution ought to be.

Log-normal and Gamma come to mind, and you can make either one sort of fit real response time data. Does anyone have a view on what distribution the response times ought to follow?

up vote 13 down vote accepted

The Log-Normal distribution is the one I find best at describing latencies of server response times across all the user base over a period of time.

You may see some examples at the aptly-named site lognormal.com whose in the business of measuring site latency distribution over time and more. I have no affiliation with the site except for being a happy user. Here's how the distribution looks like; response (e.g web page load) time vs number of responses:

a log-normal distribution

Note that in this chart, the load-time (X-axis) scale is linear. If you switch the x-axis to a log-scale, the shape of the distribution would look more normal (bell-shaped) on the right side of the peak.

  • This PDF really looks like a Fréchet in my opinion. – usεr11852 May 28 '15 at 18:56

Example Graph. See article for more depth.

My research shows the best model is determined by a few things: 1) Are you concerned with the body, the tail, or both? If not "both", modeling a filtered dataset can be more useful. 2) Do you want a very simple or a very accurate one? i.e. how many parameters?

If the answer to 1 was "both" and 2 was "simple", Pareto seems to work best. Otherwise, if 1 was "body" and 2 was "simple" - choose a filtered erlang model. If 1 was "both" and 2 was "accurate", you probably want a gaussian mixture model on your data in the log domain - effectively a lognormal fit.

I've been researching this lately, and I didn't find the topic to be covered well enough on the public internet, so I just wrote a blog post detailing my research into this topic.

  • 1
    Thanks for the chart. Based on the (roughly) tri-modal distribution you have, I believe this is not a simple (single server) setting. You seem to have some middleware or back-ends that are slower. These cause the overall response to slow down when the user-facing server waits for potentially-cached) back-end subsystems to respond. Also it isn't clear what the X and Y axes represent. Have you inverted the load-time (originally X-axis) and counts (originally Y-axis)? – arielf Oct 29 '15 at 0:27
  • Thanks for your feedback! The source dataset was more akin to pings than web service requests, but I would guess the trimodal distribution is due to mainly two things: 1) The main bi-modal asymmetry is due to two network paths, while 2) the long-tail 3rd component is due to tcp error recovery scenarios. That's just a guess though... my main focus was on the empirical utility of various models, not the process and theory. I'm not entirely sure what you are asking about the inverted axis, though... do you have an example plot? – Andrew Charneski Oct 29 '15 at 5:11
  • Also, my apologies on the sloppy graphic. The x-axis is microseconds, and the y axis is probability density. (Yeah, I know... sorry... see the notebook for reproducible science.) – Andrew Charneski Oct 29 '15 at 5:18

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.