- Default kernel settings target desktops and small VMs, not a 10Gbps dedicated server.
- These are the sysctl changes that measurably help โ and the cargo-cult settings you should skip.
Linux defaults are deliberately conservative โ tuned for laptops and small virtual machines, not a dedicated server with 128 GB of RAM and a 10Gbps uplink. A short, well-understood sysctl configuration can noticeably improve throughput and connection handling. The equally important skill is restraint: half the tuning advice circulating online is outdated cargo cult that modern kernels handle better automatically.
Ground Rules First
- Change one thing at a time and benchmark before and after โ otherwise you are guessing.
- Persist settings in
/etc/sysctl.d/99-tuning.conf, apply withsysctl --system, and keep the file in version control. - Modern kernels (6.x, standard on 2026 distributions) auto-tune many buffers; verify a setting is still relevant before copying it from a 2015 blog post.
Network: Where the Real Wins Are
For servers handling many connections or high bandwidth:
net.core.somaxconn = 4096 net.ipv4.tcp_max_syn_backlog = 8192 net.ipv4.ip_local_port_range = 10240 65000 net.core.rmem_max = 67108864 net.core.wmem_max = 67108864 net.ipv4.tcp_congestion_control = bbr net.core.default_qdisc = fq
The backlog settings prevent connection drops under bursts; the buffer maxima matter for high bandwidth-delay paths (a 10Gbps link to another continent needs large windows); and BBR congestion control is the single most impactful switch for long-distance throughput, often doubling it on lossy paths.
File Descriptors and Connection-Heavy Workloads
A busy proxy or websocket server exhausts the default open-file limits quickly. Raise fs.file-max at the kernel level and per-service limits via systemd (LimitNOFILE=65535). Symptoms of hitting the ceiling โ "too many open files" errors โ often masquerade as application bugs.
Memory: swappiness and Dirty Ratios
On a database or cache server, set vm.swappiness = 10 so the kernel strongly prefers dropping page cache over swapping application memory. Lowering vm.dirty_ratio and vm.dirty_background_ratio (for example to 10 and 5) smooths write bursts on servers with large RAM, avoiding multi-second stalls when the kernel flushes tens of gigabytes at once. Databases with their own durability guarantees often document specific recommendations โ PostgreSQL and Kafka both do; follow the application vendor over generic advice.
What to Leave Alone
Skip tcp_tw_recycle (removed from modern kernels for breaking NAT clients), do not disable swap entirely on general-purpose servers, and avoid pinning huge pages unless your database documentation explicitly calls for it. If a setting has no measurable effect in your benchmark, remove it โ every unexplained line in sysctl.conf is future confusion.
Frequently Asked Questions
How much improvement is realistic?
For long-distance transfers, BBR plus larger buffers can double throughput. For local LAN workloads, gains are modest โ single-digit percentages. Connection-heavy servers see the biggest wins from backlog and file descriptor limits.
Can bad sysctl values break the server?
Rarely fatally, but yes โ absurd buffer sizes can waste RAM and extreme dirty ratios can cause stalls. That is why you change one value at a time and keep the config in Git.
Do these settings apply to VPS too?
Partially. On a VPS the hypervisor limits what you control; on bare metal every knob is yours โ one of the quiet advantages of dedicated hardware.
Get hardware worth tuning โ explore our high-performance dedicated servers or ask for a performance consultation.