Connection error in webrick server


#1

I did a simple server in ruby using webrick as shown in the
tutorial. My problem is that when I tested it with several
client connection, a number of connections were refused. I
can’t find the reason why this happens, even though the default
maximum concurrent client is set to 100. I only made 50 concurrent
connections but more than 10 connections are often refused. Can
anyone explain the reason for this.

I also tried changing the default value to a higher value but to no
avail.

Thanks.


#2

On 27.10.2008 07:06, Cedric Rosario wrote:

I did a simple server in ruby using webrick as shown in the
tutorial. My problem is that when I tested it with several
client connection, a number of connections were refused. I
can’t find the reason why this happens, even though the default
maximum concurrent client is set to 100. I only made 50 concurrent
connections but more than 10 connections are often refused. Can
anyone explain the reason for this.

I also tried changing the default value to a higher value but to no
avail.

What error message did you see? Are there firewalls in between? Did
you use hostname for the server URL and can this name be resolved on all
hosts? …

Kind regards

robert


#3

Robert K. wrote:

What error message did you see? Are there firewalls in between? Did
you use hostname for the server URL and can this name be resolved on all
hosts? …

Kind regards

robert

This was the error message…
Errno::ECONNREFUSED: Connection refused - “connect(2)”

There are no firewalls set, and I am only using a single computer for
this.
I used the ip address instead of the hostname.

Thanks.

cedric


#4

Robert K. wrote:

Hm… Is the hosting system a Windows non server version? That could
play a role as well. Or, your Webrick dies for some reason and hence
you cannot connect any more. There are so many options where network
communication can go wrong…

Cheers

robert

I tested it both on a Windows non-server and server versions but the
results
were the same. The Webrick does not die because it still accepts
connections
whenever I run the my test program. My only problem is that it doesn’t
accept
all the connections.

Thanks.

cedric


#5

2008/10/27 cedric so removed_email_address@domain.invalid:

This was the error message…
Errno::ECONNREFUSED: Connection refused - “connect(2)”

There are no firewalls set, and I am only using a single computer for
this.
I used the ip address instead of the hostname.

Hm… Is the hosting system a Windows non server version? That could
play a role as well. Or, your Webrick dies for some reason and hence
you cannot connect any more. There are so many options where network
communication can go wrong…

Cheers

robert


#6

On 27.10.2008 23:22, cedric so wrote:

whenever I run the my test program. My only problem is that it doesn’t
accept
all the connections.

Did you check connection state with netstat? It may be that socket
resources are not released fast enough. I’m not a network admin but it
may be that you can remedy this with a changed timeout setting.

Kind regards

robert