Delay when fetching a page without Content-Length

Adam Sjøgren asjo at koldfront.dk
Sat Mar 31 20:35:59 CEST 2007


On Sat, 31 Mar 2007 18:18:36 +0000, Poul-Henning wrote:

> Hmm, you're running into a bug in the pass implementation which
> have since been fixed.

Ah, great.

(Where can I read about meaning of these? I have scanned through
vcl(7), varnishd(1) and the FAQ).

> Try using pipe mode for authenticated requests instead, by putting
> this in your vcl_recv function:

> 	if (req.http.Authenticate || req.http.Cookie) {
> 		pipe;
> 	}

Hm. I think I have done something wrong, because that made it worse:

 $ time wget -S http://www.koldfront.dk/stats/
 --20:28:26--  http://www.koldfront.dk/stats/
            => `index.html'
 Resolving www.koldfront.dk... 192.168.1.111
 Connecting to www.koldfront.dk|192.168.1.111|:80... connected.
 HTTP request sent, awaiting response... No data received.
 Retrying.

 --20:28:27--  http://www.koldfront.dk/stats/
   (try: 2) => `index.html'
 Connecting to www.koldfront.dk|192.168.1.111|:80... connected.
 HTTP request sent, awaiting response... No data received.
 Retrying.
 [...]

 $ varnishlog
     0 CLI            Rd ping
     0 CLI            Wr 0 200 PONG 1175365706
     0 WorkThread     0xb4391830 start
    13 SessionOpen  c 192.168.1.160 40834
     0 Debug          "INCOMPLETE AT: cnt_fetch(332)"
     0 CLI            Rd vcl.load boot /tmp/vcl.XXZGJC2j
     0 CLI            Wr 0 200 Loaded "/tmp/vcl.XXZGJC2j" as "boot"

     0 CLI            Rd vcl.use boot
     0 CLI            Wr 0 200 
     0 CLI            Rd start
     0 CLI            Wr 0 200 
     0 WorkThread     0xb4391830 start
    13 SessionOpen  c 192.168.1.160 40835
     0 Debug          "INCOMPLETE AT: cnt_fetch(332)"
     0 CLI            Rd vcl.load boot /tmp/vcl.XXZGJC2j
     0 CLI            Wr 0 200 Loaded "/tmp/vcl.XXZGJC2j" as "boot"

The modified vcl.conf I was using looks like this:

 # This is a basic vcl.conf file for varnish.
 # Modifying this file should be where you store your modifications to
 # varnish. Settnigs here will override defaults.

 backend default {
         set backend.host = "127.0.0.1";
         set backend.port = "8080";       
 }

 sub vcl_recv {
         if (req.http.authorization) {
 #               pass;
                 pipe;
         }

         if (req.request == "POST") {
                 pipe;
         }

         # force lookup even when cookies are present
         #if (req.request == "GET" && req.http.cookie) {
         #        lookup;
         #}
 }

 sub vcl_fetch {
         if (resp.http.www-authenticate) {
 #               pass;
                 pipe;
         }

         # force minimum ttl of 180 seconds
         if (obj.ttl < 180s) {
                 set obj.ttl = 180s;
         }
 }


I will check out from svn and give that a spin...


  Best regards,

    Adam

-- 
 "Från och med nu så är 'så snart som möjligt' 53             Adam Sjøgren
  timmar!"                                               asjo at koldfront.dk




More information about the varnish-misc mailing list