[Varnish] #254:

Varnish varnish-bugs at projects.linpro.no
Thu Jun 19 09:12:29 CEST 2008


#254: 
--------------------+-------------------------------------------------------
 Reporter:  sky     |       Owner:  des  
     Type:  defect  |      Status:  new  
 Priority:  normal  |   Milestone:       
Component:  build   |     Version:  trunk
 Severity:  normal  |    Keywords:       
--------------------+-------------------------------------------------------
 Jun 19 06:29:59 varnish2 varnishd: Child (3635) said <<Assert error in
 exp_timer(), cache_expire.c line 300:>>
 Jun 19 06:29:59 varnish2 varnishd: Child (3635) said <<
 Condition(oe2->timer_when >= oe->timer_when) not true.>>

 I am trying to figure out what is going on, but it is only when I start
 putting load on the servers that they actually just go boom.

 Any advice on how to proceed?


 {{{
 backend default {
         .host = "xxxxx";
         .port = "80";
 }

 backend wikia {
         # should be changed to a 10.8 address
         .host = "xxxxx";
         .port = "80";
 }

 backend armchair {
         .host = "xxxxxx";
         .port = "80";
 }

 backend gamewikis {
         .host = "xxxxx";
         .port = "80";
 }


 # 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.

 ## Called when a client request is received
 #
 sub vcl_recv {


         if (req.http.Accept-Encoding) {
                 if (req.http.Accept-Encoding ~ "gzip") {
                     set req.http.Accept-Encoding = "gzip";
                 } elsif (req.http.Accept-Encoding ~ "deflate") {
                     set req.http.Accept-Encoding = "deflate";
                 } else {
                     # unkown algorithm
                     remove req.http.Accept-Encoding;
                 }
         }


         if (req.request == "PURGE") {
                 # acl check needed
                 purge_hash(req.http.purgeurl);
                 error 200 "Purged";
         }


         if (req.url == "/lvscheck.html") {
                 error 200 "varnish is okay";
         }

         if(req.http.host ~ "^(nwn|oblivion|meta|war|gw)$") {
                 set req.backend = wikia;
         } elsif(req.http.host ~ "(gw.wikia.com|gamewikis.org)$") {
                 set req.backend = gamewikis;
         } elsif(req.http.host ~ "^siwiki.sportsillustrated.cnn.com$") {
                 set req.backend = armchair;
         } elsif(req.http.host ~ "^thirdturn.armchairgm.com$") {
                 set req.backend = wikia;
         } elsif(req.http.host ~ "armchairgm.com$") {
                 set req.backend = armchair;
         } else {
                 set req.backend = wikia;
         }

         if (req.url ~ "/__utm.gif") {
                 set req.url = "/__utm.gif";
         }


         # might as well make them all look like /
         if (req.http.host == "216.151.156.11") {
                 set req.http.origurl = req.url;
         #       set req.url = "/";
         }


         if (req.request != "GET" && req.request != "HEAD" && req.request
 != "PURGE") {
                 pipe;
         }
         if (req.http.Expect) {
                 pipe;
         }
         if (req.http.Authenticate || req.http.Cookie ~
 "(UserID|_session)") {
                 pass;
         }
         lookup;
 }


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

 #
 ## Called when entering pipe mode
 #
 #sub vcl_pipe {
 #       pipe;
 #}
 #
 ## Called when entering pass mode
 #
 #sub vcl_pass {
 #       pass;
 #}
 #
 ## Called when entering an object into the cache
 #


 #
 ## Called when the requested object was found in the cache
 #
 sub vcl_hit {


         if (!obj.cacheable) {
                 pass;
         }
         if (obj.http.X-Cache == "MISS") {
                 set obj.http.X-Cache = "HIT";
         }
         deliver;
 }
 #
 ## Called when the requested object was not found in the cache
 #
 sub vcl_miss {



         if (req.request == "PURGE") {
                 error 404 "Not in cache.";
         }
         fetch;
 }
 #
 ## Called when the requested object has been retrieved from the
 ## backend, or the request to the backend has failed
 #
 sub vcl_fetch {
         if (!obj.valid) {
                 error;
         }
         set obj.http.X-Cache = "MISS";
         remove obj.http.Vary;

         # this is the old wow ip, so issue redirect
         if (req.http.host == "216.151.156.11") {
                 set obj.http.origurl = req.http.origurl;
         }

         if (!obj.cacheable) {
                 set obj.http.X-Cacheable = "NO:Not-Cacheable";
                 pass;
         }
         if (obj.http.Cache-Control ~ "private") {
                 if(req.http.Cookie ~"(UserID|_session)") {
                         set obj.http.X-Cacheable = "NO:Got Session";
                 } else {
                         set obj.http.X-Cacheable = "NO:Cache-
 Control=private";
                 }
                 pass;
         }
         if (obj.http.Set-Cookie ~ "(UserID|_session)") {
                 set obj.http.X-Cacheable = "NO:Set-Cookie";
                 pass;
         }

         set obj.http.X-Cacheable = "YES";
         set obj.http.X-Cache = "MISS";
         set obj.grace = 10s;
         insert;
 }

 sub vcl_prefetch {
         pass;
 }

 #
 #
 ## Called before a cached object is delivered to the client
 #
 sub vcl_deliver {

         set resp.http.X-Served-By = "varnish2";

         # this is the old wow ip, so issue redirect
         if (resp.http.origurl) {
                 set resp.http.Location = regsub(resp.http.origurl, "^" ,
 "http://www.wowwiki.com");
                 set resp.status = 301;
                 set resp.response = "Moved Permanently";
                 deliver;
         }


     set resp.http.Cache-Control = "private, s-maxage=0, max-age=0, must-
 revalidate";
     remove resp.http.X-Vary-Options;
     remove resp.http.X-Powered-By;
     remove resp.http.X-Time-CPU-Time;
     remove resp.http.X-Request-Id;
     deliver;
 }

 }}}

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


More information about the varnish-bugs mailing list