<div dir="ltr"><div><div><div><div><div><div><div>I've done some testing of this on a big, complex search results page with data from one of our largest partners, and have seen some immediate benefits.<br><br></div>One optimization that seems to make a big difference for Plack, though, is less-frequent clearing of the L1 cache. I'll be attaching a POC later today, but the basic idea is to store an modification time in memcached whenever a cache value is set and check that time before returning a value from the L1 cache. If memcache has been modified more recently than the L1 cache, the L1 is cleared. This means that each Plack worker process can have its own persistent L1 cache but clear it only when it becomes stale.<br><br></div>Some timing numbers to support this (the test page is a search results page with 50 results and XSLT):<br><br></div>Before any caching at all, the page took 30 seconds (!) to load.<br></div>With memcached sysprefs: ~9 seconds<br></div>With an L1 cache cleared before every request: ~8.5 seconds<br></div>With an L1 cache cleared only when memcache is modified: 7 seconds<br><br></div>I expected the roundtrip to check the memcache modification time on every cache lookup to cancel out the gain of the L1, but as seen above, this is clearly not true. Any ideas about a better implementation are of course welcomed.<br><div><div><div><div><div><div><br><br></div></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-03-11 11:33 GMT-07:00 Tomas Cohen Arazi <span dir="ltr"><<a href="mailto:tomascohen@gmail.com" target="_blank">tomascohen@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi<div><span class=""><br>2016-03-11 10:38 GMT-03:00 Jonathan Druart <<a href="mailto:jonathan.druart@bugs.koha-community.org" target="_blank">jonathan.druart@bugs.koha-community.org</a>>:<br>><br>> Hi devs,<br>><br>> I have worked on a three-level cache to cache our stuffs:<br>> L1 - hashref<br>> L2 - memcache<br>> L3 - DB<br>><br>> Please have a look at bug 11998 and bug 16044.<br>> I really really would like to get your opinions on these patches.<br><br></span>I really like the approach because it provides a specilized way of dealing with caching for each use case. Thus, no penalty because of the removal of in-memory cache (L1), and we can have proper invalidation for heavier stuff on memcache (L2) without the need to have a single way to cache stuff.</div><div><br></div><div>I signed 11988 after reviewing and properly testing it. The only issue I found was that it was sysprefs-specific, and then I found 16044 put the code were it belongs, and I can say we can find some bug on it, but this is a huge improvement in terms of speed and also maintainability.</div><div><br></div><div>Congrats Robin and Jonathan<br><br>--<br>Tomás Cohen Arazi<br>Theke Solutions (<a href="http://theke.io" target="_blank">http://theke.io</a>)<br>✆ +54 9351 3513384<br>GPG: B2F3C15F</div><div><br></div></div>
<br>_______________________________________________<br>
Koha-devel mailing list<br>
<a href="mailto:Koha-devel@lists.koha-community.org">Koha-devel@lists.koha-community.org</a><br>
<a href="http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel" rel="noreferrer" target="_blank">http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel</a><br>
website : <a href="http://www.koha-community.org/" rel="noreferrer" target="_blank">http://www.koha-community.org/</a><br>
git : <a href="http://git.koha-community.org/" rel="noreferrer" target="_blank">http://git.koha-community.org/</a><br>
bugs : <a href="http://bugs.koha-community.org/" rel="noreferrer" target="_blank">http://bugs.koha-community.org/</a><br></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature">Jesse Weaver</div>
</div>