Hey, I'm writing a program to test the performance of apache (we had a similar problem with lighttpd), and I keep running into a problem with persistent connections. We make single request, like:
GET fileName HTTP/1.1
And we get a response back. We then make another, similar, request on the same connection, and we get a response back, but there's a huge delay in-between sending our request and getting the response for the second request.
To give you an idea of the times:
request 1: sent at 0 ms, received at 1 ms
request 2: sent at 1 ms, received at 41 ms
request 3: sent at 41 ms, received at 81 ms
request 4: sent at 81 ms, received at 121 ms
And we see this 40 ms delay all throughout. Clearly it doesn't take that long to deliver the file, so we're not sure what gives...why the delay? Just FYI, we're testing on a high-bandwidth, low-latency network.
Also, we do HTTP pipelining, and when we send all these requests at once on one connection, we get the response back extremely quick--we're just not sure why the 40 ms or so delay between requests on the same persistent connection and not on the pipelined connection. There's almost no lag between the machine, so we're not sure what's up.
Not sure if it's a setting we can change, something we're doing wrong, or something apache's just doing slowly.