Linux Sysctl Tuner
Calculate starting-point kernel and network buffer settings for /etc/sysctl.d, with typical defaults shown.
System and network
Bandwidth-delay product: 12,500,000 bytes · max buffer: 16,666,667 bytes
Generated sysctl.d file
99-tuning.conf# /etc/sysctl.d/99-tuning.conf
# Generated by Linux Sysctl Tuner. Starting points, not optimal values: test before production.
# Inputs: RAM 16 GB, RTT 100 ms, bandwidth 1000 Mbps, profile Web server.
# Apply with: sudo sysctl --system (check current values first: sysctl <key>)
# Receive buffer ceiling: 4/3 of the 12500000 bytes BDP (1000 Mbps x 100 ms), with a 4 MiB floor; typical default: 212992
net.core.rmem_max = 16666667
# Send buffer ceiling, set to the same BDP-derived 15.9 MiB so a single flow can fill the link; typical default: 212992
net.core.wmem_max = 16666667
# TCP receive triplet: minimum 4096, default 87380 (an older kernel default), maximum 16666667 for autotuning; typical default: 4096 131072 6291456
net.ipv4.tcp_rmem = 4096 87380 16666667
# TCP send triplet: minimum 4096, default 16384, maximum 16666667 for autotuning; typical default: 4096 16384 4194304
net.ipv4.tcp_wmem = 4096 16384 16666667
# Web server workload: caps the accept() queue at 4096; typical default: 4096 (kernel 5.4+), 128 (older)
net.core.somaxconn = 4096
# Web server workload: allows 8192 half-open TCP handshakes during bursts; typical default: 128 to 4096, scales with RAM
net.ipv4.tcp_max_syn_backlog = 8192
# Global file-handle ceiling: 4194304 (262,144 per GB of RAM, never below 131,072); typical default: about RAM in KiB / 10
fs.file-max = 4194304
# Watcher budget: 131072 (8,192 per GB, never below 65,536); typical default: 8192 (before 5.11), up to 1048576 (5.11+, scales with RAM)
fs.inotify.max_user_watches = 131072
# Web server profile: 10 makes the kernel prefer dropping page cache over swapping; 0 avoids swap until memory is nearly exhausted (it does not disable swap); typical default: 60
vm.swappiness = 10
| Parameter | Value | Unit | Typical default | Reason |
|---|---|---|---|---|
| net.core.rmem_max | 16666667 | bytes | 212992 | Receive buffer ceiling: 4/3 of the 12500000 bytes BDP (1000 Mbps x 100 ms), with a 4 MiB floor. The 4/3 factor is a heuristic, not a kernel rule. |
| net.core.wmem_max | 16666667 | bytes | 212992 | Send buffer ceiling, set to the same BDP-derived 15.9 MiB so a single flow can fill the link. |
| net.ipv4.tcp_rmem | 4096 87380 16666667 | bytes (min default max) | 4096 131072 6291456 | TCP receive triplet: minimum 4096, default 87380 (an older kernel default), maximum 16666667 for autotuning. |
| net.ipv4.tcp_wmem | 4096 16384 16666667 | bytes (min default max) | 4096 16384 4194304 | TCP send triplet: minimum 4096, default 16384, maximum 16666667 for autotuning. |
| net.core.somaxconn | 4096 | connections | 4096 (kernel 5.4+), 128 (older) | Web server workload: caps the accept() queue at 4096. The application's listen() backlog is limited by this value. |
| net.ipv4.tcp_max_syn_backlog | 8192 | connections | 128 to 4096, scales with RAM | Web server workload: allows 8192 half-open TCP handshakes during bursts. |
| fs.file-max | 4194304 | file handles | about RAM in KiB / 10 | Global file-handle ceiling: 4194304 (262,144 per GB of RAM, never below 131,072). Modern kernels already size this from RAM, so check the current value first. |
| fs.inotify.max_user_watches | 131072 | watches per user | 8192 (before 5.11), up to 1048576 (5.11+, scales with RAM) | Watcher budget: 131072 (8,192 per GB, never below 65,536). Kernel 5.11+ may already default higher; check the current value first. |
| vm.swappiness | 10 | 0 to 200 | 60 | Web server profile: 10 makes the kernel prefer dropping page cache over swapping; 0 avoids swap until memory is nearly exhausted (it does not disable swap). |
About
Calculate BDP-aware TCP buffers plus connection queues, file handles, inotify watches, and swappiness locally in your browser.
Examples
Gigabit link at 100 ms RTT
calculateSysctl({ ramGb: 16, rttMs: 100, bandwidthMbps: 1000, profile: "web-server" })bdpBytes: 12500000, maxBufferBytes: 16666667, tcp_rmem: 4096 87380 16666667BDP is 1e9 × 0.1 / 8 = 12.5 MB; the 4/3 headroom ceils to 16,666,667 as the buffer ceiling.
Database vs web server
calculateSysctl({ ramGb: 8, rttMs: 20, bandwidthMbps: 100, profile: "database" })vm.swappiness = 1, somaxconn = 2048The database profile minimizes swap pressure (1 vs 10) and halves the accept queue versus web-server.
About this tool
Linux Sysctl Tuner derives kernel network and memory settings with calculateSysctl({ ramGb, rttMs, bandwidthMbps, profile }): the bandwidth-delay product (bandwidth bits/s × RTT seconds / 8) gets a 4/3 headroom factor via Math.ceil to form maxBufferBytes, floored at 4 MiB, which then feeds net.core.rmem_max/wmem_max and the tcp_rmem/tcp_wmem maximum triplets.
Profiles differentiate queueing and swap policy: web-server (somaxconn 4096, syn backlog 8192, swappiness 10), database (2048/4096/1), file-server (1024/2048/20), and k8s-node (4096/8192/0). RAM scales fs.file-max (262,144 per GB, floor 131,072) and fs.inotify.max_user_watches (8,192 per GB, floor 65,536), and every parameter ships with an explanation plus a ready-to-paste key = value config.
Inputs validate strictly: non-finite or non-positive RAM, RTT, or bandwidth throws, as does an unknown profile. A 1000 Mbps × 100 ms link yields exactly bdpBytes 12,500,000 and maxBufferBytes 16,666,667 — all computation is local, so host specs never leave the browser.
How to use this tool
Enter link and host specs
Provide RAM in GB, RTT in ms, and bandwidth in Mbps — all three must be positive numbers or the calculation throws.
Pick the workload profile
Choose web-server, database, file-server, or k8s-node to set somaxconn, syn backlog, and swappiness policy.
Apply the generated config
Copy the key = value lines into /etc/sysctl.d/99-tuning.conf, run sysctl --system, and verify with sysctl net.core.rmem_max.
Use cases
Sizing high-latency transfer hosts
Raise TCP buffer ceilings so long-fat links (cloud regions, inter-DC replication) can fill the pipe.
Tuning database nodes against swap
Pin swappiness to 1 so database pages stay resident while file cache absorbs the pressure.
Preparing Kubernetes nodes
Use the k8s-node profile (swappiness 0, deep queues) as a baseline for burst-heavy pod traffic.
Common mistakes
Mistake:Passing zero bandwidth or RTT and expecting a fallback.
Fix:Zero or negative inputs throw must be a positive number — validate form fields before calling, since there is no clamping.
Mistake:Applying the config without reloading sysctl.
Fix:Writing the file is not enough — run sysctl --system (or sysctl -p) and confirm each key took effect.
Frequently asked questions
What does this tool do?
It derives sysctl settings with calculateSysctl: BDP (bandwidth × RTT / 8) with 4/3 headroom sets rmem/wmem ceilings and tcp_rmem/tcp_wmem maxima, the profile sets somaxconn/syn-backlog/swappiness, and RAM scales file-max and inotify watches — emitted as key = value lines with explanations.
What is the reference calculation, and how do profiles differ?
1000 Mbps × 100 ms gives bdpBytes 12,500,000 and maxBufferBytes 16,666,667. web-server uses swappiness 10 with somaxconn 4096, database uses 1 with 2048, file-server 20 with 1024, and k8s-node 0 with 4096.
Is my host data uploaded or stored?
No. All arithmetic is local — RAM, RTT, and bandwidth never leave your browser.
Which inputs throw?
Non-finite or non-positive RAM, RTT, or bandwidth (including 0) throws must be a positive number, and an unknown profile throws Unknown profile. There is no clamping fallback.
Related guides
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.