Topic: slow loading of pages

Hi,
I just started out with rails and I've built a really simple site with some sides with dynamic content and some without.

However, whenever I try to load a page, it always takes about 2 seconds to load the page, even if there's like only one row of html on it and no sql queries. This happens even if I load it on the localhost. Anyone knows whats wrong?

I am using Apache on linux and I have linked in the rails directory through a virtualhost. If I load a normal html page in my Apache root, I do not see this problem. Thanks a lot!


/ Rolle

Re: slow loading of pages

Hi rollebolle,

I think you should give us more information about Your setup. Which OS which server (mongrel; mongrel_cluster; Apache).

Re: slow loading of pages

Hi,
thanks for the reply. I gave that info in the post; to be more specific I am running Apache2 on an Ubuntu 7.04 desktop dist.

Re: slow loading of pages

do you run only through apache2, no mongrels behind it? do you use CGI (super-bad) or FCGI (not as bad, but still bad)?

You should use apache only as proxy to a mongrel or mongrel cluster, which are a lot more suited for rails.

Re: slow loading of pages

I guess I only run apache. I used the tutorial on the wiki.rubyonrails.com site, and configured my apache with among other the following lines:

Options ExecCGI FollowSymLinks
AddHandler cgi-script .cgi

, so I guess I use CGI, right? As I found this in the official tutorial I thought it couldn't be so bad... But I'll try the mongrel approach instead then. Thanks for the hint!

Re: slow loading of pages

Not only that, but check out what's actually slowing it down. You can take a look at some benchmarking libraries and see where it's happening, then isolate that to optimize.

http://danielfischer.com - Personal Web-Technology-Blog, Los Angeles.

Re: slow loading of pages

Also firebug (a plugin for firefox) has this helpful tab called "Net" which shows you how long it's taking to load the individual files.

Re: slow loading of pages

Radar wrote:

Also firebug (a plugin for firefox) has this helpful tab called "Net" which shows you how long it's taking to load the individual files.

I think he's doing it locally, if that's the case I doubt it'd be that long -- otherwise great tip!

http://danielfischer.com - Personal Web-Technology-Blog, Los Angeles.

Re: slow loading of pages

DFischer wrote:
Radar wrote:

Also firebug (a plugin for firefox) has this helpful tab called "Net" which shows you how long it's taking to load the individual files.

I think he's doing it locally, if that's the case I doubt it'd be that long -- otherwise great tip!

When I was doing it locally and I had a javascript file missing firebug firstly told me that this javascript file was taking 500ms to only return a 404.

Re: slow loading of pages

Hey I am having the same problem. I have the app deployed on Dreamhost.com running fcgi. I have other aps there that seem to be running normal. kinda slow also but normal. Have a look, the slow app is www.steviehowell.com. Any suggestions would be greatly appreciated. I need to fix this performance issuse soon.

ps - what are benchmarking libraries? is this something with rails?. I also just tried the app locally and it works fine there. Thanks all.

-B

Last edited by ikiini (2007-10-11 12:32:22)

Re: slow loading of pages

Hi!

Im having the same problem, running Rails via Apache and suPHP. Any ideas? My exact server configuration is coming soon, im about to find it out.

ys,
Sebastian