Skip to content

Instantly share code, notes, and snippets.

@mrevjd
Created November 16, 2024 00:19
Show Gist options
  • Select an option

  • Save mrevjd/f73148c50a70f27fbe52377ed6040168 to your computer and use it in GitHub Desktop.

Select an option

Save mrevjd/f73148c50a70f27fbe52377ed6040168 to your computer and use it in GitHub Desktop.
Sysctl Tweaks
# vi /etc/sysctl.d/1000-custom.conf
# sysctl -p /etc/sysctl.d/1000-custom.conf
# Or
# vi /etc/sysctl.conf and append to end of file
# sysctl -p
# Max connections
net.core.somaxconn = 65536
# Implement RFC 1337 fix
net.ipv4.tcp_rfc1337 = 1
# Enables Path MTU discovery for TCP connections.
net.ipv4.tcp_mtu_probing=1
# This will increase the amount of memory available for socket input/output queues
net.core.wmem_max = 16777216
net.core.wmem_default = 131072
net.core.rmem_max = 16777216
net.core.rmem_default = 131072
net.ipv4.tcp_rmem = 4096 131072 16777216
net.ipv4.tcp_wmem = 4096 131072 16777216
net.ipv4.tcp_mem = 4096 131072 16777216
net.core.netdev_max_backlog = 30000
# Decrease the time default value for tcp_fin_timeout connection
net.ipv4.tcp_fin_timeout = 5
# Decrease the time default value for tcp_keepalive_time connection
net.ipv4.tcp_keepalive_time = 300
# Decrease the time default value for tcp_keepalive_intvl connection
net.ipv4.tcp_keepalive_intvl = 15
# Turn on the tcp_window_scaling
net.ipv4.tcp_window_scaling = 1
# Turn on the tcp_sack
net.ipv4.tcp_sack = 1
# tcp_fack should be on because of sack
net.ipv4.tcp_fack = 1
# Modern congestion control
net.ipv4.tcp_congestion_control = bbr
net.core.default_qdisc = fq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment