lkml.org 
[lkml]   [1999]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: > 15K simultaneous connections EXAMPLE program/OS config needed, was: Re: POSIX aio vs completion ports
Date
From
Steve Underwood wrote:
[Charset big5 unsupported, skipping...]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ grrrrr.

> Rogier Wolff wrote:
>
> > [...]
>
> > If you're handling lots of outgoing connections (unlikely), you might
> > run into trouble. Suppose we want ephemeral (sp?) ports, the kernel
> > might say "Sorry, none found" when you've used all of them. This is
> > incorrect (but nobody has run into it yet). After one round around the
> > port space searching for an unused port, the kernel should just
> > allocate a port that's already used. Then you can connect to any
> > IP/port, except the one that the existing connection is already
> > connected to. If the kernel knows the destination IP/port at that
> > time, it should try to avoid that situation. Otherwise, it should just
> > hope for the best.

> I'm not sure what you are saying here. I've never hit the limit,
> even during flood testing stuff, so I don't know what actually
> happens. Are you implying that other Unixen reallocate an already
> used port, without the use of SO_REUSEADDR, or that you think they
> should? I had always assumed, but never explicitly read, that
> without SO_REUSEADDR there would never be reuse of the local port.

No, I really don't know what other Unixen do. SO_REUSEADDR seems to
indicate that you're willing to allow another local user of the port.

On the other hand, if I request a ephemeral port, I expect to get a
useable port from the system (usually for OUTGOING connections), which
is useable for the purpose I intended. So if "servers" keep getting
bigger and bigger, as they are now, we're going to see departemental
servers having tens of thousands outgoing connections in the near
future. If we require "SO_REUSEADDR" in that case before we give a
port number out a second time, we'd need to modify all applications.

I think maybe we should think about what the best way is to outgrow
this 16 bit portnumber restriction. If we have to force applications
to set SO_REUSEADDR on ephemeral ports, we might start warning
application-authors now. (All applications except ftpd want this!)

> One PITA with port allocation is that you can't reserve the darned things.

You reserve it by allocating it...

> You are running a server. It dies. You try to restart it, and find some
> client type program has just been allocated your port. Ugh!

Either run your server from inittab, so that it gets restarted really
quickly, or write a shadow deamon that just allocates the port with
SO_REUSEADDR set, so that the real deamon (whcih you say occasionally
dies) can bind to the same port afterwards.

Roger.

--
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
------ Microsoft SELLS you Windows, Linux GIVES you the whole house ------


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:54    [W:0.058 / U:1.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site