Correlating web request latency with temporal density I'm trying to analyze a series of request on our web server. I have the latency of each request with the associated timestamp that the request was made.
What I suspect is that higher latencies occur when requests are clustered in time, but I'm not sure about what the timescale even is. It could be requests made within a 5s, 1s, or even 1ms window.
I put together a rudimentary python script to use a sliding window to calculate the request density and compare that with the current latency but even as I tweaked the window size between a few milliseconds and several seconds I couldn't see any obvious correlation.
Crucially, I think the problem is that I don't know what the time period of the latency/request density is, and therefore how big to make my window.
Am I barking up the wrong tree? Or does my method sound roughly correct, suggesting there is no correlation?
Some people have asked for sample data, so I've uploaded some here
 A: Your methodology sounds OK, but it is entirely possible that no matter the size of your window, you may still find that there is no signal produced by the higher amount of requests. Some backgound:
Web servers often rely on a pool of backend available process threads that run very far under the surface of the application (to the point of not 100% transparent in logs). Often, web servers are so efficient and well-tuned that they rarely max their out under normal circumstances. This is a good thing - running a server with sub-optimal resources would be like driving your car on empty and only ever refueling to get to the next gas station! And as such, it's likely that you'll never be able to find any really strong evidence to prove a point by parsing your logs in this way...
What may be more effective is to use a service like Locust to load-test your app and then gather statistics this way. Loadtest is another available on NPM. These kinds of applications can help you find the numerical limits of your application in a sandboxed environment, which can be really nice for finding out where your run out of gas, keeping with the car analogy.
