[Varnish] #379: The varnish have no response most of the time , is it the bug?

Varnish varnish-bugs at projects.linpro.no
Mon Nov 17 17:59:38 CET 2008


#379: The varnish have no response  most of the time ,is it the bug?
-------------------+--------------------------------------------------------
 Reporter:  Ajian  |        Type:  defect
   Status:  new    |    Priority:  normal
Milestone:         |   Component:  build 
  Version:  trunk  |    Severity:  normal
 Keywords:         |  
-------------------+--------------------------------------------------------
 Now I am using the varnish 2.0.2 ,but I found a question that is not be
 resolved . I don't know it is my fault or the varnish's bug.

 OS: CentOS 5.2 64X
 MEM:16G
 varnish : 2.0.2

 Description:
    I have two domains ,They are the WWW and the BBS . The WWW domain have
 the index.html ,another have not . Open the WWW , is very fast . Open the
 BBS ,always the varnish have no response ,if add the index.php after the
 BBS domain ,the web display at once.Additional,I have test the web of the
 BBS ,not use the varnish ,the web running is well .

 Problem:
    1、I don't why the no response appears always.
    2、How to debug the varnish and check the error log of the varnish ,not
 the access log.

 The fellowing is the configuration and the varnishstat


 {{{
 backend www {
     .host = "50.28.29.20";
     .port = "80";
 }
 backend bbs {
     .host = "50.28.29.21";
     .port = "80";
 }

 acl purge {
     "localhost";
     "127.0.0.1";
     "10.10.10.0"/24;
     "50.28.29.0"/26;
 }
 sub vcl_recv {
     if (req.request == "PURGE") {
         if (!client.ip ~ purge) {
             error 405 "Not allowed.";
         }
         elseif(req.url ~ "\.(php|cgi)($|\?)") {
             pass;
         }
         else {
             lookup;
         }
     }

     if(req.http.host ~"^(bbs).mobile.com.cn") {
          set req.backend = bbs;
     } elseif(req.http.host ~"^(www.|img.|www2.|ad.|soft.)?mobile.com.cn")
 {
          set req.backend = www;
     }else{
          error 200 "Domain is not exist";
     }

     if (req.request != "GET" && req.request != "HEAD")
     {
         pipe;
     }
     elseif (req.url ~ "\.(php|cgi)($|\?)")
     {
         pass;
     }
     elseif (req.http.Authenticate || req.http.Authorization) {
         pass;
     }
     lookup;
 }

 sub vcl_hit
 {
     if (req.request == "PURGE") {
         set obj.ttl = 0s;
         error 200 "Purged.";
     }

     if (!obj.cacheable)
     {
         pass;
     }

     if (obj.http.Vary)
     {
         unset obj.http.Vary;
     }
 }

 sub vcl_miss
 {
     if (req.request == "PURGE") {
         error 404 "Not in cache.";
     }
 }

 sub vcl_hash
 {
     set req.hash += req.url;
     set req.hash += req.http.host;
     #set req.hash += req.http.cookie;
     hash;
 }

 sub vcl_fetch
 {
     if (!obj.cacheable)
     {
         pass;
     }

     if (obj.http.Pragma ~ "no-cache" || obj.http.Cache-Control ~ "no-
 cache" || obj.http.Cache-Control ~ "private") {
         pass;
     }

     if (!obj.http.ETag && !obj.http.Last-Modified)
     {
         pass;
     }

     if (obj.http.Set-Cookie)
     {
         pass;
     }

     set obj.ttl = 28800s;
 }

 }}}

 The varnishstat
 {{{
 Hitrate ratio:       10       28       28
 Hitrate avg:     0.8181   0.8142   0.8142

      1969722        46.00        39.47 Client connections accepted
      4866403        64.00        97.52 Client requests received
      3542647        53.00        70.99 Cache hits
        90073         1.00         1.80 Cache hits for pass
       714443         5.00        14.32 Cache misses
      1300258        10.00        26.06 Backend connections success
            0         0.00         0.00 Backend connections not attempted
            0         0.00         0.00 Backend connections too many
         3888         0.00         0.08 Backend connections failures
       387852         3.00         7.77 Backend connections reuses
       443628         8.00         8.89 Backend connections recycles
            0         0.00         0.00 Backend connections unused
         7075          .            .   N struct srcaddr
         6100          .            .   N active struct srcaddr
        19735          .            .   N struct sess_mem
        19718          .            .   N struct sess
       291944          .            .   N struct object
       285351          .            .   N struct objecthead
       618316          .            .   N struct smf
        39508          .            .   N small free smf
         4718          .            .   N large free smf
           89          .            .   N struct vbe_conn
          322          .            .   N struct bereq
          121          .            .   N worker threads
         2556         0.00         0.05 N worker threads created
            0         0.00         0.00 N worker threads not created
            0         0.00         0.00 N worker threads limited
            0         0.00         0.00 N queued work requests
        18334         0.00         0.37 N overflowed work requests
            0         0.00         0.00 N dropped work requests
            9          .            .   N backends

 }}}

-- 
Ticket URL: <http://varnish.projects.linpro.no/ticket/379>
Varnish <http://varnish.projects.linpro.no/>
The Varnish HTTP Accelerator


More information about the varnish-bugs mailing list