Is there a method in Linux to check how many ephemeral ports are left available? I occasionally see "Address already in use" errors as a result of running out of ephemeral ports. A machine reboot will resolve this but it would be better to catch it before it happens.
The ephermal port range is specified in
You can see the number of open connections using
If TIME_WAIT is the problem, you can set