Skip to content

Instantly share code, notes, and snippets.

@lxe
Last active December 29, 2015 00:39
Show Gist options
  • Save lxe/7587895 to your computer and use it in GitHub Desktop.
Save lxe/7587895 to your computer and use it in GitHub Desktop.
ludicrousspeed.sh
#!/bin/bash
# Some tweaks to OSX tcp/fd setting
# to ease load testing
#
# Disclaimer: I have no idea what i'm doing
#
# Descrease port hold time
sysctl -w net.inet.tcp.msl=1000
# Increase number of available ports
sysctl -w net.inet.ip.portrange.first=32768
# Increase socket connection limit
sysctl -w kern.ipc.somaxconn=1048576
# Increase file descriptor limit
launchctl limit maxfiles 2048 1048576
sysctl -w kern.maxfilesperproc=1048576
# This doesn't persist, but here it is anyways:
ulimit -S -n 1048576
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment