Rails incredibly slow (update)

On 16-Nov-07, at 10:45 PM, Ron J. wrote:

On Fri, 16 Nov 2007 07:51:51 -0500, Bob H. [email protected]
wrote:

In fact, can you create a brand new user on your machine, log in as
that user, and try it from there?

Interesting. I’m hoping to get some time tomorrow to play with this,
and I might add that to the list of things to try.

Did you get a chance to try this? If not you might want to. It has a
chance of partitioning the possible solution space between the
configuration of your machine and the configuration of your login. My
experience with windows is that either can be a problem in very
interesting ways.

Cheers,
Bob

Thanks,

Ron J.
www.XProgramming.com


Bob H. – tumblelog at
http://www.recursive.ca/so/
Recursive Design Inc. – weblog at
http://www.recursive.ca/hutch
http://www.recursive.ca/ – works on
http://www.raconteur.info/cms-for-static-content/home/

On Mon, 19 Nov 2007, Ron J. wrote:

Way more cryptic than I needed. Thanks.

Always a pleasure to render a persons day more surreal. May the force
squeak you!

Which make me think 5 lines. Wonder what’s up with that. Might be
interesting to zero in on …

Nah. Googling for that code turns it up in a standard ruby test. I
willing to bet for some reason the mere invocation of ruby is what is
slow.

For some reason something somewhere is attempting to do lots when you
fire up ruby. Guesses…

  • That ruby.exe is infected with a virus that is attempting to Take
    Over the World on start up.

  • You have some weird default module special that at start up
    attempts to phone home and perhaps update itself, but hits a
    firewall and timesout. (Weird very unlikely)

  • Some virus scanner is seeing the ruby subprocess start up and is
    going
    paranoid and scanning it.

Absolutely no blooming way should on a remotely healthy installation
of ruby should those few lines be taking a “human noticable” length of
time.

If you can find a Windows equivalent of that most invaluable of Unix
utilities, “strace” (do tell me where you got it when you do) get it
to strace which files ruby opens on startup and send that to the
group. strace is mankinds best and most loyal friend, never leave home
without it.

My personal guess is you have a virus.

John C. Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : [email protected]
New Zealand

Update:

Rather than follow any of the radical solutions like new computers or
formatting my hard drive, I purchased and downloaded some system
cleaning tools from uniblue software.

Ran them and the Ruby tests now run //faster// than Chet’s machine.
And for some reason, the total number of I/Os recorded has dropped
from 65,000 to 25,000.

Not a solution, since I don’t know what the problem was. But as a FIX
goes, cheap and easy.

Thanks to all for the help and ideas. It kept me moving and some of
the tools I downloaded look like they’ll be handy in the future.

Thanks again,

Ron J.
www.XProgramming.com

From: “Ron J.” [email protected]

Update:

Rather than follow any of the radical solutions like new computers or
formatting my hard drive, I purchased and downloaded some system
cleaning tools from uniblue software.

Ran them and the Ruby tests now run //faster// than Chet’s machine.
And for some reason, the total number of I/Os recorded has dropped
from 65,000 to 25,000.

Wow - weird! :smiley:

Regards,

Bill

On Nov 20, 2007 11:04 AM, Ron J. [email protected] wrote:

Not a solution, since I don’t know what the problem was. But as a FIX
goes, cheap and easy.

Egads!!!

Strangely unsatisfying after following this epic.

Kind of like the last episode of “The Sopranos”


Rick DeNatale

My blog on Ruby
http://talklikeaduck.denhaven2.com/

On Mon, 19 Nov 2007 18:27:24 -0500, John C.
[email protected] wrote:

My personal guess is you have a virus.

McAfee doesn’t agree. They could be wrong, I suppose. I’m running all
kinds of scanners and optimizers just now, on general principles.
We’ll see.

I’ll report back on the other stuff as I get time to chase it …

Thanks,

Ron J.
www.XProgramming.com

Ron J. wrote:

Not a solution, since I don’t know what the problem was. But as a FIX
goes, cheap and easy.

Thanks to all for the help and ideas. It kept me moving and some of
the tools I downloaded look like they’ll be handy in the future.

Thanks again,

Ron J.
www.XProgramming.com
Its good that you have it resolved. Do you know what the tools did?

I have suspected that your problem might have had to do lots of files in
some directory that Ruby or Rails searches frequently. Another
possibility is an accumulation of junk in the Windows environment
variables. Perhaps the drive was badly fragmented.

Bill Rutiser

On Wed, 21 Nov 2007, Ron J. wrote:

Not a solution, since I don’t know what the problem was. But as a FIX
goes, cheap and easy.

Well… you’re not sure what the proximate cause is. Probably virus /
spyware. The ultimate cause is Windows. Replace with Linux and the
problem won’t come back. Can I recommend…
http://www.ubuntu.com/

John C. Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : [email protected]
New Zealand

John C. wrote:

On Wed, 21 Nov 2007, Ron J. wrote:

Not a solution, since I don’t know what the problem was. But as a FIX
goes, cheap and easy.

Well… you’re not sure what the proximate cause is. Probably virus /
spyware. The ultimate cause is Windows. Replace with Linux and the
problem won’t come back. Can I recommend…
http://www.ubuntu.com/

Of course you can! But I’ll see your Ubuntu and raise you a Gentoo!

Bill K. wrote:

And for some reason, the total number of I/Os recorded has dropped

Not really – sounds like a fragmented drive. By the way, Windows XP
does have a defragmenter built in and can do some cleaning, but the
commercial tools are worth the money. I’m guessing, since he was
experimenting with Rails, that the IE caches were full of doodoo.

And to John C. – Linux gets fragmented and crap buildup on hard
drives too. But the filesystems are a tad more efficient, especially the
non-ext3 ones. :slight_smile: Reiser 3 is a good compromise, but there are faster
ones.

From: “M. Edward (Ed) Borasky” [email protected]

Ran them and the Ruby tests now run //faster// than Chet’s machine.
And for some reason, the total number of I/Os recorded has dropped
from 65,000 to 25,000.

Wow - weird! :smiley:

Not really – sounds like a fragmented drive.

I was assuming all the different odd slowdowns discussed on
the thread were remedied. (Including the 15 second
Socket.gethostbyname on localhost.) Maybe I shouldn’t assume
that.

But still, a 15x speedup just from a defrag??? That would still
fit the ‘weird’ category from my personal experience. (But then,
I have zero experience with tablet PC’s.)

Regards,

Bill

(The 15x figure comes from earlier on the thread where Ron was
comparing various rails tasks on his system compared to Chet’s.)

On Wed, 21 Nov 2007, M. Edward (Ed) Borasky wrote:

Not really – sounds like a fragmented drive. By the way, Windows XP does
have a defragmenter built in and can do some cleaning, but the commercial
tools are worth the money. I’m guessing, since he was experimenting with
Rails, that the IE caches were full of doodoo.

And to John C. – Linux gets fragmented and crap buildup on hard drives
too. But the filesystems are a tad more efficient, especially the non-ext3
ones. :slight_smile: Reiser 3 is a good compromise, but there are faster ones.

Not on your nelephant. Never has fragmentation slowed the many linux
systems under my control by that amount. (And I’ve been using Linux
since 0.9 versions)

I sincerely doubt that it would slow even windoze by so much either. I
suspect the much hated “Observer Pattern” or “come from” statement.

Pull up a friendly instance of Windows Explorer.

Open it on a folder.

Modify the folder. Ooh. Looky Windows Explorer updates instantly to
reflect the change.

Now do the same with another ten instances.

Modify the folder. Ooh looky they all update.

Now permit everything and it’s brother and it’s cuz who came along cos
he’s a voyeur and sissy who wants to tell on you and and and and and…
to
register to be informed of updates to the file system.

Try do something to your filesystem.

Wow! It’s slow! I wonder why?

Compare with Linux. Modify filesystem. Nothing happened. Ah! I have to
click on the refresh button. Hokay. Theres the change.

But by golly oh, it runs like the wind…

…or you can write a tool to run around deregistering nearly
everybody, which is what I suspect Ron’s nifty tool does.

The flip side is a bunch of his installed programs are not going to
see external file system updates until he refreshes or restarts the app.

However since a lot of these nosy parker apps were probably spyware
and the like… he won’t care.

John C. Phone : (64)(3) 358 6639
Tait Electronics Fax : (64)(3) 359 4632
PO Box 1645 Christchurch Email : [email protected]
New Zealand

On Tue, 20 Nov 2007 12:37:29 -0500, William R.
[email protected] wrote:

Its good that you have it resolved. Do you know what the tools did?

I have suspected that your problem might have had to do lots of files in
some directory that Ruby or Rails searches frequently. Another
possibility is an accumulation of junk in the Windows environment
variables. Perhaps the drive was badly fragmented.

Mostly the tools cleaned the registry and did some mumbo-jumbo about
removing file pointers that were bad. Nothing that looked like it
would obviously improve much of anything. The spy eraser found a few
things. the SpeedUpMyPC part cleaned up memory, whatever that means,
and “junk files” that “clutter up your system and reduce performance”.

None of it was very interesting. The hard drive was NOT defragged
until later. After degfragging a bit, the tests run in 33 seconds the
first time and 15 the second. (This strikes me as odd also.)

All in all, very magical and unsatisfying. But the problem is gone and
I think I’ll just pretend it never happened. I have other things I’d
rather learn about if I can …

Ron J.
www.XProgramming.com

On Tue, 20 Nov 2007 15:09:41 -0500, John C.
[email protected] wrote:

On Wed, 21 Nov 2007, Ron J. wrote:

Not a solution, since I don’t know what the problem was. But as a FIX
goes, cheap and easy.

Well… you’re not sure what the proximate cause is. Probably virus /
spyware. The ultimate cause is Windows. Replace with Linux and the
problem won’t come back. Can I recommend…
http://www.ubuntu.com/

Honestly, John, I see no way that moving from Windows to Linux is a
reasonable step for someone who is totally not a Linux user. I’ve
programmed in almost every operating system and language and computer
known to man … but never Unix / Linux. It seems to me that the
investment in learning how to operate a Linux system, and getting my
home network and music software … up on it … wouldn’t pay off.

Might be “fun” …

Ron J.
www.XProgramming.com

Ron J. wrote:

Mostly the tools cleaned the registry and did some mumbo-jumbo about
removing file pointers that were bad. Nothing that looked like it
would obviously improve much of anything. The spy eraser found a few
things. the SpeedUpMyPC part cleaned up memory, whatever that means,
and “junk files” that “clutter up your system and reduce performance”.

An over-full temp folder can cause an application to slow down to
nothing. Happens more often when the required temp file names are
prefixed.

None of it was very interesting. The hard drive was NOT defragged
until later. After degfragging a bit, the tests run in 33 seconds the
first time and 15 the second. (This strikes me as odd also.)

Why would that be odd? The 2nd time, it’d be in the cache?

Best regards,

Jari W.

On Tue, 20 Nov 2007 12:23:52 -0500, Rick DeNatale
[email protected] wrote:

Egads!!!

Strangely unsatisfying after following this epic.

Kind of like the last episode of “The Sopranos”

Yes, it is unsatisfying. But at least cheaper than converting to Mac
or Linux, as some correspondents suggested. :slight_smile:

Ron J.
www.XProgramming.com

Honestly, John, I see no way that moving from Windows to Linux is a
reasonable step for someone who is totally not a Linux user. I’ve
programmed in almost every operating system and language and computer
known to man … but never Unix / Linux. It seems to me that the
investment in learning how to operate a Linux system, and getting my
home network and music software … up on it … wouldn’t pay off.

Might be “fun” …

A thousand apologies for going there but the experience of migrating
to OS X from Windows is much cleaner, and gives you a way to get
started with Unix to boot, without the Linux learning curve. OS X -
the Unix gateway drug.

Sorry! Now back to your regularly-scheduled list. It sounds as if
whoever wrote the system cleaning software knew Windows better than we
do. (Which is pretty logical.) It would be cool if we knew what
happened, though, since it may come up again for another person.


Giles B.

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

On Fri, 23 Nov 2007 17:16:16 -0500, Giles B. [email protected]
wrote:

A thousand apologies for going there but the experience of migrating
to OS X from Windows is much cleaner, and gives you a way to get
started with Unix to boot, without the Linux learning curve. OS X -
the Unix gateway drug.

Yes, I suspect that’s very true …

Sorry! Now back to your regularly-scheduled list. It sounds as if
whoever wrote the system cleaning software knew Windows better than we
do. (Which is pretty logical.) It would be cool if we knew what
happened, though, since it may come up again for another person.

Yes. I hate shotgun fixes, though as they go, this was a good one!

Ron J.
www.XProgramming.com

Ron J.-3 wrote:

The disk cache you mean? I suppose that could be the difference.

Ron J.
www.XProgramming.com

Ron,

Go to to the config subdirectory in the directory you’re working at
(i.e.
the directory you’ve created with the command ‘rails directoryname’).
Use a
text editor to edit a file called environment.rb. Comment out (by using
#)
line 8:
RAILS_GEM_VERSION = ‘1.2.5’ unless defined? RAILS_GEM_VERSION

this line becomes (after commenting out)

#RAILS_GEM_VERSION = ‘1.2.5’ unless defined? RAILS_GEM_VERSION

go to your command prompt. type

$ ruby script\server

… and feel the beeze on your face…LOL

Good luck,

Nabil

On Fri, 23 Nov 2007 04:28:33 -0500, Jari W.
[email protected] wrote:

None of it was very interesting. The hard drive was NOT defragged
until later. After degfragging a bit, the tests run in 33 seconds the
first time and 15 the second. (This strikes me as odd also.)

Why would that be odd? The 2nd time, it’d be in the cache?

The disk cache you mean? I suppose that could be the difference.

Ron J.
www.XProgramming.com