[Catalyst] C::P::PageCache patch for reducing duplicate processing

Toby Corkindale toby at ymogen.net
Thu Jun 22 19:33:23 CEST 2006


Hi,
There's a patch attached for Catalyst::Plugin::PageCache.
(It's not final, but more a "request for comments" on it so far. In 
particular, some better way than using flock())


PageCache's objective is to let you cache pages that are "heavy" to create.
However, the potential exists for a page to expire, and then for several 
requests to come in at once for it near-simultaneously. Since the first 
query hasn't completed building the page yet, the subsequent queries 
will all go off and try to build the same page too.

If that page is rather expensive, this is detrimental to performance.

The object of the patched version is to prevent your application from 
regenerating cached pages in parallel - instead, it forces the 
subsequent requests to wait until the first query has built the page, 
and then uses that.

This will tie up some apache processes waiting on a lock for a while, 
but will reduce the unnecessarily-duplicated CPU or database load that 
would otherwise have occurred.


-Toby
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PageCache.pm-0.12.patch
Type: text/x-patch
Size: 3878 bytes
Desc: not available
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20060622/094242b5/attachment.bin 


More information about the Catalyst mailing list