[Varnish] #1154: varnish serving a wrong file

Varnish varnish-bugs at varnish-cache.org
Wed Jun 13 13:03:35 CEST 2012


#1154: varnish serving a wrong file
-------------------------+--------------------------------------------------
  Reporter:  varnish302  |        Type:  defect  
    Status:  closed      |    Priority:  normal  
 Milestone:              |   Component:  varnishd
   Version:  3.0.2       |    Severity:  normal  
Resolution:  worksforme  |    Keywords:          
-------------------------+--------------------------------------------------

Comment(by varnish302):

 I don't define a vcl_hash.
 Here is my vcl code:


 {{{
 backend server1 {
         .host = "127.0.0.1";
         .port = "8000";
 }

 backend server2 {
         .host = "192.168.1.1";
         .port = "8080";
 }


 #
 # Below is a commented-out copy of the default VCL logic.  If you
 # redefine any of these subroutines, the built-in logic will be
 # appended to your code.
 sub vcl_recv {
     set req.backend = server2;

     if (req.url ~ "^/foo/" || req.url ~ "^/bar/" ||
         req.url ~ "^/test/") {
         set req.backend = server1;
     }

     if (req.restarts == 0) {
         if (req.http.x-forwarded-for) {
             set req.http.X-Forwarded-For =
                 req.http.X-Forwarded-For + ", " + client.ip;
         } else {
             set req.http.X-Forwarded-For = client.ip;
         }
     }

     if (req.request != "GET" &&
         req.request != "HEAD" &&
         req.request != "PUT" &&
         req.request != "POST" &&
         req.request != "TRACE" &&
         req.request != "OPTIONS" &&
         req.request != "DELETE") {
         /* Non-RFC2616 or CONNECT which is weird. */
         return (pipe);
     }

     if (req.request == "DELETE" || req.request == "PUT") {
         ban_url(req.url);
     }

     if (req.request != "GET" && req.request != "HEAD") {
         /* We only deal with GET and HEAD by default */
         return (pass);
     }

     if (req.http.Authorization) {
         /* Not cacheable by default */
         return (pass);
     }

     if (req.url ~ "something=") {
         return (pass);
     }

     return (lookup);
 }
 }}}


 I cannot reproduce it.  But it dit happened about every 2 weeks..

 Some of varnishstat -1 output:


 {{{
 $ bin/varnishstat -1
 client_conn           30472366         5.77 Client connections accepted
 client_drop              19367         0.00 Connection dropped, no
 sess/wrk
 client_req          1824494888       345.45 Client requests received
 cache_hit           1649166805       312.25 Cache hits
 cache_hitpass           245355         0.05 Cache hits for pass
 cache_miss           157833935        29.88 Cache misses
 backend_conn          33103046         6.27 Backend conn. success
 backend_unhealthy            0         0.00 Backend conn. not attempted
 backend_busy                 0         0.00 Backend conn. too many
 backend_fail              1108         0.00 Backend conn. failures
 backend_reuse        141864468        26.86 Backend conn. reuses
 backend_toolate          44250         0.01 Backend conn. was closed
 backend_recycle      141910016        26.87 Backend conn. recycles
 backend_retry              531         0.00 Backend conn. retry
 fetch_head                 239         0.00 Fetch head
 fetch_length         173702974        32.89 Fetch with Length
 fetch_chunked                0         0.00 Fetch chunked
 fetch_eof                    0         0.00 Fetch EOF
 fetch_bad                    0         0.00 Fetch had bad headers
 fetch_close                  0         0.00 Fetch wanted close
 fetch_oldhttp                0         0.00 Fetch pre HTTP/1.1 closed
 fetch_zero                   0         0.00 Fetch zero len
 fetch_failed              2017         0.00 Fetch failed
 fetch_1xx                    0         0.00 Fetch no body (1xx)
 fetch_204                    0         0.00 Fetch no body (204)
 fetch_304              1264520         0.24 Fetch no body (304)
 n_sess_mem                7331          .   N struct sess_mem
 n_sess                     755          .   N struct sess
 n_object                     0          .   N struct object
 n_vampireobject              0          .   N unresurrected objects
 n_objectcore               489          .   N struct objectcore
 n_objecthead               490          .   N struct objecthead
 n_waitinglist           197835          .   N struct waitinglist
 n_vbc                        9          .   N struct vbc
 n_wrk                      620          .   N worker threads
 n_wrk_create             64180         0.01 N worker threads created
 n_wrk_failed                 0         0.00 N worker threads not created
 n_wrk_max               167490         0.03 N worker threads limited
 n_wrk_lqueue                 0         0.00 work request queue length
 n_wrk_queued            865748         0.16 N queued work requests
 n_wrk_drop               60676         0.01 N dropped work requests
 n_backend                    3          .   N backends
 n_expired            157832421          .   N expired objects
 n_lru_nuked                  0          .   N LRU nuked objects
 n_lru_moved          391854312          .   N LRU moved objects
 losthdr                    722         0.00 HTTP header overflows
 n_objsendfile                0         0.00 Objects sent with sendfile
 n_objwrite          1443097030       273.23 Objects sent with write
 n_objoverflow                0         0.00 Objects overflowing workspace
 s_sess                30453209         5.77 Total Sessions
 s_req               1824494888       345.45 Total Requests
 s_pipe                      42         0.00 Total pipe
 s_pass                17136021         3.24 Total pass
 s_fetch              174965716        33.13 Total fetch
 s_hdrbytes        482009445815     91262.60 Total header bytes
 s_bodybytes       51526937574814   9755996.15 Total body bytes
 sess_closed            8840719         1.67 Session Closed
 sess_pipeline                0         0.00 Session Pipeline
 sess_readahead               0         0.00 Session Read Ahead
 sess_linger         1823095244       345.18 Session Linger
 sess_herd            789328402       149.45 Session herd
 shm_records        79140151510     14984.22 SHM records
 shm_writes          3068111358       580.91 SHM writes
 shm_flushes                401         0.00 SHM flushes due to overflow
 shm_cont               3729798         0.71 SHM MTX contention
 shm_cycles               30880         0.01 SHM cycles through buffer
 sms_nreq                362276         0.07 SMS allocator requests
 sms_nobj                     0          .   SMS outstanding allocations
 sms_nbytes                   0          .   SMS outstanding bytes
 sms_balloc           141085162          .   SMS bytes allocated
 sms_bfree            141085162          .   SMS bytes freed
 backend_req          174967552        33.13 Backend requests made
 n_vcl                       10         0.00 N vcl total
 n_vcl_avail                 10         0.00 N vcl available
 n_vcl_discard                0         0.00 N vcl discarded
 n_ban                        1          .   N total active bans
 n_ban_add               921286         0.17 N new bans added
 n_ban_retire            921285         0.17 N old bans deleted
 n_ban_obj_test       212986878        40.33 N objects tested
 n_ban_re_test        861931714       163.20 N regexps tested against
 n_ban_dups               15252         0.00 N duplicate bans removed
 hcb_nolock          1807101152       342.15 HCB Lookups without lock
 hcb_lock             139930675        26.49 HCB Lookups with lock
 hcb_insert           139930416        26.49 HCB Inserts
 esi_errors                   0         0.00 ESI parse errors (unlock)
 esi_warnings                 0         0.00 ESI parse warnings (unlock)
 accept_fail                  0         0.00 Accept failures
 client_drop_late         41309         0.01 Connection dropped late
 uptime                 5281566         1.00 Client uptime
 dir_dns_lookups              0         0.00 DNS director lookups
 dir_dns_failed               0         0.00 DNS director failed lookups
 dir_dns_hit                  0         0.00 DNS director cached lookups
 hit
 dir_dns_cache_full           0         0.00 DNS director full dnscache
 vmods                        0          .   Loaded VMODs
 n_gzip                       0         0.00 Gzip operations
 n_gunzip                     0         0.00 Gunzip operations
 LCK.sms.creat                1         0.00 Created locks
 LCK.sms.destroy              0         0.00 Destroyed locks
 LCK.sms.locks          1086828         0.21 Lock Operations
 LCK.sms.colls                0         0.00 Collisions
 LCK.smp.creat                0         0.00 Created locks
 LCK.smp.destroy              0         0.00 Destroyed locks
 LCK.smp.locks                0         0.00 Lock Operations
 LCK.smp.colls                0         0.00 Collisions
 LCK.sma.creat                1         0.00 Created locks
 LCK.sma.destroy              0         0.00 Destroyed locks
 LCK.sma.locks         64410834        12.20 Lock Operations
 LCK.sma.colls                0         0.00 Collisions
 LCK.smf.creat                1         0.00 Created locks
 LCK.smf.destroy              0         0.00 Destroyed locks
 LCK.smf.locks        631804935       119.62 Lock Operations
 LCK.smf.colls                0         0.00 Collisions
 LCK.hsl.creat                0         0.00 Created locks
 LCK.hsl.destroy              0         0.00 Destroyed locks
 LCK.hsl.locks                0         0.00 Lock Operations
 LCK.hsl.colls                0         0.00 Collisions
 LCK.hcb.creat                1         0.00 Created locks
 LCK.hcb.destroy              0         0.00 Destroyed locks
 LCK.hcb.locks        279890437        52.99 Lock Operations
 LCK.hcb.colls                0         0.00 Collisions
 LCK.hcl.creat                0         0.00 Created locks
 LCK.hcl.destroy              0         0.00 Destroyed locks
 LCK.hcl.locks                0         0.00 Lock Operations
 LCK.hcl.colls                0         0.00 Collisions
 LCK.vcl.creat                1         0.00 Created locks
 LCK.vcl.destroy              0         0.00 Destroyed locks
 LCK.vcl.locks           346396         0.07 Lock Operations
 LCK.vcl.colls                0         0.00 Collisions
 LCK.stat.creat               1         0.00 Created locks
 LCK.stat.destroy             0         0.00 Destroyed locks
 LCK.stat.locks            7331         0.00 Lock Operations
 LCK.stat.colls               0         0.00 Collisions
 LCK.sessmem.creat            1         0.00 Created locks
 LCK.sessmem.destroy            0         0.00 Destroyed locks
 LCK.sessmem.locks       30493212         5.77 Lock Operations
 LCK.sessmem.colls              0         0.00 Collisions
 LCK.wstat.creat                1         0.00 Created locks
 LCK.wstat.destroy              0         0.00 Destroyed locks
 LCK.wstat.locks         35308008         6.69 Lock Operations
 LCK.wstat.colls                0         0.00 Collisions
 LCK.herder.creat               1         0.00 Created locks
 LCK.herder.destroy             0         0.00 Destroyed locks
 LCK.herder.locks          602156         0.11 Lock Operations
 LCK.herder.colls               0         0.00 Collisions
 LCK.wq.creat                   2         0.00 Created locks
 LCK.wq.destroy                 0         0.00 Destroyed locks
 LCK.wq.locks          1606680653       304.21 Lock Operations
 LCK.wq.colls                   0         0.00 Collisions
 LCK.objhdr.creat       139973344        26.50 Created locks
 LCK.objhdr.destroy     139976181        26.50 Destroyed locks
 LCK.objhdr.locks      7567485873      1432.81 Lock Operations
 LCK.objhdr.colls               0         0.00 Collisions
 LCK.exp.creat                  1         0.00 Created locks
 LCK.exp.destroy                0         0.00 Destroyed locks
 LCK.exp.locks          321015003        60.78 Lock Operations
 LCK.exp.colls                  0         0.00 Collisions
 LCK.lru.creat                  2         0.00 Created locks
 LCK.lru.destroy                0         0.00 Destroyed locks
 LCK.lru.locks          157903711        29.90 Lock Operations
 LCK.lru.colls                  0         0.00 Collisions
 LCK.cli.creat                  1         0.00 Created locks
 LCK.cli.destroy                0         0.00 Destroyed locks
 LCK.cli.locks            1181598         0.22 Lock Operations
 LCK.cli.colls                  0         0.00 Collisions
 LCK.ban.creat                  1         0.00 Created locks
 LCK.ban.destroy                0         0.00 Destroyed locks
 LCK.ban.locks          535706998       101.43 Lock Operations
 LCK.ban.colls                  0         0.00 Collisions
 LCK.vbp.creat                  1         0.00 Created locks
 LCK.vbp.destroy                0         0.00 Destroyed locks
 LCK.vbp.locks                  0         0.00 Lock Operations
 LCK.vbp.colls                  0         0.00 Collisions
 LCK.vbe.creat                  1         0.00 Created locks
 LCK.vbe.destroy                0         0.00 Destroyed locks
 LCK.vbe.locks           66209337        12.54 Lock Operations
 LCK.vbe.colls                  0         0.00 Collisions
 LCK.backend.creat              3         0.00 Created locks
 LCK.backend.destroy            0         0.00 Destroyed locks
 LCK.backend.locks      422599991        80.01 Lock Operations
 LCK.backend.colls              0         0.00 Collisions
 SMF.s0.c_req           315902467        59.81 Allocator requests
 SMF.s0.c_fail                  0         0.00 Allocator failures
 SMF.s0.c_bytes      4249229312000    804539.66 Bytes allocated
 SMF.s0.c_freed      4249229312000    804539.66 Bytes freed
 SMF.s0.g_alloc                 0          .   Allocations outstanding
 SMF.s0.g_bytes                 0          .   Bytes outstanding
 SMF.s0.g_space        3221225472          .   Bytes available
 SMF.s0.g_smf                   4          .   N struct smf
 SMF.s0.g_smf_frag              0          .   N small free smf
 SMF.s0.g_smf_large             4          .   N large free smf
 SMA.Transient.c_req     32205377         6.10 Allocator requests
 SMA.Transient.c_fail           0         0.00 Allocator failures
 SMA.Transient.c_bytes 1397823198198    264660.75 Bytes allocated
 SMA.Transient.c_freed 1397819398409    264660.03 Bytes freed
 SMA.Transient.g_alloc            2          .   Allocations outstanding
 SMA.Transient.g_bytes      3799789          .   Bytes outstanding
 SMA.Transient.g_space            0          .   Bytes available
 ..
 }}}

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




More information about the varnish-bugs mailing list