<div dir="ltr"><div dir="ltr">re-adding the list<div><br></div><div>> I will reduce probe param 'interval' to, let's say, 10s. That sounds reasonable?</div><div><br></div><div>I would definitely make for more reactive decision. Shameless plug: I would recommend reading on that topic: <a href="https://info.varnish-software.com/blog/backends-load-balancing">https://info.varnish-software.com/blog/backends-load-balancing</a> (man vcl, the probes section is of course a must-read)</div><div><br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div>-- <br></div>Guillaume Quintard<br></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 5, 2019 at 3:05 PM Hu Bert <<a href="mailto:revirii@googlemail.com">revirii@googlemail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
i'll try these commands. No output so far, but i'll see.<br>
<br>
I will reduce probe param 'interval' to, let's say, 10s. That sounds reasonable?<br>
<br>
<br>
Hubert<br>
<br>
Am Di., 5. Feb. 2019 um 14:35 Uhr schrieb Guillaume Quintard<br>
<<a href="mailto:guillaume@varnish-software.com" target="_blank">guillaume@varnish-software.com</a>>:<br>
><br>
> Try something like that: varnishlog -q "Timestamp:Resp[2] > 7" -g request<br>
> (man vsl-query for more info)<br>
><br>
> I just think your probe definition is pretty bad (1 minute interval is going to yield some wonky results) and you varnish sees the backend as healthy, tries to fetch, fakes a long time, then the probe finally kicks in.<br>
> --<br>
> Guillaume Quintard<br>
><br>
><br>
> On Tue, Feb 5, 2019 at 1:47 PM Hu Bert <<a href="mailto:revirii@googlemail.com" target="_blank">revirii@googlemail.com</a>> wrote:<br>
>><br>
>> Hi,<br>
>> sry i can't reproduce, as i had to get the varnish running. Maybe i<br>
>> have to explain... :-)<br>
>><br>
>> We once had a server with nginx (frontend), varnish and some other<br>
>> stuff, and as RAM became a tight resource, we got another server<br>
>> (server2) running, separately for varnish. That server now cached all<br>
>> the images and all other stuff (like css, js etc.) from the tomcat<br>
>> backends. So the vcl file contained the images backends and all the<br>
>> tomcat backends.<br>
>><br>
>> We then moved the cache for "all the other stuff" to server3, and<br>
>> server2 only cached images from then on. But the vcl file stayed<br>
>> untouched, still containing all the backends&probes that actually<br>
>> weren't necessary for images - and now 2 of these backends (due to<br>
>> load) repeatedly answered 500/502 and have to be rebooted regularly<br>
>> (nothing can be done here at the moment).<br>
>><br>
>> To get the varnish on server2 (images) running i simply removed all<br>
>> the unnecessary tomcat backends and restarted varnish, and now it's<br>
>> running really good. I still have the old vcl file on server3 running,<br>
>> there i see that the 2 tomcat backends are changing between sick and<br>
>> healthy. Don't know if it might work there as well - i tried it but<br>
>> the output of 'varnishlog -g request' is massive. Something special i<br>
>> should grep for?<br>
>><br>
>> Alternatively i could provide the vcl file, but i'm afraid that your<br>
>> eyes might explode ;-)<br>
>><br>
>> Hubert<br>
>><br>
>> Am Di., 5. Feb. 2019 um 13:14 Uhr schrieb Guillaume Quintard<br>
>> <<a href="mailto:guillaume@varnish-software.com" target="_blank">guillaume@varnish-software.com</a>>:<br>
>> ><br>
>> > Hi,<br>
>> ><br>
>> > Can you try to set the backend health to sick using "varnishadm backend.set_health" and try to reproduce?<br>
>> ><br>
>> > If you can reproduce, please pastebin the corresponding "varnishlog -g request" block<br>
>> ><br>
>> > On Tue, Feb 5, 2019, 12:55 Hu Bert <<a href="mailto:revirii@googlemail.com" target="_blank">revirii@googlemail.com</a> wrote:<br>
>> >><br>
>> >> Hi Guillaume,<br>
>> >><br>
>> >> the backend config looks like this (just questioning a simple file<br>
>> >> from tomcat); maybe params are wrong? :<br>
>> >><br>
>> >> backend tomcat_backend1 {<br>
>> >>    .host = "192.168.0.126";<br>
>> >>    .port = "8082";<br>
>> >>    .connect_timeout = 15s;<br>
>> >>    .first_byte_timeout = 60s;<br>
>> >>    .between_bytes_timeout = 15s;<br>
>> >>    .probe = {<br>
>> >>        .url = "/portal/info.txt";<br>
>> >>        .timeout = 10s;<br>
>> >>        .interval = 1m;<br>
>> >>        .window = 3;<br>
>> >>        .threshold = 1;<br>
>> >>    }<br>
>> >> }<br>
>> >><br>
>> >> The backend is shown as 'sick', but the time until you get an answer<br>
>> >> from nginx/varnish differs, from below a second to 7 or more seconds -<br>
>> >> but the requested image is already in cache (hits >= 1).<br>
>> >><br>
>> >> Imho the cache should work and deliver a cached file, independent from<br>
>> >> a (non) working backend. Maybe beresp.ttl messed up?<br>
>> >><br>
>> >>     else if (beresp.status<300) {<br>
>> >> [lots of rules]<br>
>> >>     } else {<br>
>> >>        # Use very short caching time for error messages - giving the<br>
>> >> system the chance to recover<br>
>> >>        set beresp.ttl = 10s;<br>
>> >>        unset beresp.http.Cache-Control;<br>
>> >>        return(deliver);<br>
>> >>    }<br>
>> >><br>
>> >> Thx<br>
>> >> Hubert<br>
>> >><br>
>> >> Am Di., 5. Feb. 2019 um 12:33 Uhr schrieb Guillaume Quintard<br>
>> >> <<a href="mailto:guillaume@varnish-software.com" target="_blank">guillaume@varnish-software.com</a>>:<br>
>> >> ><br>
>> >> > Hi,<br>
>> >> ><br>
>> >> > Do you have probes set up? If you do, the backend will be declared sick and varnish will reply instantly without even trying to contact it.<br>
>> >> ><br>
>> >> > It sounds like that at the moment, varnish just tries to get whatever it can, waiting for as long as authorized.<br>
>> >> ><br>
>> >> > Cheers,<br>
>> >> ><br>
>> >> > On Tue, Feb 5, 2019, 11:51 Hu Bert <<a href="mailto:revirii@googlemail.com" target="_blank">revirii@googlemail.com</a> wrote:<br>
>> >> >><br>
>> >> >> Hey there,<br>
>> >> >><br>
>> >> >> i hope i'm right here... i have the following setup to deliver images:<br>
>> >> >><br>
>> >> >> nginx: https -> forward request to varnish 5.0<br>
>> >> >> if image is not in cache -> forward request to backend nginx<br>
>> >> >> backend nginx: delivers file to varnish if found on harddisk<br>
>> >> >> if backend nginx doesn't find: forward request to 2 backend tomcats to<br>
>> >> >> calculate the desired image<br>
>> >> >><br>
>> >> >> The 2 backend tomcats do deliver another webapp (and are a varnish<br>
>> >> >> backend as well); at the moment they're quite busy and stop working<br>
>> >> >> due to heavy load (->restart), the result is that varnish sees/thinks<br>
>> >> >> that the backends are sick. Somehow then even the cached images are<br>
>> >> >> delivered after a quite long waiting period, e.g. a 5 KB image takes<br>
>> >> >> more than 7 seconds.<br>
>> >> >><br>
>> >> >> Is this the normal behaviour that varnish does answer slowly if some<br>
>> >> >> backends are sick?<br>
>> >> >><br>
>> >> >> If any other information is need i can provide the necessary stuff.<br>
>> >> >><br>
>> >> >> Thx in advance<br>
>> >> >> Hubert<br>
>> >> >> _______________________________________________<br>
>> >> >> varnish-misc mailing list<br>
>> >> >> <a href="mailto:varnish-misc@varnish-cache.org" target="_blank">varnish-misc@varnish-cache.org</a><br>
>> >> >> <a href="https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc" rel="noreferrer" target="_blank">https://www.varnish-cache.org/lists/mailman/listinfo/varnish-misc</a><br>
</blockquote></div>