[Beowulf] automount on high ports
Perry E. Metzger
perry at piermont.com
Wed Jul 2 15:31:51 PDT 2008
Greg Lindahl <lindahl at pbm.com> writes:
> Go look at code that actually uses priv ports to connect out. Normally
> the port is picked in the connect() call, and that means you can have
> all the 4-tuples. But for priv ports, you have to loop trying specific
> candidate ports under 1024 until you get one, and then connect out
> from it. (Here's where Linux doesn't try all 1024, because it doesn't
> want to use ports that are someone else's fixed port.) The kernel
> doesn't know at assignment time who you are connecting out to. In the
> end, this means that the port numbers are reused slowly, and you have
> to wait a TIME_WAIT time before reusing them.
It isn't quite that bad. You can use one of the SO_REUSE* calls in the
code to make things less dire. Apparently the kernel doesn't do that
for NFS client connection establishment, though. There is probably
some code to fix here.
Anyway, you may notice that I handed the original poster a hacky patch
that will let him use unprivileged ports. I still don't know if it is
necessary, but it may make his life less bad, we'll see.
> Now I'm week on the details today, but this was an issue that I dealt
> with long ago with PBS, which insists on using priv ports. So I ended
> up hacking the kernel on the PBS master to have a reduced TIME_WAIT
> time. Problem solved, yukko.
Perry E. Metzger perry at piermont.com
More information about the Beowulf