TCP ports - TIME_WAIT

What is the maximum number of TCP ports that can be consumed at any one time? How can I determine what the number is or increase it?

I was under the impression that with our system (UnixWare 7.1.1) 1024 was the maximum under our current Kernel tuning parms, but I think that is really just for telnet and not all TCP ports combined.

The reason I ask? Because our Unix server makes calls to a Windows 2000 machine all day long and there have been times that the number of ports stuck simultaneously in TIME_WAIT between these 2 machines has been nearly 1500 (1499 to be exact) and I'm concerned that we'll run out.

Any help is greatly appreciated.

:confused:

A protocol address (Port Number and Ipaddress) will stuck in TIME_WAIT state for maximum of 2MSL which I think is 2 minutes (I coudnt remembered it correctly). So once the TIME_WAIT is over that protocol address will be released and can be used at any time.

Regards,
Yeheya

Thanks... My concern isn't really the amount of time that the ports remain open - I know I can change the parameters in the Kernel. My concern is that there are sometimes nearly 1500 ports open simultaneously and I'd hate for the server to crash do to all TCP ports being utilized.

:confused:

I think the maximum number of TCP port numbers that can be opened are 65536 -1024 = 64512, ignoring the well-known ports. Otherwise I don't see any restriction for TCP port.

Regards,
Yeheya

It almost sounds as if the design should be modifed a bit-

Personally, I'd modify it to include a backlog for possible connections (The number will be something OS-specific, and I don't know what that is for SCO)- Kernel modifications sometimes allow for multiple connections to be backlogged. On top of that, I'd probably look into something to speed up what ever task is performed on the host machine, forking, threading (if you want it to be a huge task)-

Remember, you have to keep track of all opened connections, and allowing a box with every last opened port presents you with somewhat of a resource concern, not to mention security problem (Should also be addressed)-