[Catalyst] Re: Opinions on static::simple - with caching

Andrew Rodland andrew at cleverdomain.org
Wed Feb 2 02:43:41 GMT 2011

On Tuesday, February 01, 2011 08:06:08 PM Toby Corkindale wrote:
> How do you find Plack at serving static files (via Middleware::Static
> / App::Static)? Compared to Static::Simple, and compared to native
> HTTPD. I guess it sits in between the two in terms of performance, but
> wondered how much of an improvement it was?
All of them will give perfectly acceptable throughput -- even Static::Simple 
isn't *slow*. The real concern is that with Static::Simple or with 
Plack::App::File, you're tying up one of your webapp processes to serve the 
file -- and your webapp processes are usually fairly limited in number, and 
fairly memory-hungry (which prevents you from just making more). On the other 
hand, if you let the frontend httpd serve the file, the cost of serving a 
static file ranges from one lightweight httpd thread (for a threaded model) to 
nearly nothing at all (with an async model). Either way, it's not tying up a 
process that could be running Catalyst.

If you're serving up a fairly small number of fairly small files, then this 
probably doesn't make any difference to you, but if you're serving a larger 
number of larger files (that will take several seconds or more to transfer) 
then you should probably be thinking about ways to do it outside of your 
webapp process.


More information about the Catalyst mailing list