<div dir="ltr">My disks are fast (SSD) so I didn't see performance issues but it doesn't change the fact that memory hit ratio decreased in more than 10 times. And with both rock and shared memory cache enabled most of the files were saved into disk cache and not into memory cache and most of the hits were disk hits (according to log file).<div><br></div><div>I already tried squid 4 and it works as expected.</div><div><br></div><div>So. Let's forget about rock because the issue I see is related to shared memory. For my test file with only memory cache enabled:</div><div><br></div><div>squid 3.5.27 non-SMP - MISS first then always MEM_HIT</div><div>squid 3.5.27 SMP any amount of workers shared memory off - always MEM_HIT after all workers handled the request once</div><div>squid 3.5.27 SMP any amount of workers shared memory on - MISS every time.</div><div>squid 4.0.22 SMP 2 workers shared memory on - MISS first then always MEM_HIT</div><div><div><div class="gmail_extra"><br></div><div class="gmail_extra">I would like to use squid 4 in production and I probably will since looks like SMP/shared_cache is broken in 3, but the fact that you still haven't released it confuses me. IDK why it's still in beta/rc/whatever stage.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 15, 2018 at 7:22 AM, Amos Jeffries <span dir="ltr"><<a href="mailto:squid3@treenet.co.nz" target="_blank">squid3@treenet.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On 15/01/18 18:53, Ivan Larionov wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Hello!<br>
<br>
After migrating squid from non-SMP/aufs to SMP/rock memory cache hit ratio dropped significantly. Like from 50-100% to 1-5%. And disk cache hit ratio went up from 15-50% to stable 60-65%. From the brief log file check it looks like in SMP/rock mode squid avoids using memory for small files like 1-3KB but uses it for 10KB+ files.<br>
</blockquote>
<br></span>
AIUI, SMP-mode rock operates as a fully separate process (a "Disker" kid) which delivers its results as objects already in shared memory to the worker process.<br>
<br>
There should be little or no gain from that promotion process anymore - which would only be moving the object between memory locations. In fact if cache_mem were not operating as shared memory even with SMP active (which is possible) the promotion would be an actively bad idea as it prevents other workers using the object in future.<br>
<br>
They show up as non- MEM_HIT because they are either REFRESH or stored in the Disker shared memory instead of the cache_mem shared memory. The Squid logging is not quite up to recording the slim distinction between which of multiple memory areas are being used.<span class="gmail-"><br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
I started tracking down the issue with disabling disk cache completely and it didn't change anything, I just started to get MISS every time for the URL which was getting MEM_HIT with an old configuration. Then I changed "workers 2" to "workers 1" and started getting memory hits as before.<br>
<br>
So it seems like the issue is with shared memory:<br>
<br>
When squid doesn't use shared memory it works as expected. Even with multiple workers.<br>
When squid uses shared memory it caches very small amount of objects.<br>
<br>
Am I doing anything wrong? Which debug options should I enable to provide more information if it seems like a bug?<br>
<br>
</blockquote>
<br></span>
Are you seeing an actual performance difference? if not I would not worry about it.<br>
<br>
FYI: if you really want to track this down I suggest using Squid-4 to do that. Squid-3 is very near the end of its support lifetime and changes of a deep nature do not have much chance at all of getting in there now.<br>
<br>
Amos<br>
______________________________<wbr>_________________<br>
squid-users mailing list<br>
<a href="mailto:squid-users@lists.squid-cache.org" target="_blank">squid-users@lists.squid-cache.<wbr>org</a><br>
<a href="http://lists.squid-cache.org/listinfo/squid-users" rel="noreferrer" target="_blank">http://lists.squid-cache.org/l<wbr>istinfo/squid-users</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">With best regards, Ivan Larionov.</div>
</div></div></div></div>