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

Toby Corkindale toby at dryft.net
Wed Feb 2 06:39:48 GMT 2011


On 2 February 2011 13:43, Andrew Rodland <andrew at cleverdomain.org> wrote:
> 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.

Which neatly loops around to my original post! :D

My suggestion being to continue to use Static::Simple, but with
cache-related headers added so that the reverse-proxy in front of
Starman will cache-and-serve them itself.

It's simple, and IMHO, ends up as the fastest, most light-weight way
to serve those static files too.

-T

-- 
Turning and turning in the widening gyre
The falcon cannot hear the falconer
Things fall apart; the center cannot hold
Mere anarchy is loosed upon the world



More information about the Catalyst mailing list