Site icon New Generation Enterprise Linux

Stop letting your system fall over when the file descriptors run out

Performance Tuning & Kernel Parameters (Sysctl)

Stop letting your system fall over when the file descriptors run out

đź§© The Challenge

Dealing with a Java app or a heavy-hitting web server that just hangs because it hit the process limit for open files is a special kind of hell. You end up staring at “too many open files” errors while the app is technically alive but completely useless.

đź’ˇ The Fix

Bump up the system-wide limit for file handles using sysctl so your applications can actually scale past the default pittance. You will finally stop seeing those random connection reset errors once you widen the pipe.

sysctl -w fs.file-max=2097152
echo "fs.file-max = 2097152" >> /etc/sysctl.conf
sysctl -p

⚙️ Why It Works

By cranking up fs.file-max, you are telling the kernel to allow a significantly larger number of file descriptors to be allocated globally, which prevents the bottleneck that causes applications to choke under high concurrent load. It’s an easy win that keeps the kernel from aggressively killing your throughput.

🚀 Pro-Tip: Don’t forget that your user-level limits in /etc/security/limits.conf need to be raised too, or the kernel will allow it but the shell will still block it.

Linux Tips & Tricks | © ngelinux.com | 9/28/2026

0 0 votes
Article Rating
Exit mobile version