<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Would something like Elysia Cron solve the problem...<div><br></div><div><a href="http://drupal.org/project/elysia_cron">http://drupal.org/project/elysia_cron</a></div><div><br></div><div>It has some advanced cron control which can manage long requests, as well as disable or change the timing on different cron hooks.</div><div><div><br><div><div>On 18/10/2010, at 9:41 PM, TomᚠFülöpp (<a href="http://vacilando.org">vacilando.org</a>) wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Not all caches would <i>have</i> to be re-populated at the same time. <br><br>Currently, if many or all caches get empty, they need to be re-populated on request, extending the script execution. On a busier site other requests are waiting because the first request is still not finished re-populating caches. Eventually, Apache's maximum number of connections may be reached. <br>

<br>In the scenario I am considering, expired caches would not be emptied, so they would continue serving (slightly older) data fast, and they would be refreshed gradually (e.g. one cache per request). <br><br style="color: rgb(102, 102, 102);">

<font size="2"><a style="color: rgb(102, 102, 102);" href="http://www.vacilando.org/" target="_blank"></a><br style="color: rgb(102, 102, 102);">
</font><br>
<br><br><div class="gmail_quote">On Mon, Oct 18, 2010 at 12:25, Chris Skene <span dir="ltr">&lt;<a href="mailto:chris@xtfer.com">chris@xtfer.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

<div style="word-wrap: break-word;">What would be the practical difference between emptying and recreating a cache, and refreshing it?<div><div></div><div class="h5"><div><br><div><div>On 18/10/2010, at 9:22 PM, TomᚠFülöpp (<a href="http://vacilando.org/" target="_blank">vacilando.org</a>) wrote:</div>

<br><blockquote type="cite">Hi,<br><br>In D6, after all caches are cleared, or after a lot of them expire and get emptied by cron, the server load spikes seriously because all such caches need to be re-populated.<br><br>
Since this happens more and more on sites I work on, I have been thinking about using another approach in my modules, in the sense that caches would be <i>refreshed</i> rather than cleared and re-populated. Each cache refresh would run depending on e.g. a simple variable storing last time stamp of any other cache refresh.<br>



<br>This would assure that a) all cached values would be available at all times, b) caches would never be re-calculated all at the (near) same time.<br><br>I am about to write logic for this, but wanted to first check with others in the list -- perhaps some of you know or can point to an elegant solution that already exists.<br>



<br>Thanks!<br><br>vacilando<br><br><br>
</blockquote></div><br></div></div></div></div></blockquote></div><br>
</blockquote></div><br></div></div></body></html>