Hit ratio dropped significantly after recent upgrades

Justin Lloyd justinl at arena.net
Wed Dec 7 22:22:05 CET 2016


Hello,

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.

For the upgrade from Varnish 3 to 4, I adapted my VCL code<https://gist.github.com/Calygos/105957a997ea3bde6b8257a1f34bbd20> accordingly, based on Mediawiki Varnish sample code<https://www.mediawiki.org/wiki/Manual:Varnish_caching>, but for reasons I don't understand, my Varnish hit ratio dropped from around 86% to ~20-37%. This picture<http://imgur.com/jX4iu6s> 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.:

asPercent(
    diffSeries(
        linux.hostname.varnish-default-connections.connections-received,
        linux.hostname.varnish-default-backend.http_requests-requests
    ),
   linux.hostname.varnish-default-connections.connections-received
)

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.

Thanks,
Justin

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20161207/3c76ccf5/attachment.html>


More information about the varnish-misc mailing list