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

2011-02-02 Thread Aristotle Pagaltzis
* Toby Corkindale  [2011-02-02 07:50]:
> 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.

Exactly. HTTP has great scaling features. There is no need to
invent special-purpose mechanisms to achieve the same things.

Regards,
-- 
Aristotle Pagaltzis // 

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


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

2011-02-01 Thread Toby Corkindale
On 2 February 2011 13:43, Andrew Rodland  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

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


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

2011-02-01 Thread Andrew Rodland
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.

Andrew

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


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

2011-02-01 Thread Toby Corkindale
On 2 February 2011 00:08, Aristotle Pagaltzis  wrote:
> * Toby Corkindale  [2011-02-01 03:25]:
>> The case that I find having the headers enabled is as follows:
>>
>> Front end load-balancing proxies, talking to app servers
>> running starman, running catalyst apps.
>> If you use Static::Simple, this does make the pipeline
>> configuration nice and simple.
>> I like simplicity.
>> If you enable caching on your static content, then your
>> reverse-proxies at the front will cache things, and take the
>> load of static content off Catalyst at the back.
>>
>> I'd like to see it as an option on Static::Simple; I could mod
>> that and send a patch over if you liked?
>
> You may be interested in my setup:
> http://blogs.perl.org/users/aristotle/2011/01/some-nifty-things-you-can-do-with-catalyst-on-plack.html

Thanks - that's a really good example setup.

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?

I might have to borrow the bit about auto-extending expiry times for
versioned static files :)

cheers,
Toby

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


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

2011-02-01 Thread Aristotle Pagaltzis
* Toby Corkindale  [2011-02-01 03:25]:
> The case that I find having the headers enabled is as follows:
>
> Front end load-balancing proxies, talking to app servers
> running starman, running catalyst apps.
> If you use Static::Simple, this does make the pipeline
> configuration nice and simple.
> I like simplicity.
> If you enable caching on your static content, then your
> reverse-proxies at the front will cache things, and take the
> load of static content off Catalyst at the back.
>
> I'd like to see it as an option on Static::Simple; I could mod
> that and send a patch over if you liked?

You may be interested in my setup:
http://blogs.perl.org/users/aristotle/2011/01/some-nifty-things-you-can-do-with-catalyst-on-plack.html

-- 
*AUTOLOAD=*_;sub _{s/::([^:]*)$/print$1,(",$\/"," ")[defined 
wantarray]/e;chop;$_}
&Just->another->Perl->hack;
#Aristotle Pagaltzis // 

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/