Thursday, June 21, 2012

Dog-pile Effect : Squid versus Apache Traffic Server

When using a forward web proxy cache, it is possible to encounter the dog-pile effect. When a new page suddenly becomes very popular or when a popular page expires from the cache, the proxy will receive a large number of requests for the page at the same time.  There are two ways to handle this:
  1. Since the page is not already in the cache, the proxy forwards each request to the origin server, OR
  2. The proxy forwards the first request to the origin server, and queues the others till the response to the first request fills the cache.
Option 1 leads to the dog-pile effect.  The origin server is rapidly bombarded with a large number of requests.  This is usually problematic.  The server slows down and the requests keep piling up.

Option 2 is called connection collapsing or collapsed forwarding.  Squid supports this feature -  However, Apache Traffic Server currently does not support it (Thanks to the super-responsive folks on the traffic-server IRC channel for confirming this).  It used to be supported , but was removed since the implementation was buggy :

No comments: