Multiple backends for same host with varying timeouts

Simon Males sime at sime.net.au
Thu Apr 21 07:54:27 CEST 2011


Hello,

I'm interested to hear what is considered best practice in terms of
setting different timeouts for different URLs.

Example: /reports take a long while to generate and much longer then
the default first/between_bytes_timeouts run time parameters. In my
(simple) mind, a second reporting backend can be specified to the same
host with a custom timeout parameter. A simple vcl example below:

backend default {
    .host = "127.0.0.1";
    .port = "8080";
}

backend reports {
    .host = "127.0.0.1";
    .port = "8080";
    .first_byte_timeout = 300s;
}

sub vcl_recv {
  if (req.url ~ "^/reports") {
    set req.backend = reports;
  }
}

On the right track?

Out of interest does varnish consider these two backends completely separate?

-- 
Simon Males




More information about the varnish-misc mailing list