On Thu, 15 Nov 2007 05:43:05 -0500, Eric H. [email protected]
wrote:
It’s a solid 8 seconds on my machine. But ordinary web page access is
nothing like that. What is this telling us?
Do you get the same result for the IP address (last field)?
I don’t understand the question.
I have seen problems where DNS is confused only for 127.0.0.1 or
localhost which leads to this terrible delay. Adding an entry to the
hosts file sometimes fixes this, but I’m not sure where it lives on
windows systems.
I know where the hosts file is … it looks like this:
127.0.0.1 localhost
127.0.0.1 www.mycookbook.com
127.0.0.1 typo
But I don’t understand what you might be getting at with respect to
changing it. I believe that hosts just contains some locally-specific
redirects, does it not?
Thanks,
Ron J.
www.XProgramming.com
On Thu, 15 Nov 2007 07:24:33 -0500, Alex Y. [email protected]
wrote:
He’s asking if the last element of this:
[“localhost”, [“test”], 2, “\177\000\000\001”]
is the same.
Still don’t understand. Same as what?
I’m entering this line at the command prompt:
ruby -rsocket -e ‘p Socket.gethostbyname(“127.0.0.1”)’ [“localhost”,
[“test”], 2, “\177\000\000\001”]
(all on one line)
and after 6 seconds at Borders and 8 at home, it echoes:
[“localhost”, [], 2, “\177\000\000\001”]
This is possibly a long shot, but what’s in your RUBYOPT environment
variable?
it contains:
-rubygems
with the dash.
Ron J.
www.XProgramming.com
Ron J. wrote:
On Thu, 15 Nov 2007 07:24:33 -0500, Alex Y. [email protected]
wrote:
He’s asking if the last element of this:
[“localhost”, [“test”], 2, “\177\000\000\001”]
is the same.
Still don’t understand. Same as what?
Ah, I see. I believe Eric was originally asking you to enter only this
command:
ruby -rsocket -e ‘p Socket.gethostbyname(“127.0.0.1”)’
which should (and apparently does) print:
[“localhost”, [“test”], 2, “\177\000\000\001”]
to the console. The section “\177\000\000\001” is the binary
representation of the IP address that the gethostbyname system call
actually used (I think - slightly outside my area), and if it had been
different it would have indicated DNS or low-level IP weirdery. I
think.
This is possibly a long shot, but what’s in your RUBYOPT environment
variable?
it contains:
-rubygems
If you remove it (set RUBYOPT=“”), does the time taken to run your
counting script improve? I can’t think of any reason that it should
(barring AV-scanning of opened files), but it might narrow the scope a
little.
Ron J. wrote:
user 0m0.010s
sys 0m0.009s
It’s a solid 8 seconds on my machine. But ordinary web page access is
nothing like that. What is this telling us?
Do you get the same result for the IP address (last field)?
I don’t understand the question.
He’s asking if the last element of this:
[“localhost”, [“test”], 2, “\177\000\000\001”]
is the same.
This is possibly a long shot, but what’s in your RUBYOPT environment
variable?
On Nov 15, 2007 7:00 AM, Ron J. [email protected] wrote:
real 0m0.042s
I have seen problems where DNS is confused only for 127.0.0.1 or
But I don’t understand what you might be getting at with respect to
changing it. I believe that hosts just contains some locally-specific
redirects, does it not?
Just a SWAG, but. time ruby -rsocket -e ‘p
Socket.gethostbyname(“127.0.0.1”)’
is doing a reverse-“DNS” lookup. Might windoze be confused by having
127.0.0.1 map to three different hostnames in the hosts file?
–
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/
Just a SWAG, but. time ruby -rsocket -e ‘p Socket.gethostbyname(“127.0.0.1”)’
is doing a reverse-“DNS” lookup. Might windoze be confused by having
127.0.0.1 map to three different hostnames in the hosts file?
At least on Linux, when I’ve had big slowdowns like this, throwing in
BasicSocket.do_not_reverse_lookup = true
made things run much faster.
I think we’ve discussed this issue on the list before, too.
Giles B. wrote:
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.
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 B.
Podcast: http://hollywoodgrit.blogspot.com
Blog: http://gilesbowkett.blogspot.com
Portfolio: http://www.gilesgoatboy.org
Tumblelog: http://giles.tumblr.com
On Thu, 15 Nov 2007 22:55:42 -0500, Giles B. [email protected]
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.
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 J.
www.XProgramming.com
On Fri, 16 Nov 2007 00:26:06 -0500, Mohit S.
[email protected] wrote:
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
Ron J.
www.XProgramming.com
On Thu, 15 Nov 2007 11:52:02 -0500, Rick DeNatale
[email protected] wrote:
Just a SWAG, but. time ruby -rsocket -e ‘p Socket.gethostbyname(“127.0.0.1”)’
is doing a reverse-“DNS” lookup. Might windoze be confused by having
127.0.0.1 map to three different hostnames in the hosts file?
Tried it. No effect. This is so confusing …
Ron J.
www.XProgramming.com
Ron J. 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
Hmm… I’m not sure where to look any more. :-S
Cheers,
Mohit.
11/16/2007 | 4:28 PM.
From: “Ron J.” [email protected]
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 J. [mailto:[email protected]]
it contains:
-rubygems
with the dash.
remove it.
then go to the folder where ruby.exe resides.
then try creating and running a simple program like,
sample.rb
5.times {puts “hello, world”}
.\ruby sample.rb
let us narrow it down to pure ruby first by avoiding gem loading and
long path traversals…
kind regards -botp
Hi,
On 16-Nov-07, at 3:48 AM, Peña, Botp wrote:
From: Ron J. [mailto:[email protected]]
it contains:
-rubygems
with the dash.
remove it.
I second this.
In fact, can you create a brand new user on your machine, log in as
that user, and try it from there?
Cheers,
Bob
Mohit S. wrote:
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.
On Nov 16, 2007 5:45 PM, Rick DeNatale [email protected] wrote:
some timeout, you won’t see anything.
I’d suggest finding an analog to strace for windows. I’m pretty sure
such a beast exists.
you can start with either:
- PerfMon - will show you bytes/s read/written from/to memory, the
same for disk io
- ProcExp - will show you open files, handles, threads, current call
stack of the threads
- WinDbg - shows call stack, memory, you can set breakpoints in system
calls,…
- kdb - for kernel debugging
Jano
On Nov 16, 2007 10:13 AM, M. Edward (Ed) Borasky [email protected]
wrote:
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.
I’d suggest finding an analog to strace for windows. I’m pretty sure
such a beast exists.
–
Rick DeNatale
My blog on Ruby
http://talklikeaduck.denhaven2.com/
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.
Thanks,
Ron J.
www.XProgramming.com
On Fri, 16 Nov 2007 03:48:56 -0500, Peña, Botp
[email protected] wrote:
then try creating and running a simple program like,
sample.rb
5.times {puts “hello, world”}
\ruby sample.rb
let us narrow it down to pure ruby first by avoiding gem loading and long path traversals…
I think I reported earlier but may not have. Simiple ruby programs
like counting start a bit slower on my machine but then seem to run
just as fast as on Chet’s. OTOH the Ruby unit tests go slowly.
I’m thinking I’ll try turning off the rubygems thing and if that
doesn’t crack it, try a full reinstall of Ruby. Cheaper than a new
computer, which I’m sure would fix it. 
Thanks … keep those cards and letters coming.
Ron J.
www.XProgramming.com