varnish performance problem

Jianing Hu jianing at gmail.com
Tue Jun 24 20:10:54 CEST 2008


Sorry if this is a duplicate post. I sent the following yesterday but
didn't see it appearing in the mailing list.

We are testing varnish as a potential replacement for our legacy squid
setup on a dual core 8GB RAM server. We've noticed that varnish
performance would suddenly deteriorate after running for a while. The
server load is at around 0.2 before all of a sudden it climbs to over
20 and keeps rising. Top shows varnish is using more than 90% of
memory when this happens.

We know that there's much large varnish instances running out there,
so it must be something with our setup. Does anyone know where we
should be looking at? I've attached the command we use to run varnish
and the vcl file below. I can provide more information if that helps.

varnishd -a localhost:80 -T localhost:6082 -f default.vcl -u varnish
-g varnish -s file,/mnt/varnish/varnish_storage.bin,20G

backend default {
   set backend.host = "x.x.x.x";
   set backend.port = "80";
}
sub vcl_recv {
   if (req.request != "GET" && req.request != "HEAD") {
       pipe;
   }
   if (req.http.Expect) {
       pipe;
   }
   if (req.http.Authenticate) {
       pass;
   }
   lookup;
}
sub vcl_pipe {
   pipe;
}
sub vcl_pass {
   pass;
}
sub vcl_hash {
   set req.hash += req.url;
   set req.hash += req.http.host;
   hash;
}
sub vcl_hit {
   if (!obj.cacheable) {
       pass;
   }
   deliver;
}
sub vcl_miss {
   fetch;
}
sub vcl_fetch {
   if (!obj.valid) {
       error;
   }
   if (!obj.cacheable) {
       pass;
   }
   if (obj.http.Set-Cookie) {
       pass;
   }
   insert;
}
sub vcl_deliver {
   deliver;
}
sub vcl_timeout {
   discard;
}
sub vcl_discard {
   discard;
}



More information about the varnish-misc mailing list