Mac上临时端口的范围是多少? [英] What is the range of ephemeral ports on mac?

查看:303
本文介绍了Mac上临时端口的范围是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试对一个Web框架进行基准测试,并阅读到没有足够的免费临时端口会伪造结果.不幸的是,我还没有在Mac上找到临时端口范围,或者如何显示该端口范围?

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 ?

推荐答案

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

这篇关于Mac上临时端口的范围是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆