alpheus@xxxxxx wrote:
Hi,
I have a general question to the internal behaviour of squid as a reverse
proxy:
Imagine there is a webserver which uses squid as a reverse proxy to serve
the content.
If a user request a site A for the first time, squid has to request A from
the server.
No let's image that this server needs several seconds to generate the site
A, e.g. 5 seconds.
My question: what happens if a second user (and many more) requests the same
site A in this 5 second time slot?
Does squid request site A again from the server or does it know that there
is already a pending request?
So, it is of interest for me if in such a long time slot a lot of identical
requests would be sent to the webserver or if squid is maintaining a list
that already a request is running and subsequent calls are put into a queue.
Hope, my question is clear!?
Thx in advance,
alp
Yes, when a new request comes in for an object that is 'in flight', the
second client will join in on the transfer. One interesting effect is
that if there is a speed difference between clients, and the object is
large enough then the faster client will be forced to transfer at the
same speed as the slower client. This is due to squid having a limit to
the read-ahead difference between the client and origin server.
The read-ahead amount is tunable in squid3.
I found this out the hard way while fighting a very frustrating and
intermittent failure at our site :-)
--
Robert Borkowski