[Mongrel] Disabling static file lookups?
toolbag at gmail.com
Fri Dec 12 11:57:50 EST 2008
Ezra- thanks for your feedback.
My greater question is: is it worth it, in the long run? Or is it too
On Fri, Dec 12, 2008 at 8:54 AM, Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:
> On Dec 11, 2008, at 6:05 PM, Cody Caughlan wrote:
>> In looking at a running mongrel process in strace and at the code
>> itself Mongrel will always look for a file under "public" (with and
>> without a .html extension). When those filesystem lookups fail, it
>> then passes the request to Rails.
>> So my question is, would you get more performance by disabling this
>> lookup and just handing it off to Rails from the get go?
>> I understand that in development, the current behavior is desired as
>> Mongrel is acting as the primary HTTP server. But in production, with
>> a HTTP server like Apache or nginx in front and configured to serve
>> static files, then it might make sense to not have Mongrel concern
>> itself with looking for static files.
>> Maybe the OS caches those filesystem calls (stat cache?) and this
>> would be a crazy premature optimization.
> You should be able to alter the railshandler to not do these lookups
> when a config option is set. Merb uses rack middleware to do the static
> pages and that can be easily turned off in production. I believe latest
> rails does this as well and maybe you can disable these checks with rack in
> rails as well?
> Ezra Zygmuntowicz
> ez at engineyard.com
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
More information about the Mongrel-users