[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: TCPSocket#initialize slow on Windows

Victor 'Zverok' Shepelev

9/5/2008 9:38:00 AM

From: rogerpack2005@gmail.com [mailto:rogerpack2005@gmail.com]
Sent: Thursday, September 04, 2008 9:01 PM
>
>Victor 'Zverok' Shepelev wrote:
>> ruby 1.8.7 (2008-08-11 patchlevel 72) [i386-mswin32_71]
>>
>> TCPSocket.new('localhost', 80) takes something like 1.5-2 sec each call.
>> (Test program only consists of profiling of this line with ruby-prof).
>>
>> Can this be a bug or result of my misunderstanding of something
>> fundamental?
>>
>>
>> Thanks.
>>
>> V.
>
>Could try
>require 'resolv-replace' before hand, or using 127.0.0.1 instead of
>localhost.
>-=R

Seems to work... today :)

I've kinda tried 127.0.0.1 and it was the same slow... and after I've tried
your advice and required 'resolv-replace', all things became fast. But then,
when I commented out "require 'resolv-replace'", they are still fast. I'm
slightly shocked for now. Are there any explanations, or just it some kind
of network magic I'll never debug about?

Anyway, thank you for advice.

V.


1 Answer

Roger Pack

9/5/2008 3:53:00 PM

0

> I've kinda tried 127.0.0.1 and it was the same slow... and after I've
> tried
> your advice and required 'resolv-replace', all things became fast. But
> then,
> when I commented out "require 'resolv-replace'", they are still fast.
> I'm
> slightly shocked for now. Are there any explanations, or just it some
> kind
> of network magic I'll never debug about?
>
> Anyway, thank you for advice.

Kind of reminds me of OS X 10.5's DNS problems--the first lookup
sometimes takes 15s, then after that it's cached so it's fast. Maybe?
The fix for that on OS X was to switch to opendns name servers. Not
sure about XP tho.
-=R
--
Posted via http://www.ruby-....