This repository has been archived by the owner on Mar 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
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
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 |