diff --git a/usr/lib/sysctl.d/99-cachyos-settings.conf b/usr/lib/sysctl.d/99-cachyos-settings.conf index 15b1085..6d5735f 100644 --- a/usr/lib/sysctl.d/99-cachyos-settings.conf +++ b/usr/lib/sysctl.d/99-cachyos-settings.conf @@ -21,7 +21,7 @@ vm.page-cluster = 0 # flusher threads will start writing out dirty data. vm.dirty_background_bytes = 67108864 -# The kernel flusher threads will periodically wake up and write old data out to disk. This +# The kernel flusher threads will periodically wake up and write old data out to disk.  This # tunable expresses the interval between those wakeups, in 100'ths of a second (Default is 500). vm.dirty_writeback_centisecs = 1500 @@ -38,9 +38,35 @@ kernel.printk = 3 3 3 3 # Restricting access to kernel pointers in the proc filesystem kernel.kptr_restrict = 2 -# Increase netdev receive queue -# May help prevent losing packets -net.core.netdev_max_backlog = 4096 - # Set size of file handles and inode cache +# (Often tweaked alongside network settings for high-concurrency apps) fs.file-max = 2097152 + +# ============================================================================== +# UNIVERSAL NETWORK TUNING (Performance & Stability) +# Optimized for: Low-Latency Gaming, VPNs, and Container Routing +# ============================================================================== + +# --- 1. IP Forwarding (Routing Support) --- +# Enables IPv4 packet forwarding. +# Benefit: Necessary for functionality in Containers and VPN Mesh networks. +# Use Case: Required for Tailscale/ProtonVPN (Exit Nodes/Subnet Routers) and Docker/Podman containers. +net.ipv4.ip_forward = 1 + +# --- 2. MTU Probing (Connection Stability) --- +# Enables Path MTU Discovery. +# Benefit: Essential for connections involving encapsulation (VPNs) where the MTU is < 1500. +# Use Case: Fixes "black hole" connections and stalled transfers in WireGuard, OpenVPN, or mobile networks. +net.ipv4.tcp_mtu_probing = 1 + +# --- 3. TCP Timewait Reuse (Socket Efficiency) --- +# Allows reusing sockets in TIME_WAIT state for new connections. +# Benefit: Prevents "Port Exhaustion" during high connection turnover. +# Use Case: Improves performance for P2P apps (Syncthing/Torrents) and web servers. +net.ipv4.tcp_tw_reuse = 1 + +# --- 4. Input Packet Queue (Burst Handling) --- +# Increases the backlog queue for incoming packets. +# Benefit: Prevents losing packets when the interface receives data faster than the kernel can process it. +# Use Case: Smoother playback in streaming apps and better handling of high-speed downloads (Gigabit+). +net.core.netdev_max_backlog = 4096