What is the range of ephemeral ports on mac?

2019-06-22 08:21发布

问题:

I am trying to benchmark a web framework and read that not having enough free ephemeral ports can falsify the results. Unfortunately, I haven't found what the ephemeral port range is on my mac, or how to display it ?

回答1:

Here, a good article on the topic, addressing also the issue of TIME_WAIT for ephemeral ports. The port range on macOS can be displayed by:

>> sysctl net.inet.ip.portrange.first net.inet.ip.portrange.last
net.inet.ip.portrange.first: 49152
net.inet.ip.portrange.last: 65535


标签: macos tcp