<div dir="ltr">I think we're going to need something a little more specific to go on. That is a mile of changes all at once.<div><br></div><div>Finding a single request that should be cached, but isn't and producing the varnish log for that request will probably help illuminate what's going on.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 7, 2016 at 4:22 PM, Justin Lloyd <span dir="ltr"><<a href="mailto:justinl@arena.net" target="_blank">justinl@arena.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_5556445072414931033WordSection1">
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I use Varnish on four load-balanced web servers running Apache with several virtual hosts providing MediaWiki wikis. Last week I upgraded the web servers to support upgrading MediaWiki from 1.26 to 1.27 due to PHP requirements. This meant
upgrading (reinstalling) Ubuntu 12.04 to 16.04, meaning I went from PHP 5.3 to 7, Apache 2.4 + mod_php to Apache 2.4 + PHP-FPM, and Varnish 3 to 4.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">For the upgrade from Varnish 3 to 4, I adapted <a href="https://gist.github.com/Calygos/105957a997ea3bde6b8257a1f34bbd20" target="_blank">
my VCL code</a> accordingly, based on <a href="https://www.mediawiki.org/wiki/Manual:Varnish_caching" target="_blank">
Mediawiki Varnish sample code</a>, but for reasons I don’t understand, my Varnish hit ratio dropped from around 86% to ~20-37%.
<a href="http://imgur.com/jX4iu6s" target="_blank">This picture</a> shows a graph of the last 10 days hit ratio calculations for the four web servers. The graph is calculated using metrics from the Collectd Varnish plugin as (conns - bereqs / conns), i.e.:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas">asPercent(<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas"> diffSeries(<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas"> linux.<i>hostname</i>.varnish-<wbr>default-connections.<wbr>connections-received,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas"> linux.<i>hostname</i>.varnish-<wbr>default-backend.http_requests-<wbr>requests<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas"> ),<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas"> linux.<i>hostname</i>.varnish-<wbr>default-connections.<wbr>connections-received<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:Consolas">)<u></u><u></u></span></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’ve also tried the Varnish hit and miss metrics but those give similar results. So I’m not sure what changed to give such a poor hit ratio, despite otherwise good performance on large, busy wikis. It’s possible it could be something in
MediaWiki’s cookie and/or session handling and I’ve been investigating that possibility as well, but I figured this would be a good place to ask, too.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Justin<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
<br>______________________________<wbr>_________________<br>
varnish-misc mailing list<br>
<a href="mailto:varnish-misc@varnish-cache.org">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/<wbr>lists/mailman/listinfo/<wbr>varnish-misc</a><br></blockquote></div><br></div>