Webrick slow when running on a stand-alone system

I’ve developed a small app for a laptop using Webrick. It serves pages to
a local browser. It works great when the laptop is connected to the
internet. But when then laptop is running without an external network
connection it runs very slowly, with long pauses before serving a page. I
am guessing it is trying to do some kind of lookup and is timing out. Is
there a way to disable that behavior.

The problem is occuring on a Windows 98 box running Ruby 1.8.1 (with the
included Webrick).

Any ideas?

···


– Jim Weirich jim@weirichhouse.org http://onestepback.org

“Beware of bugs in the above code; I have only proved it correct,
not tried it.” – Donald Knuth (in a memo to Peter van Emde Boas)

My guess would be it’s doing a reverse lookup for a PTR record
based on ip address so it can log it by name. Just a guess,
though, since I’ve not used webrick.

-matt

···

On Sun, Feb 22, 2004 at 03:45:42PM +0900, Jim Weirich wrote:

I’ve developed a small app for a laptop using Webrick. It serves pages to
a local browser. It works great when the laptop is connected to the
internet. But when then laptop is running without an external network
connection it runs very slowly, with long pauses before serving a page. I
am guessing it is trying to do some kind of lookup and is timing out. Is
there a way to disable that behavior.

The problem is occuring on a Windows 98 box running Ruby 1.8.1 (with the
included Webrick).


matthew c. mead

http://www.goof.com/~mmead/

Just a hunch… try this at the beginning of the program:

Socket.do_not_reverse_lookup = true

I’ve heard this mentioned as the solution to several previous WEBrick
problems, and it seems like it might be related to yours.

HTH,

Nathaniel

<:((><

···

On Feb 22, 2004, at 01:45, Jim Weirich wrote:

I’ve developed a small app for a laptop using Webrick. It serves
pages to
a local browser. It works great when the laptop is connected to the
internet. But when then laptop is running without an external network
connection it runs very slowly, with long pauses before serving a
page. I
am guessing it is trying to do some kind of lookup and is timing out.
Is
there a way to disable that behavior.

The problem is occuring on a Windows 98 box running Ruby 1.8.1 (with
the
included Webrick).

Use ‘localhost’ ip address. It probably try to go out for dns lookup.

“Jim Weirich” jim@weirichhouse.org wrote in message
news:41608.216.23.123.202.1077432331.squirrel@weirichhouse.org

···

I’ve developed a small app for a laptop using Webrick. It serves pages to
a local browser. It works great when the laptop is connected to the
internet. But when then laptop is running without an external network
connection it runs very slowly, with long pauses before serving a page. I
am guessing it is trying to do some kind of lookup and is timing out. Is
there a way to disable that behavior.

The problem is occuring on a Windows 98 box running Ruby 1.8.1 (with the
included Webrick).

Any ideas?


– Jim Weirich jim@weirichhouse.org http://onestepback.org

“Beware of bugs in the above code; I have only proved it correct,
not tried it.” – Donald Knuth (in a memo to Peter van Emde Boas)

Nathaniel Talbott said:

Just a hunch… try this at the beginning of the program:

Socket.do_not_reverse_lookup = true

I’ve heard this mentioned as the solution to several previous WEBrick
problems, and it seems like it might be related to yours.

Good hunch. Unfortunately, it didn’t seem to do anything.

···


– Jim Weirich jim@weirichhouse.org http://onestepback.org

“Beware of bugs in the above code; I have only proved it correct,
not tried it.” – Donald Knuth (in a memo to Peter van Emde Boas)