Topic: Mongrel slowdown compared to Apache?

I've recently switched hosts from Site5 to Media Temple's Grid Server. I moved my Rails app over, and it appears to be functioning correctly, however it is literally 100x slower. It has been rendering pages in 20s as opposed to the 0.1s I am used to. Is there any possible configuration changes when switching from Apache with FCGI to Mongrel without? Or is this simply the hardware causing the slowdown? I am running at about 30mb memory out of the alloted 64mb. Has anyone experienced similar problems? Thanks!

Re: Mongrel slowdown compared to Apache?

You might want to take a look at your Apache configuration. It sounds as if Mongrel is also serving static pages, instead of only Rails pages. Mongrel isn't designed to serve static content like images, html, javascript, ... which may explain the slow page loads. Look at http://www.railshostinginfo.com/static/ … _for_rails to find some links to websites that discuss how to setup Mongrel with Apache.

Kind regards,

Nick Snels
--
http://www.railshostinginfo.com
Compare and review Rails hosting companies

Re: Mongrel slowdown compared to Apache?

One thing to keep in mind when deploying your site with Mongrel is you have to set app to run in production mode. Like this:

mongrel_rails -e production

Of course adding whatever other options you use.

If you don't it will default to development mode which is mucho slower. Even in development mode 20 seconds seems like far, far too long to be processing a single call though. Your methods may benefit from a bit of optimization smile

Last edited by marsvin (2007-02-15 16:31:37)