Skip to content
This repository has been archived by the owner on Mar 29, 2024. It is now read-only.

Commit

Permalink
Add sysctl for server configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Jan 18, 2022
1 parent e50426f commit 39485c1
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions tools/sysctl.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
## Kernel Optimizations for few very high bandwidth connections.

# Quickly with this:
# curl -fsSL https://updates.safing.io/internal/sysctl.conf > /etc/sysctl.d/9999-spn-network-optimizing.conf
# cat /etc/sysctl.d/9999-spn-network-optimizing.conf
# sysctl -p /etc/sysctl.d/9999-spn-network-optimizing.conf

# Provide adequate buffer memory.
# net.ipv4.tcp_mem is in 4096-byte pages.
net.core.rmem_max = 1073741824
net.core.wmem_max = 1073741824
net.core.rmem_default = 16777216
net.core.wmem_default = 16777216
net.ipv4.tcp_rmem = 4096 16777216 1073741824
net.ipv4.tcp_wmem = 4096 16777216 1073741824
net.ipv4.tcp_mem = 4194304 8388608 16777216
net.ipv4.udp_rmem_min = 16777216
net.ipv4.udp_wmem_min = 16777216

# Enable TCP window scaling.
net.ipv4.tcp_window_scaling = 1

# Increase the length of the processor input queue
net.core.netdev_max_backlog = 100000
net.core.netdev_budget = 1000
net.core.netdev_budget_usecs = 10000

# Set better congestion control.
net.ipv4.tcp_congestion_control = htcp

# Turn off fancy stuff for more stability.
net.ipv4.tcp_sack = 0
net.ipv4.tcp_dsack = 0
net.ipv4.tcp_fack = 0
net.ipv4.tcp_timestamps = 0

# Max reorders before slow start.
net.ipv4.tcp_reordering = 3

# Prefer low latency to higher throughput.
# Disables IPv4 TCP prequeue processing.
net.ipv4.tcp_low_latency = 1

# Don't start slow.
net.ipv4.tcp_slow_start_after_idle = 0

0 comments on commit 39485c1

Please sign in to comment.