Forum: Ruby on Rails New app - Welcome loads fine but controller slow

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
29e23a349e6cb2321deffcceabb99f2d?d=identicon&s=25 Jk Jk (draklava)
on 2007-03-06 12:00
I am running RoR 1.2 on Fedora 6 in VMWare.
I create a new app and fire up WEBrick and connect from my windows host
over a host-only VMWare interface and it connects fine.

Now I create a test controller and view and connect. It takes anywhere
from 30 seconds to a couple minutes to load the simple "hello" style
test page.

If I copy the whole directory to my windows box and run WEBbrick and
connect to localhost it loads fine.

I have an Apache/PHP setup on the VMWare using the same connection (to
port 80 not 3000 but similar) and it works fine.

Any ideas on why the "Welcome aboard" page loads fine but a simple
controller would take so long to load?
Dfd6f9989147955682701da8227df8b4?d=identicon&s=25 Michael Wang (Guest)
on 2007-03-06 13:34
(Received via mailing list)
Jk Jk wrote:
>
> I have an Apache/PHP setup on the VMWare using the same connection (to
> port 80 not 3000 but similar) and it works fine.
>
> Any ideas on why the "Welcome aboard" page loads fine but a simple
> controller would take so long to load?

Is your image swapping when it's running Rails? If you reload the
controller URL after the first time it finishes loading does it still
take a long time to load?


--
Michael Wang
29e23a349e6cb2321deffcceabb99f2d?d=identicon&s=25 Jk Jk (draklava)
on 2007-03-06 13:46
Michael Wang wrote:

> Is your image swapping when it's running Rails? If you reload the
> controller URL after the first time it finishes loading does it still
> take a long time to load?

thanks Michael

It takes a long time to load no matter how many times I refresh. I can
also stop and start WEBrick and it makes no difference. Controller loads
slow.
Da734ede01dc6e5bace38f5fbc0fc4f6?d=identicon&s=25 Kevin Tambascio (ktambascio)
on 2007-03-06 13:52
Jk Jk wrote:
> I am running RoR 1.2 on Fedora 6 in VMWare.
> I create a new app and fire up WEBrick and connect from my windows host
> over a host-only VMWare interface and it connects fine.
>
> Now I create a test controller and view and connect. It takes anywhere
> from 30 seconds to a couple minutes to load the simple "hello" style
> test page.
>
> If I copy the whole directory to my windows box and run WEBbrick and
> connect to localhost it loads fine.
>
> I have an Apache/PHP setup on the VMWare using the same connection (to
> port 80 not 3000 but similar) and it works fine.
>
> Any ideas on why the "Welcome aboard" page loads fine but a simple
> controller would take so long to load?

Do you have the VMWare image set to run at high priority when it is
being used?  It's recommended to set vmware images to high/low for
performance (look on the setting property pages for the VM).  Also, are
you using MSSQL?  When I tried to setup my first RoR with MSSQL, I had
slow performance when using the ODBC method.  I switched to using ADO
for database access, and that improved performance greatly.

HTH,
Kevin
Dfd6f9989147955682701da8227df8b4?d=identicon&s=25 Michael Wang (Guest)
on 2007-03-06 13:59
(Received via mailing list)
Jk Jk wrote:
> Michael Wang wrote:
>> Is your image swapping when it's running Rails? If you reload the
>> controller URL after the first time it finishes loading does it still
>> take a long time to load?
>
> thanks Michael
>
> It takes a long time to load no matter how many times I refresh. I can
> also stop and start WEBrick and it makes no difference. Controller loads
> slow.

If you monitor the RAM and swap usage with something like "top" do you
see it chewing up swap space? What's taking up most of the CPU cycles
while it's trying to load the page through the controller?

If you view the development.log file what are the controller stats you
are seeing? E.g. is it spending most of its time rendering the view or
accessing the DB?


--
Michael Wang
29e23a349e6cb2321deffcceabb99f2d?d=identicon&s=25 Jk Jk (draklava)
on 2007-03-06 14:07
Kevin Tambascio wrote:
> Do you have the VMWare image set to run at high priority when it is
> being used?  It's recommended to set vmware images to high/low for


Hmmm - I just switched the VMWare setting "Priority->Input Grabbed" from
normal to high and it appears to make a huge difference.

I think this may have been the problem.

Thanks all for your suggestions.
This topic is locked and can not be replied to.