<div dir="ltr"><div>My total hit ratio decreased in ~2 times from 40% to 20% (it could be cold cache but it lasted at this level for a day without sign of improvement).</div><div><br></div><div>I'll retry tests with making sure there're no Vary header and will also try 1 worker with shared cache tomorrow. But even if it is this bug looks like caching works as expected in squid 4 so it'll be better solution than messing up with headers probably.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 15, 2018 at 10:26 AM, Alex Rousskov <span dir="ltr"><<a href="mailto:rousskov@measurement-factory.com" target="_blank">rousskov@measurement-factory.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 01/14/2018 10:53 PM, Ivan Larionov wrote:<br>
<br>
> After migrating squid from non-SMP/aufs to SMP/rock memory cache hit<br>
> ratio dropped significantly. Like from 50-100% to 1-5%.<br>
<br>
</span>This could be a side effect of not supporting Vary caching in shared<br>
memory: <a href="https://bugs.squid-cache.org/show_bug.cgi?id=3806#c9" rel="noreferrer" target="_blank">https://bugs.squid-cache.org/<wbr>show_bug.cgi?id=3806#c9</a><br>
<span class=""><br>
<br>
> And disk cache hit ratio went up from 15-50% to stable 60-65%.<br>
<br>
</span>I hope your total/combined hit ratio improved overall.<br>
<span class=""><br>
<br>
> it looks like in SMP/rock mode squid avoids using memory for small<br>
> files like 1-3KB but uses it for 10KB+ files.<br>
<br>
</span>No, there is no such size-discrimination code in Squid.<br>
<span class=""><br>
<br>
> I started tracking down the issue with disabling disk cache completely<br>
> and it didn't change anything, I just started to get MISS every time for<br>
> the URL which was getting MEM_HIT with an old configuration. Then I<br>
> changed "workers 2" to "workers 1" and started getting memory hits as<br>
> before.<br>
<br>
</span>For a clean apples-to-apples test, make sure you use<br>
"memory_cache_shared on" when using a single worker without rock cache_dirs.<br>
<span class=""><br>
<br>
> Am I doing anything wrong? Which debug options should I enable to<br>
> provide more information if it seems like a bug?<br>
<br>
<br>
</span>Vary caching should be fixed as well, of course, but perhaps there is<br>
another problem we do not know about. I would start by eliminating Vary<br>
as the known problem. When using a test transaction, make sure the<br>
response does not have a Vary header. Or configure Squid to log the Vary<br>
header and remove the corresponding transactions when computing<br>
adjusted-for-Vary memory cache hit ratio.<br>
<br>
<br>
HTH,<br>
<br>
Alex.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">With best regards, Ivan Larionov.</div>
</div>