Hi Per,<br><br>Thank-you for your help? With a minor change, your configuration worked extremely well - is there a wiki for Varnish that I can post it? I've written out a full, working, configuration for a two-host director below which might be of use in the VCL examples page.<br>
<br>Another question - is there an easy way to monitor the average pageload time that varnish experiences when contacting the backends?<br><br>Many thanks for your help,<br><br>Alex<br><br>--<br><br><span style="font-family: courier new,monospace;">backend wwxx {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> .host = "xx.xx.xx.xx";</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> .port = "80";</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   .probe = {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   .url = "/";</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   .timeout = 34 ms;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   .interval = 1s;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   .window = 10;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   .threshold = 8;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">backend wwxx {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> .host = "xx.xx.xx.xx";</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> .port = "80";</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   .probe = {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   .url = "/";</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   .timeout = 34 ms;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   .interval = 1s;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">   .window = 10;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">   .threshold = 8;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">director director random {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    .backend = wwxx;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    .weight = 100;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">  {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">    .backend = wwxx;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    .weight = 100;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  }</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">}</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">sub vcl_recv {</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    if (req.http.host ~ "^(www.)?<a href="http://mysite.com">mysite.com</a>$") {</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">        set req.backend = director;</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">    }</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">}</span><br><br><br><br>On Thu, Dec 11, 2008 at 6:03 PM, Per Buer <<a href="mailto:perbu@linpro.no">perbu@linpro.no</a>> wrote:<br>
> Hi Alex,<br>><br>> Alex Davies wrote:<br>><br>>> I'm figuring that I need something like<br>>><br>>> # web1<br>>> backend default {<br>><br>> backends must have uniqe names so you might use:<br>
><br>> backend web1 {<br>>>   .host = "xxx.xxx";<br>>>   .port = "80";<br>>>     .probe = {<br>>>     .url = "/";<br>>>     .timeout = 34 ms;<br>>>     .interval = 1s;<br>
>>     .window = 10;<br>>>     .threshold = 8;<br>>>   }<br>>> }<br>>><br>>> # web2<br>>> backend default {<br>><br>> backend web2{<br>><br>>>   .host = "xxx.xxx";<br>
>>   .port = "80";<br>>>     .probe = {<br>>>     .url = "/";<br>>>     .timeout = 34 ms;<br>>>     .interval = 1s;<br>>>     .window = 10;<br>>>     .threshold = 8;<br>
>>   }<br>>> }<br>>><br>>> And then something to glue all the backends together, but I see many<br>>> different options in the manuals! I'd appreciate a pointer in the<br>>> right direction if anyone could spare one. The vcl man page isnt<br>
>> entirely obvious to me!<br>><br>> Use a director, like this:<br>><br>> director www-director round-robin {<br>>        {<br>>                .backend = web1;<br>>                .weight = 100;<br>
>        }<br>>        {<br>>                 .backend = web2;<br>>                 .weight = 200;<br>>        }<br>> }<br>><br>><br>> --<br>> Per Buer - Leder Infrastruktur og Drift - Redpill Linpro<br>
> Telefon: 21 54 41 21 - Mobil: 958 39 117<br>> <a href="http://linpro.no/">http://linpro.no/</a> | <a href="http://redpill.se/">http://redpill.se/</a><br>><br>><br>> _______________________________________________<br>
> varnish-misc mailing list<br>> <a href="mailto:varnish-misc@projects.linpro.no">varnish-misc@projects.linpro.no</a><br>> <a href="http://projects.linpro.no/mailman/listinfo/varnish-misc">http://projects.linpro.no/mailman/listinfo/varnish-misc</a><br>
><br>><br><br><br><br>-- <br>Alex Davies<br><br>This email and any files transmitted with it are confidential and<br>intended solely for the use of the individual or entity to whom they<br>are addressed. If you have received this email in error please notify<br>
the sender immediately by e-mail and delete this e-mail permanently.<br><br>