Hi,

Yes, this is on a lower level. It goes all the
way down to the BSD sockets network syscall 
listen(2), and how connection-oriented transport
services (TCP) are implemented on top of a
connection-less network service (IP).

In Java this is seen in java.net.ServerSocket:
The backlog argument to the constructor determines
how many incoming connect requests that have not
yet been accepted will be enqueued. When this
limit is hit, the kernel TCP/IP implementation will
return a "connection refused" error to the caller.

This happens because clients send connection
requests at a higher rate than the server can do
the accept().

The problem really cannot be fixed, but by setting
the backlog higher it takes more for it to become
visible. Unfortunately a higher backlog value makes
the server more sensitive to some kinds of DoS
attacks. And IMHO the default backlog value of 50
in the ServerSocket is already quite high.

So I would recommend that nothing is done at
server side to fix this.
Rather, test clients that start a lot of connections
should ensure that they do not have too many 
outstanding connection requests. A simple delay
between thread starts in the client also works, if
longer than the time it takes the server to do the
accept.


Best Regards,

Ole Husgaard.


"Rickard Öberg" wrote:
> 
> Hi!
> 
> Achim Demelt wrote:
> > Well, any concrete ideas for a solution? As I said, I wrote my own
> > RMISocketFactory and the container factory says that it created one of my
> > ServerSockets which should be able to handle 10000 incoming connections in
> > the backlog queue. Why do things still go wrong?
> 
> To be honest, I don't know. It might be a problem on a lower level, e.g.
> the JVM or OS level. In that case there's not a lot you can do about it.
> 
> Nevertheless, the scenario is probably not likely to occur in a
> production environment, so why bother with it?
> 
> regards,
>   Rickard
> 
> --
> Rickard Öberg
> 
> Email: [EMAIL PROTECTED]
> 
> --
> --------------------------------------------------------------
> To subscribe:        [EMAIL PROTECTED]
> To unsubscribe:      [EMAIL PROTECTED]
> List Help?:          [EMAIL PROTECTED]


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
List Help?:          [EMAIL PROTECTED]

Reply via email to