[Mongrel] Performance tweak when local files are not served by mongrel

François SIMOND curio at free.fr
Tue Jun 20 03:39:10 EDT 2006


Hello Zed !

I've experimented a simple but limited performance tweak in the mongrel
rails loader.
With the following apache 2.2 mod proxy loadbalancer setup :

  # Redirect all non-static requests to cluster
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
  RewriteRule ^/(.*)$ balancer://mongrel_cluster%{REQUEST_URI} [P,QSA,L]

We can assume that mongrel is called only when the local file does not
exist.
I've tried to comment out code in rails loader that check if the local
file, or the local file . ".html" exists
Here are the benchmark on a simple action : (ab -n 5000 on mongrel itself)

Ignoring local files :    254 pages/s
Checking local files :   245 pages/s

That's an approx. 3.7% performance improvement.

What would you think of a new command line option : --ignore-local-files ?

-- 
 Francois Simond


More information about the Mongrel-users mailing list