Rails incredibly slow (update)

After 24 minutes of waiting, the Welcome Aboard window came up in my
browser. The command window now contains

22:20:51.78 C:\InstantRails\rails_apps\demo>ruby script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...

******** Here is where it stuck. What follows came out and then it
began to work. I don't know whether there were delays between any of
the lines below.

** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. INT => stop (no restart).
** Mongrel available at 0.0.0.0:3000
** Use CTRL-C to stop.

Now going to the demo page proceeds at a normal pace in a new tab.
Going to rails/info/properties takes forever.

Advice? Thanks!

Ron Jeffries
www.XProgramming.com

Ron Jeffries wrote:

After 24 minutes of waiting, the Welcome Aboard window came up in my
browser. The command window now contains

22:20:51.78 C:\InstantRails\rails_apps\demo>ruby script/server
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...

******** Here is where it stuck. What follows came out and then it
began to work. I don't know whether there were delays between any of
the lines below.

** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. INT => stop (no restart).
** Mongrel available at 0.0.0.0:3000
** Use CTRL-C to stop.

Now going to the demo page proceeds at a normal pace in a new tab.
Going to rails/info/properties takes forever.

Advice? Thanks!

Ron Jeffries
www.XProgramming.com

Ron,

Are you on XP or Vista? Do you have an aggressive virus scanner than scans every file each time it is accessed? You may need to look for a way to disable scanning on the InstantRails directory.

Rails on Windows is slow - but not that bad (obviously).

Cheers,
Mohit.
11/14/2007 | 12:22 PM.

Ron Jeffries wrote:

After 24 minutes of waiting, the Welcome Aboard window came up in my
browser. The command window now contains

...

Ron Jeffries
www.XProgramming.com

Recently, I used this free tool to check some performance problems in my
Win box and i found some
problems fast that i wouldnt never dreamed.

http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/processmonitor.mspx

···

--
Posted via http://www.ruby-forum.com/\.

darius wrote:

This is probably unhelpful, but since you seem stuck..

uninstall your ruby and rails installation.

download this .exe install (ruby only, no instant rails)

http://rubyforge.org/frs/?group_id=167

(you may need to reboot here or logoff/logon to make sure PATH is updated)

then manually install rails

gem install rails --include-dependencies
    
now see how long rails -v takes.

Actually, I wonder if Portable Rails would help:
http://ruby.about.com/od/resources/qt/portable_rails.htm

I think there was another Portable version of Rails but I can't remember what it was...

Cheers,
Mohit.
11/19/2007 | 12:59 AM.

Are you on XP or Vista? Do you have an aggressive virus scanner than
scans every file each time it is accessed? You may need to look for a
way to disable scanning on the InstantRails directory.

I'm on XP. I don't think McAfee is that aggressive but I will check.
I'd have thought that other things would be just as slow if that were
the case though. I'll report back if I find anything. Probably not
tonight.

Rails on Windows is slow - but not that bad (obviously).

Right ... it works just fine on Chet's machine.

Thanks,

Ron Jeffries
www.XProgramming.com

···

On Tue, 13 Nov 2007 23:22:29 -0500, Mohit Sindhwani <mo_mail@onghu.com> wrote:

Gamont Gamont wrote:

Ron Jeffries wrote:
  

After 24 minutes of waiting, the Welcome Aboard window came up in my
browser. The command window now contains

...
  

Ron Jeffries
www.XProgramming.com
    
Recently, I used this free tool to check some performance problems in my Win box and i found some
problems fast that i wouldnt never dreamed.

http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/processmonitor.mspx

Ron,

Is there any version of Ruby installed on your system other than the one with InstantRails? What about Chet's?

Also, the InstantRails directory has a file called use_ruby.cmd
Can you go to a command window, run use_ruby.cmd first and then type in
ruby -v
and then
rails -v
and see if it's any faster.

Cheers
Mohit.

Ron Jeffries wrote:

Are you on XP or Vista? Do you have an aggressive virus scanner than scans every file each time it is accessed? You may need to look for a way to disable scanning on the InstantRails directory.

I'm on XP. I don't think McAfee is that aggressive but I will check.
I'd have thought that other things would be just as slow if that were
the case though. I'll report back if I find anything. Probably not
tonight.

Rails on Windows is slow - but not that bad (obviously).

Right ... it works just fine on Chet's machine.

I've run Ruby apps, including Rails apps, on an XP laptop with little trouble. However, the times that Windows has been painfully slow (whether I was running Ruby or not) tended (as best I could tell) to be related to networking.

For example, browsing the file system would all too often stall File Manager (or File Explorer or whatever it's called) because the OS would attempt to resolve mapped network drives and such. Seems the time-out period is glacial, and until the OS is happy things come to a crawl.

(note: my Win32 SysAdmin skillz == Google + MSDN + ad hos experiments)

So, Dr. Anecdotal suggests looking to see if there are mapped drives (either actually connected or not), references to network printers, and so on.

James
Now on Kubuntu

···

On Tue, 13 Nov 2007 23:22:29 -0500, Mohit Sindhwani > <mo_mail@onghu.com> wrote:

Personally, I've used Instant Rails twice. The first time I gave up
and used Rails via Linux on my host; the second time I gave up and
used Rails on my OS X laptop. If I wasn't talking to a distinguished
software luminary I'd say that you want to get as far away from
Windows as fast as you possibly can.

Since I am talking to a distinguished software luminary, I'll just
tell you what I know, which is that Rails does a lot of magic when it
boots, and it's got to be something in that process. (And that the
release notes for Instant Rails were last edited in March.) Also, if
you ask on the Rails list, you can find a lot more detail about the
magic, and a lot more people who've been through the experience you're
having. Sorry I can't do more.

···

--
Giles Bowkett

Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com

Windows seems generally fine. Only rails has any particular slowness
showing. Thanks,

Ron Jeffries
www.XProgramming.com

···

On Wed, 14 Nov 2007 01:11:13 -0500, James Britt <james.britt@gmail.com> wrote:

So, Dr. Anecdotal suggests looking to see if there are mapped drives
(either actually connected or not), references to network printers,
and so on.

James Britt wrote:

Ron Jeffries wrote:

Are you on XP or Vista? Do you have an aggressive virus scanner than scans every file each time it is accessed? You may need to look for a way to disable scanning on the InstantRails directory.

I'm on XP. I don't think McAfee is that aggressive but I will check.
I'd have thought that other things would be just as slow if that were
the case though. I'll report back if I find anything. Probably not
tonight.

Rails on Windows is slow - but not that bad (obviously).

Right ... it works just fine on Chet's machine.

I've run Ruby apps, including Rails apps, on an XP laptop with little trouble. However, the times that Windows has been painfully slow (whether I was running Ruby or not) tended (as best I could tell) to be related to networking.

For example, browsing the file system would all too often stall File Manager (or File Explorer or whatever it's called) because the OS would attempt to resolve mapped network drives and such. Seems the time-out period is glacial, and until the OS is happy things come to a crawl.

(note: my Win32 SysAdmin skillz == Google + MSDN + ad hos experiments)

So, Dr. Anecdotal suggests looking to see if there are mapped drives (either actually connected or not), references to network printers, and so on.

James
Now on Kubuntu

My experience on Windows laptops (even more anecdotal than yours) is that the hard drive is usually the bottleneck. And check your power control settings -- you might be running with 1/3 processor speed, with the hard drive spinning up and down between web hits, or other bizarre notions geared to battery conservation modes even when you're plugged into the wall.

But on my laptop, even though I run with everything at maximum speed when plugged in, the hard drive is still beastly slow in Windows, so it's usually booted into Linux. :slight_smile:

···

On Tue, 13 Nov 2007 23:22:29 -0500, Mohit Sindhwani >> <mo_mail@onghu.com> wrote:

Giles Bowkett wrote:

Personally, I've used Instant Rails twice. The first time I gave up
and used Rails via Linux on my host; the second time I gave up and
used Rails on my OS X laptop. If I wasn't talking to a distinguished
software luminary I'd say that you want to get as far away from
Windows as fast as you possibly can.

Since I am talking to a distinguished software luminary, I'll just
tell you what I know, which is that Rails does a lot of magic when it
boots, and it's got to be something in that process. (And that the
release notes for Instant Rails were last edited in March.) Also, if
you ask on the Rails list, you can find a lot more detail about the
magic, and a lot more people who've been through the experience you're
having. Sorry I can't do more
  
I had sent a reply to Ron that seems to have got lost - so, I'll just do a reply to this email (since I've cleared the rest of the thread from my mailbox).

Ron, do you have any other version of Ruby installed on your PC?

Also, InstantRails has a command called use_ruby.cmd in the main directory. Go to a console, go to your instant rails directory and run that first. Then, try to do rails -v.

I have 2 versions of Ruby on my PC (one's been left there since I installed WideStudio).

If I don't run use_ruby.cmd first, Rails take 35 seconds to return a version. After I do, it takes less than a second.

Perhaps, this helps?

Cheers,
Mohit.
11/16/2007 | 1:25 PM.

Personally, I've used Instant Rails twice. The first time I gave up
and used Rails via Linux on my host; the second time I gave up and
used Rails on my OS X laptop. If I wasn't talking to a distinguished
software luminary I'd say that you want to get as far away from
Windows as fast as you possibly can.

Well, software luminaries, whatever those are, can be just as ignorant
as the next person. However, given what my work looks like, moving off
of Windows isn't in the cards.

Since I am talking to a distinguished software luminary, I'll just
tell you what I know, which is that Rails does a lot of magic when it
boots, and it's got to be something in that process. (And that the
release notes for Instant Rails were last edited in March.) Also, if
you ask on the Rails list, you can find a lot more detail about the
magic, and a lot more people who've been through the experience you're
having. Sorry I can't do more.

So far, the Rails list has been unresponsive. On the other hand, since
we now have a horrendous slowdown in RUBY, i.e the unit tests being
15x slower on my (generally faster) machine than on Chet's, i fugre
the answer is in here somewhere anyway.

Regards,

Ron Jeffries
www.XProgramming.com

···

On Thu, 15 Nov 2007 22:55:42 -0500, Giles Bowkett <gilesb@gmail.com> wrote:

The system runs quite well EXCEPT for rails, which takes upwards of 30
seconds to do "rails -h". Nothing makes me think I have a general
performance problem.

Thanks,

Ron Jeffries
www.XProgramming.com

···

On Wed, 14 Nov 2007 09:36:46 -0500, "M. Edward (Ed) Borasky" <znmeb@cesmail.net> wrote:

My experience on Windows laptops (even more anecdotal than yours) is
that the hard drive is usually the bottleneck. And check your power
control settings -- you might be running with 1/3 processor speed, with
the hard drive spinning up and down between web hits, or other bizarre
notions geared to battery conservation modes even when you're plugged
into the wall.

But on my laptop, even though I run with everything at maximum speed
when plugged in, the hard drive is still beastly slow in Windows, so
it's usually booted into Linux. :slight_smile:

I had sent a reply to Ron that seems to have got lost - so, I'll just do
a reply to this email (since I've cleared the rest of the thread from my
mailbox).

Didn't get it, sorry ...

Ron, do you have any other version of Ruby installed on your PC?

No, ripped it off. Just one ruby.exe.

Also, InstantRails has a command called use_ruby.cmd in the main
directory. Go to a console, go to your instant rails directory and run
that first. Then, try to do rails -v.

I have 2 versions of Ruby on my PC (one's been left there since I
installed WideStudio).

If I don't run use_ruby.cmd first, Rails take 35 seconds to return a
version. After I do, it takes less than a second.

I believe when InstantRails launches a command prompt, it does the
use_ruby. All that does, actually, is add ruby and mysql to the path.
Ruby is already there, mySql isn't ... which I would think would make
some things not work at all, not work slowly.

Anyway, rails -v is 5 or 6 seconds even after use_ruby

<sigh/>

Ron Jeffries
www.XProgramming.com

···

On Fri, 16 Nov 2007 00:26:06 -0500, Mohit Sindhwani <mo_mail@onghu.com> wrote:

>My experience on Windows laptops (even more anecdotal than yours) is
>that the hard drive is usually the bottleneck. And check your power
>control settings -- you might be running with 1/3 processor speed, with
>the hard drive spinning up and down between web hits, or other bizarre
>notions geared to battery conservation modes even when you're plugged
>into the wall.
>
>But on my laptop, even though I run with everything at maximum speed
>when plugged in, the hard drive is still beastly slow in Windows, so
>it's usually booted into Linux. :slight_smile:

The system runs quite well EXCEPT for rails, which takes upwards of 30
seconds to do "rails -h". Nothing makes me think I have a general
performance problem.

Does it happen running irb, or other normal ruby scripts, or is it
strictly related to rails?

···

On Nov 14, 2007 9:15 AM, Ron Jeffries <ronjeffries@acm.org> wrote:

On Wed, 14 Nov 2007 09:36:46 -0500, "M. Edward (Ed) Borasky" > <znmeb@cesmail.net> wrote:

Thanks,

Ron Jeffries
www.XProgramming.com

--
===Tanner Burson===
tanner.burson@gmail.com
http://www.tannerburson.com

The system runs quite well EXCEPT for rails, which takes upwards of 30
seconds to do "rails -h". Nothing makes me think I have a general
performance problem.

I may have missed this in an earlier post, but what does running "ruby -v"
from the command line do? Does it take 30 seconds or does it return the
Ruby version immediately?

Yours,

Tom

I believe when InstantRails launches a command prompt, it does the
use_ruby. All that does, actually, is add ruby and mysql to the path.
Ruby is already there, mySql isn't ... which I would think would make
some things not work at all, not work slowly.

Anyway, rails -v is 5 or 6 seconds even after use_ruby

I'm assuming you invoke some particular .rb file to start your whole
rails app? (Or, if not, that you can at least find some .rb file
on your system that is the main .rb file that starts up rails?)

If you haven't already, I'd suggest trying what Caleb suggested:
putting: BasicSocket.do_not_reverse_lookup = true
at the top of that file.

If that doesn't help, I'd suggest trying: require "resolv-replace"
at the top of that .rb file.

If that doesn't help, I'd suggest adding the trace code I
posted yesterday to the top of that .rb file.

With the lengthy delays you've been experiencing, I'd imagine
the trace code may provide some confirmation as to exactly what
code is being executed at the time of the pause.

Hope this helps,

Bill

···

From: "Ron Jeffries" <ronjeffries@acm.org>

Ron Jeffries wrote:

I believe when InstantRails launches a command prompt, it does the
use_ruby. All that does, actually, is add ruby and mysql to the path.
Ruby is already there, mySql isn't ... which I would think would make
some things not work at all, not work slowly.

Anyway, rails -v is 5 or 6 seconds even after use_ruby

<sigh/>
  
Hmm.. I'm not sure where to look any more. :-S

Cheers,
Mohit.
11/16/2007 | 4:28 PM.

Ruby -v (print the version) is a bit slower on my machine than Chet's.
A ruby program counting to N is a small constant amount slower on my
machine, like one second slower no matter what N is, up to about
100,000.

A C# program counting to 1,000,000,000 runs the same on his machine
and mine.

When in the Rails ruby folder, we run
  ruby runner.rb ruby
Chet's machine takes about 6 seconds, and mine takes 93 seconds.

This is ruby tests, not rails. Other comparison tests our machines are
about the same, including a big loop in C#, starting visual studio,
starting eclipse, or starting Word. By and large, the machines run the
same speed. For Ruby, I'm 15x slower or worse.

Advise me, please. Thanks,

Ron Jeffries
www.XProgramming.com

···

On Wed, 14 Nov 2007 11:42:17 -0500, Tanner Burson <tanner.burson@gmail.com> wrote:

Does it happen running irb, or other normal ruby scripts, or is it
strictly related to rails?

Mohit Sindhwani wrote:

Ron Jeffries wrote:

I believe when InstantRails launches a command prompt, it does the
use_ruby. All that does, actually, is add ruby and mysql to the path.
Ruby is already there, mySql isn't ... which I would think would make
some things not work at all, not work slowly.

Anyway, rails -v is 5 or 6 seconds even after use_ruby

<sigh/>
  
Hmm.. I'm not sure where to look any more. :-S

Cheers,
Mohit.
11/16/2007 | 4:28 PM.

Hmmm ... maybe we should get an IRC channel up for hunting this down. I've got some friends who can usually nail something like this in less than an hour if it's a general Windows/laptop issue and not something in Ruby or Rails. I'm still clinging to the hope that it *is* a general Windows/laptop issue.

One thing you might try is CodeAnalyst from AMD. I think it works even on Intel processors, at least at the basic level. It will tell you if something is using a lot of *processor* time. If it's I/O, swapping, or some timeout, you won't see anything.