Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
OSX - Tuning the Network Stack TCP
## Quick fix for slow internet after update to OSX 10.11 "El Capitan"
## Changes are not permanent, just restart your mac if it doesn't work.
## write config
sudo su -
sysctl -w net.inet.tcp.doautorcvbuf=0
sysctl -w net.inet.tcp.doautosndbuf=0
sysctl -w net.inet.tcp.win_scale_factor=0
sysctl -w kern.ipc.somaxconn=2048
sysctl -w net.inet.tcp.rfc1323=1
sysctl -w net.inet.tcp.win_scale_factor=4
sysctl -w net.inet.tcp.sendspace=1042560
sysctl -w net.inet.tcp.recvspace=1042560
sysctl -w net.inet.tcp.mssdflt=1448
sysctl -w net.inet.tcp.v6mssdflt=1412
sysctl -w net.inet.tcp.msl=15000
sysctl -w net.inet.tcp.always_keepalive=0
sysctl -w net.inet.tcp.delayed_ack=3
sysctl -w net.inet.tcp.slowstart_flightsize=20
sysctl -w net.inet.tcp.local_slowstart_flightsize=9
sysctl -w net.inet.tcp.blackhole=2
sysctl -w net.inet.udp.blackhole=1
sysctl -w net.inet.icmp.icmplim=50
## read config
sysctl net.inet.tcp.doautorcvbuf
sysctl net.inet.tcp.doautosndbuf
sysctl net.inet.tcp.win_scale_factor
sysctl kern.ipc.somaxconn
sysctl net.inet.tcp.win_scale_factor
sysctl net.inet.tcp.sendspace
sysctl net.inet.tcp.recvspace
sysctl net.inet.tcp.mssdflt
sysctl net.inet.tcp.v6mssdflt
sysctl net.inet.tcp.msl
sysctl net.inet.tcp.always_keepalive
sysctl net.inet.tcp.delayed_ack
sysctl net.inet.tcp.slowstart_flightsize
sysctl net.inet.tcp.local_slowstart_flightsize
sysctl net.inet.tcp.blackhole
sysctl net.inet.udp.blackhole
sysctl net.inet.icmp.icmplim
@jjbailey
Copy link

jjbailey commented Aug 18, 2018

sysctl -w net.inet.tcp.win_scale_factor=0
then
sysctl -w net.inet.tcp.win_scale_factor=4

I imagine you want the second choice.

@ns-skalagara
Copy link

ns-skalagara commented Oct 12, 2022

how do I make these changes persistent ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment