Skip to content

Instantly share code, notes, and snippets.

@pablote
Last active March 8, 2017 16:20
Show Gist options
  • Save pablote/54c19c7a9a45e3d1e62e672a897413fd to your computer and use it in GitHub Desktop.
Save pablote/54c19c7a9a45e3d1e62e672a897413fd to your computer and use it in GitHub Desktop.
Improve OSX ephemeral port usage (useful for apachebench testing)
# check current values
sysctl net.inet.tcp.msl
sysctl net.inet.ip.portrange.last
sysctl net.inet.ip.portrange.first
# update
sudo sysctl -w net.inet.ip.portrange.first=32768
sudo sysctl -w net.inet.tcp.msl=1000
# revert to defaults
sudo sysctl -w net.inet.ip.portrange.first=49152
sudo sysctl -w net.inet.tcp.msl=15000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment