[Varnish] #951: varnish stalls connections on high traffic to non-cacheable urls

Varnish varnish-bugs at varnish-cache.org
Fri Jul 1 23:20:40 CEST 2011


#951: varnish stalls connections on high traffic to non-cacheable urls
---------------------------------+------------------------------------------
 Reporter:  tttt                 |        Type:  defect  
   Status:  new                  |    Priority:  normal  
Milestone:  Varnish 2.1 release  |   Component:  varnishd
  Version:  2.1.5                |    Severity:  major   
 Keywords:                       |  
---------------------------------+------------------------------------------

Comment(by kb):

 I believe this is actually expected behavior.  Varnish wants to download
 these objects and store them in cache before letting subsequent requests
 "in" to the object.  This is common in two situations I've seen:

 1. Your web server takes longer to respond than your .first_byte_timeout,
 and thus never makes it into Varnish.  All requests pile up on a linear
 line of requests that each take .first_byte_timeout seconds.

 2. Your web server is taking a "long time" to reply, and the object is not
 cacheable.  A similar serialization takes place, orthogonal to
 .first_byte_timeout.

 Varnish doesn't know whether the object is cacheable or not until it
 receives the response, and I don't know of a way to tell Varnish whether
 an object is cacheable /before/ the request happens.

 My only suggestion for a "fix" would be to add something like this to your
 vcl_recv():

 if ( req.url ~ "/your/very/slow/URLs" ) {
     set req.hash_ignore_busy = true;
 }

 That should allow incoming requests to open new requests to your backend
 (removing the serialization).

 But honestly, if you have painfully slow, non-cacheable resources, it
 might be better to route those directly to the backend(s) rather than
 clutter up Varnish.  Or perhaps separate those requests into different
 servers along functional lines.

 FWIW,

 Ken

-- 
Ticket URL: <http://www.varnish-cache.org/trac/ticket/951#comment:2>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list