Last active
March 2, 2024 16:18
-
-
Save qzi/b0cc89698d0d7a3affcc4c9d9f3c9b06 to your computer and use it in GitHub Desktop.
sysctl.conf.sh for macos
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Desc: network performance tunning for mac gateway and it should run using sudo | |
# increase the socket buffer | |
sysctl -w kern.ipc.maxsockbuf=16777216 | |
# net.inet.tcp.sendspace + net.inet.tcp.recvspace < kern.ipc.maxsockbuf | |
sysctl -w net.inet.tcp.sendspace=1048576 | |
sysctl -w net.inet.tcp.recvspace=1048576 | |
sysctl -w net.inet.tcp.win_scale_factor=8 | |
sysctl -w net.inet.tcp.autorcvbufmax=33554432 | |
sysctl -w net.inet.tcp.autosndbufmax=33554432 | |
# udp max ram | |
sysctl -w net.inet.udp.maxdgram=65500 | |
# increase the max num of socket connection | |
sysctl -w kern.ipc.somaxconn=2048 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment