[Varnish] #405: Varnish problem with purge requests

Varnish varnish-bugs at projects.linpro.no
Fri Dec 12 12:07:17 CET 2008


#405: Varnish problem with purge requests
----------------------+-----------------------------------------------------
 Reporter:  anders    |       Owner:  phk
     Type:  defect    |      Status:  new
 Priority:  high      |   Milestone:     
Component:  varnishd  |     Version:  2.0
 Severity:  normal    |    Keywords:     
----------------------+-----------------------------------------------------
 I use Varnish 2.0.2, in FreeBSD/amd64 7.0-RELEASE.

 I use a VCL like the one in
 http://varnish.projects.linpro.no/wiki/VCLExamplePurging. It works fine.
 But after a hickup on one of my webservers (where it starts to send 404
 and bogus content), my Varnish servers (often all of them) switch from
 handling PURGE, to forwarding the PURGE requests to my web servers.

 Ngrep dump:

 {{{
 T 32.32.32.241:49548 -> 32.32.33.219:80 [AP]
 PURGE / HTTP/1.0
 Host: foo.bar.no
 Connection: close


 ####
 T 32.32.33.239:80 -> 32.32.33.219:52540 [AS]
 .......
 PmPF....
 ##
 T 32.32.33.219:52540 -> 32.32.33.239:80 [AP]
 PURGE / HTTP/1.0.
 Host: foo.bar.no.
 X-Varnish: 1526176926.
 X-Forwarded-For: 32.32.32.241.
 .

 #
 T 32.32.33.239:80 -> 32.32.33.219:52540 [AFP]
 HTTP/1.0 501 Not Supported.
 .
 <html><body><h2>Not Supported Method</h2><p> </p></body></html>..t: */*.
 Referer: http://www.bt.no/.
 Accept-Language: no.
 UA-CPU: x86.
 Accept-Encoding: gzip, deflate.
 User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
 2.0.50727; .NET CLR 1.1.4322
 ###
 T 32.32.33.219:80 -> 32.32.32.241:49548 [AP]
 HTTP/1.0 501 Not Supported.
 X-Varnish-IP: 32.32.33.219.
 Cache-Control: max-age=1800.
 Date: Fri, 12 Dec 2008 10:40:10 GMT.
 X-Varnish: 1526176926.
 Age: 0.
 Via: 1.1 varnish.
 Connection: close.
 }}}

 In that dump, the IPs are:

 32.32.32.241 Administrative server that actually sends the PURGE request

 32.32.33.219 Cache server (VIP on a load balancer)

 32.32.33.239 Web server (VIP on a load balancer)

 How can this be? Varnish is supposed to handle PURGE here, Apache is not
 supposed to get those requests at all.

 Varnishlog from the same event:

 {{{
     8 ReqStart     c 32.32.32.241 49548 1526176926
     8 RxRequest    c PURGE
     8 RxURL        c /
     8 RxProtocol   c HTTP/1.0
     8 RxHeader     c Host: foo.bar.no
     8 RxHeader     c Connection: close
     8 VCL_call     c recv
     8 VCL_acl      c MATCH aipurge 32.32.32.241/32
     8 VCL_return   c lookup
     8 VCL_call     c hash
     8 VCL_return   c hash
     8 HitPass      c 1525573757
     8 VCL_call     c pass
     8 VCL_return   c pass
     9 BackendClose - opnew
     9 BackendOpen  b opnew 32.32.33.219 52540 32.32.33.239 80
     8 Backend      c 9 opnew opnew
     9 TxRequest    b PURGE
     9 TxURL        b /
     9 TxProtocol   b HTTP/1.0
     9 TxHeader     b Host: foo.bar.no
     9 TxHeader     b X-Varnish: 1526176926
     9 TxHeader     b X-Forwarded-For: 32.32.32.241
     9 RxProtocol   b HTTP/1.0
     9 RxStatus     b 501
     9 RxResponse   b Not Supported
     8 ObjProtocol  c HTTP/1.0
     8 ObjStatus    c 501
     8 ObjResponse  c Not Supported
     9 BackendReuse b opnew
     8 TTL          c 1526176926 RFC 1800 1229078410 0 0 0 0
     8 VCL_call     c fetch
     8 TTL          c 1526176926 VCL 1800 1229078410
     8 VCL_return   c pass
     8 Length       c 0
     8 VCL_call     c deliver
     8 VCL_return   c deliver
     8 TxProtocol   c HTTP/1.0
     8 TxStatus     c 501
     8 TxResponse   c Not Supported
     8 TxHeader     c X-Varnish-IP: 32.32.33.219
     8 TxHeader     c Cache-Control: max-age=1800
     8 TxHeader     c Date: Fri, 12 Dec 2008 10:40:10 GMT
     8 TxHeader     c X-Varnish: 1526176926
     8 TxHeader     c Age: 0
     8 TxHeader     c Via: 1.1 varnish
     8 TxHeader     c Connection: close
     8 ReqEnd       c 1526176926 1229078410.067601204 1229078410.068562508
 0.000068188 0.000908375 0.000052929
     8 SessionClose c Connection: close
     8 StatSess     c 32.32.32.241 49548 0 1 1 0 1 1 192 0
 }}}

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


More information about the varnish-bugs mailing list