Thanks robert,<br><br>But i have already tried all this stuff's. The problem with probing is that if your back-end is unhealthy for a second and if varnish declares it unhealthy due to some reason than it shows backend unhealthy for next 5 mins or so whereas the interval is only 5s. So if i m running on one back-end all the requests for this backend fails. <br>
<br>The one i m using is a very domain with 3000 req/s. <br><br>so cannot afford a second of unhealthy network or unreachability. <br><br>Regards,<br> Anand<br><br><div class="gmail_quote">On Wed, Dec 22, 2010 at 4:28 PM, Robert Shilston <span dir="ltr"><<a href="mailto:rtshilston@gmail.com">rtshilston@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Anand,<br>
<br>
I've simplified our VCL as much as practical to demonstrate how we use the backends.<br>
<br>
> backend server2 {<br>
> .host = "a.b.c.12";<br>
> .port = "80";<br>
> .probe = {<br>
> .request =<br>
> "GET /healthforvarnish HTTP/1.1"<br>
> "Host: <a href="http://mysite.com" target="_blank">mysite.com</a>"<br>
> "User-agent: Varnish-probe"<br>
> "Connection: close";<br>
> .interval = 5s;<br>
> .timeout = 2500ms;<br>
> .window = 10;<br>
> .threshold = 8;<br>
> }<br>
> }<br>
> backend server3 {<br>
> .host = "a.b.c.13";<br>
> .port = "80";<br>
> .probe = {<br>
> .request =<br>
> "GET /healthforvarnish HTTP/1.1"<br>
> "Host: <a href="http://mysite.com" target="_blank">mysite.com</a>"<br>
> "User-agent: Varnish-probe"<br>
> "Connection: close";<br>
> .interval = 5s;<br>
> .timeout = 2500ms;<br>
> .window = 10;<br>
> .threshold = 8;<br>
> }<br>
> }<br>
> ...<br>
> backend server2failsafe { .host = "a.b.c.12"; .port="80"; }<br>
> backend server3failsafe { .host = "a.b.c.13"; .port="80"; }<br>
> ...<br>
><br>
> director workingpool random {<br>
> { .backend = server2; .weight = 1; }<br>
> { .backend = server3; .weight = 1; }<br>
> ...<br>
> }<br>
><br>
> director failsafepool random {<br>
> { .backend = server2failsafe; .weight = 1; }<br>
> { .backend = server3failsafe; .weight = 1; }<br>
> ...<br>
> }<br>
><br>
> ...<br>
><br>
> sub vcl_recv {<br>
> set req.backend = workingpool;<br>
><br>
> if (!req.backend.healthy) {<br>
> set req.backend = failsafepool;<br>
> }<br>
><br>
<br>
<br>
<br>
If you implement something like this, then run varnishncsa, you'll see which backends are being selected, and should deliver responses for 100% of your requests. If it does, then you'll need to debug the health checks to see why your backends might be being considered unhealthy.<br>
<br>
Rob<br>
<div><div></div><div class="h5"><br>
<br>
On 22 Dec 2010, at 10:52, Anand Shah wrote:<br>
<br>
> It works for 6 out of 10 requests. I have also found that varnish<br>
> polls backend before sending a GET request. Since i never received any<br>
> request on my apache server for this dropped requests i am in doubt as<br>
> if what makes varnish feel the backend is in unhealthy state.<br>
><br>
> Is there any way that i can troubleshoot?<br>
><br>
><br>
><br>
> Anand<br>
><br>
> On 12/22/10, Robert Shilston <<a href="mailto:rtshilston@gmail.com">rtshilston@gmail.com</a>> wrote:<br>
>> Anand,<br>
>><br>
>> Check that vcl_recv is actually setting a backend. It might be that there's<br>
>> a route through the VCL that doesn't cause a backend to be specified.<br>
>><br>
>> Rob<br>
>><br>
>> On 22 Dec 2010, at 08:39, Anand Shah wrote:<br>
>><br>
>>> I immediately fired a test call using CURL which indicated me a<br>
>>> tcp_miss and i also got the response from origin.<br>
>>><br>
>>> So backend was working and in healthy state.<br>
>>><br>
>>><br>
>>><br>
>>> [root@mymachine ~]# curl --head --header host:<a href="http://imads.mydomain.com" target="_blank">imads.mydomain.com</a><br>
>>> "<a href="http://localhost//0/OasDefault/IIPM_CPL_Nov10_B3_MW/iipm_winter02_300x600_10dec_03.gif" target="_blank">http://localhost//0/OasDefault/IIPM_CPL_Nov10_B3_MW/iipm_winter02_300x600_10dec_03.gif</a>"<br>
>>> HTTP/1.1 200 OK<br>
>>> Last-Modified: Thu, 02 Dec 2010 12:19:14 GMT<br>
>>> P3P: CP="NON NID PSAa PSDa OUR IND UNI COM NAV<br>
>>> STA",policyref="/w3c/p3p.xml"<br>
>>> Content-Type: image/gif<br>
>>> cache-control: max-age=604800<br>
>>> Content-Length: 4150<br>
>>> Date: Wed, 22 Dec 2010 06:39:26 GMT<br>
>>> Connection: keep-alive<br>
>>> H-Served-By: mymachine<br>
>>> Server: mydomain/2.0.6<br>
>>> X-Cache: TCP_MISS<br>
>>><br>
>>> [root@mymachine ~]# curl --head --header host:<a href="http://imads.mydomain.com" target="_blank">imads.mydomain.com</a><br>
>>> "<a href="http://localhost//0/OasDefault/IIPM_CPL_Nov10_B3_MW/iipm_winter02_300x600_10dec_03.gif" target="_blank">http://localhost//0/OasDefault/IIPM_CPL_Nov10_B3_MW/iipm_winter02_300x600_10dec_03.gif</a>"<br>
>>> HTTP/1.1 200 OK<br>
>>> Last-Modified: Thu, 02 Dec 2010 12:19:14 GMT<br>
>>> P3P: CP="NON NID PSAa PSDa OUR IND UNI COM NAV<br>
>>> STA",policyref="/w3c/p3p.xml"<br>
>>> Content-Type: image/gif<br>
>>> cache-control: max-age=604800<br>
>>> Content-Length: 4150<br>
>>> Date: Wed, 22 Dec 2010 06:39:33 GMT<br>
>>> Connection: keep-alive<br>
>>> H-Served-By: mymachine<br>
>>> Server: mydomain/2.0.6<br>
>>> X-Cache: TCP_HIT<br>
>>><br>
>>><br>
>>><br>
>>><br>
>>> Regards,<br>
>>> Anand<br>
>>><br>
>>> On Wed, Dec 22, 2010 at 12:42:24PM +0530, Anand Shah wrote:<br>
>>>> I am running varnish on 64 bit Centos. Getting too many 503 errors<br>
>>>> recently and i tried debugging it with some help from Forums on<br>
>>>> mailinglist.<br>
>>><br>
>>>> VARNISHLOGS:<br>
>>>><br>
>>>> 180 VCL_call c miss fetch<br>
>>>> 180 FetchError c no backend connection<br>
>>>> 180 VCL_call c error deliver<br>
>>><br>
>>> In my experience, "no backend connection" indicates that whatever<br>
>>> backend was selected to handle this request was unavailable due to the<br>
>>> health check/probe returning an error.<br>
>>><br>
>>> What was the backend health at the time? You can use the 'debug.health'<br>
>>> command in the CLI to view health information, or<br>
>>><br>
>>> varnishlog -i Backend_health<br>
>>><br>
>>> to see the results of the health checks as they occur. If a backend is<br>
>>> marked as 'sick' then Varnish won't send any requests to it, since<br>
>>> it's unlikely to help the situation.<br>
>>><br>
>>> _______________________________________________<br>
>>> varnish-misc mailing list<br>
>>> <a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
>>> <a href="http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
>>><br>
>>> _______________________________________________<br>
>>> varnish-misc mailing list<br>
>>> <a href="mailto:varnish-misc@varnish-cache.org">varnish-misc@varnish-cache.org</a><br>
>>> <a href="http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" target="_blank">http://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
>><br>
>><br>
<br>
</div></div></blockquote></div><br>