Re: using APC as content-cache?

From: Date: Fri, 29 Apr 2005 02:11:59 +0000
Subject: Re: using APC as content-cache?
References: 1 2  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-2319@lists.php.net to get a copy of this message
Rasmus Lerdorf wrote:
Interesting idea. Although it seems like it could be done almost completely in user-space, couldn't it? Perhaps something like this wrapper set as your auto_prepend?
This is one of the caching approaches we've taken at fotopic to handle image manipulation.
Would be interesting to see the performance numbers on this approach.
I don't have any stats to hand, but I will say that you take a slight (fairly obvious) I/O hit. Using either a SCSI disk or a sata/sataII disk with TCQ does seem to negate most of this increased I/O however, especailly in high-load situations.
Then again, for full content-caching like this, a 404 handler which saves a static version of the content plus a cron job that periodically removes files older than 30 minutes might be even more effective. I would think that something like the above would be most effective when used in a partial page caching context.
The only thing to look out for here is that a cron job running through a directory of cached files just doing rm will hit a max file number limit pretty quickly depending on the application. It's safer to do a "find | xargs rm" as the cronjob and just run that every 5 minutes or so over the cachefile directory.

« previous php.pecl.dev (#2319) next »