Desktop Performance Tuning with sysctl – 2026 Edition

Desktop Performance Tuning with sysctl – 2026 Edition

I’ve been running tweaked kernel settings on Solus, Arch, NixOs and Fedora for years now. Nothing crazy, just sensible changes that make the system more responsive for actual work. This is what I use and what actually makes a difference on desktop machines across Fedora, Arch, Debian, and Solus.

What is sysctl?

sysctl is the tool that lets you tune Linux kernel parameters at runtime. Most of these persist if you put them in files under /etc/sysctl.d/. No recompiling, no weird hacks, just system tuning that’s been there forever.

The Problem

Default Linux kernel settings are built to handle everything from servers to embedded systems. Desktop machines have different priorities. A server wants to squeeze every connection possible. Your desktop wants your click to register instantly and your browser to not lag when you hit dozens of tabs.

Most of the defaults work fine, but a few tweaks make actual observable differences on daily usage.

Network Performance

I’m not gonna bore you with TCP window scaling. Here’s the practical bit: if you actually use your network for streaming, gaming, or transferring files to a NAS, these matter.

net.core.default_qdisc=cake
net.ipv4.tcp_congestion_control=bbr
net.ipv4.tcp_ecn=1
net.core.netdev_max_backlog=5000
net.core.somaxconn=4096

CAKE is a fairer queue than the default. BBR is Google’s congestion algorithm that recovers faster from packet loss. ECN tells your router when things are getting congested before packets start dropping. These are standard on modern systems and actually useful.

The buffer settings give you more room before the network interface starts dropping packets. On modern gigabit or better connections, this is more important.

New one to add:

net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_fin_timeout=15
net.ipv4.tcp_mtu_probing=1
net.ipv4.tcp_rmem=4096 131072 6291456
net.ipv4.tcp_wmem=4096 16384 4194304

TCP_tw_reuse lets the kernel reuse closed connections faster. TCP_fin_timeout closes connections in 15 seconds instead of 60. You notice this when opening lots of connections (web browsing, file transfers).

TCP_mtu_probing auto-detects your network’s MTU instead of guessing. Saves you from fragmented packets that crawl.

TCP_fast_open is TFO. First connection is fast, subsequent ones are faster. Your router has to support it but most do now.

The tcp_rmem and tcp_wmem are bigger buffer sizes. On faster networks you need more buffer space or you throttle yourself.

Memory and Responsiveness (This One Actually Matters)

This is where you feel the difference most.

vm.swappiness=10
vm.watermark_scale_factor=125
vm.dirty_ratio=15
vm.dirty_background_ratio=5
vm.dirty_expire_centisecs=3000
vm.dirty_writeback_centisecs=500
vm.oom_dump_tasks=0
vm.vfs_cache_pressure=50

Swappiness controls how eager Linux is to push things to disk swap. Default is 60. At 60, the system uses swap too much on a desktop and you get lag spikes when the system decides to start swapping. Set it to 10 and the system only uses swap when absolutely desperate.

You feel this. Desktop stays responsive.

Dirty_ratio and dirty_background_ratio control when the system flushes dirty pages (changes you made) to disk. At the defaults, Linux can hold a lot of changes in RAM and write them all at once. This causes hiccups. Lower values make the system write more often in the background, which feels smoother.

watermark_scale_factor gives the kernel more aggressive hints about memory pressure earlier. Prevents the OOM killer from showing up.

vfs_cache_pressure at 50 means “keep file cache around longer”. Your frequently accessed files stay cached. Open Firefox again, it’s faster.

File System

fs.file-max=2097152
fs.inotify.max_user_watches=1048576
fs.inotify.max_user_instances=8192
fs.inotify.max_queued_events=32768
fs.aio-max-nr=262144
fs.pipe-max-size=2097152
fs.mount-max=200000

file-max is the system-wide limit of open files. 2 million is plenty for a desktop. Won’t hit it.

inotify.max_user_watches is the big one. VS Code, file managers, sync apps, all use inotify to watch for file changes. Default is like 8192. On a project with thousands of files, you hit that limit fast. 1 million is safe.

aio-max-nr is for async I/O. Some apps need it. 262k is fine.

pipe-max-size just lets pipes hold more data without slowing down.

Scheduler and CPU (Gaming/Typing Feel)

kernel.sched_migration_cost_ns=5000000
kernel.sched_min_granularity_ns=10000000
kernel.sched_latency_ns=25000000
kernel.sched_powersave_bias=0

Warning, alot of the above kernel.sched are not exposed as sysctl parameters in certain kernels! Fedora default kernel is one of them!

These control how often Linux switches between tasks on your CPU. Lower values mean more switching, more latency. These are picked for balance. You’ll feel less stutter in games and less lag when typing in fast applications.

sched_powersave_bias=0 means “don’t try to save power by packing tasks on fewer cores”. On a desktop you have cores, use them.

Security (Reasonable Balance)

kernel.randomize_va_space=2
kernel.kptr_restrict=2
kernel.sysrq=1
kernel.panic=10

ASLR is enabled (good). Kernel pointers are hidden (good). SysRq is on (lets you do Ctrl+Alt+SysRq combos to force reboot or sync in emergencies).

IPv6 (Disable It)

net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

Unless you’re specifically using IPv6, disable it. Reduces network noise, speeds up boot. IPv4 is fine for everything that matters on desktop.

How to Use This

Create the file:

sudo nano /etc/sysctl.d/99-desktop-performance.conf

Paste this:

# Network
net.core.default_qdisc=cake
net.ipv4.tcp_congestion_control=bbr
net.ipv4.tcp_ecn=1
net.core.netdev_max_backlog=5000
net.core.somaxconn=4096
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_fin_timeout=15
net.ipv4.tcp_mtu_probing=1
net.ipv4.tcp_rmem=4096 131072 6291456
net.ipv4.tcp_wmem=4096 16384 4194304
net.ipv6.conf.all.disable_ipv6=1
net.ipv6.conf.default.disable_ipv6=1
net.ipv6.conf.lo.disable_ipv6=1

# Memory
vm.swappiness=10
vm.watermark_scale_factor=125
vm.dirty_ratio=15
vm.dirty_background_ratio=5
vm.dirty_expire_centisecs=3000
vm.dirty_writeback_centisecs=500
vm.oom_dump_tasks=0
vm.vfs_cache_pressure=50

# File System
fs.file-max=2097152
fs.inotify.max_user_watches=1048576
fs.inotify.max_user_instances=8192
fs.inotify.max_queued_events=32768
fs.aio-max-nr=262144
fs.pipe-max-size=2097152
fs.mount-max=200000

# Security
kernel.randomize_va_space=2
kernel.kptr_restrict=2
kernel.sysrq=1
kernel.panic=10

Save with Ctrl+O, Enter, Ctrl+X.

Apply immediately:

sudo sysctl -p /etc/sysctl.d/99-desktop-performance.conf
sudo systemctl restart systemd-sysctl

Check it worked:

sysctl vm.swappiness
sysctl net.ipv4.tcp_congestion_control

Should show your new values. On reboot, these load automatically.

Distro Notes

  • Fedora 44: Works as-is.
  • Arch: Works as-is.
  • Debian: Works as-is.
  • Solus: Works as-is.

All use the same sysctl.d mechanism. No distro-specific changes needed.

What You’ll Notice

Within a day or two of running these:

  • Scrolling in Firefox feels smoother. Less hiccups.
  • Opening applications is faster.
  • Switching between windows is snappier.
  • File transfers don’t tank your system.
  • Gaming feels slightly more responsive.

You won’t get a 50% performance boost. That’s not real. But the system feels more responsive and less prone to random stutters. That’s the point.

If Something Breaks

Revert:

sudo rm /etc/sysctl.d/99-desktop-performance.conf
sudo sysctl -p

Rebooting also reverts everything to defaults if you mess up. No harm.

Don’t Do This

Don’t just copy random numbers from Reddit. Don’t max out every setting. Don’t set vm.swappiness=0 (system will freeze waiting for swap). These values are picked because they’re sensible for actual desktop use, not maximum everything.

The only setting that really matters is swappiness. That one makes a real difference. The rest are polish.

Notes

Older systems (kernel 4.x) might not support tcp_fast_open or some of these settings. Apply them anyway, sysctl will just skip unsupported ones.

Laptop users:

kernel.sched_powersave_bias=0 doesn’t hurt battery much on modern hardware. If you’re on a really old laptop, you can comment it out.

Server users:

None of these are server-oriented. Server defaults are already pretty good. Swap out tcp_congestion_control=bbr for cubic if you’re behind a really old router.

That’s It

Not complicated. Just reasonable defaults that improve desktop responsiveness. Run it, forget about it, enjoy a slightly less stuttery system.

Leave a Reply

Your email address will not be published. Required fields are marked *

*