1024. Check the real limit with grep 'open files' /proc/<PID>/limits, then raise it for a service with LimitNOFILE=65535 in a systemd override, or for login sessions with nofile in /etc/security/limits.conf.
Before you start
- A file descriptor is a number a program uses for each open file or connection. Busy web servers, databases and game servers with many players need thousands.
- Each process has a soft limit (what applies now) and a hard limit (the most the soft limit may be raised to).
- Commands use
sudo. As root, leave it out.
Step 1: Check the limit and the usage
Find the process ID (PID), for example of Nginx:812 with your PID):
Cause 1: A systemd service has a low limit
Services started by systemd ignoreulimit and limits.conf. They take the limit from their unit, which defaults to 1024 soft and 524288 hard.
Fix: open an override for the service:
/etc/nginx/nginx.conf, at the top level, add worker_rlimit_nofile 65535;, check with sudo nginx -t and reload. For MariaDB/MySQL, raise LimitNOFILE the same way on the mariadb or mysql unit.
Cause 2: A program started from your shell or a login has a low limit
Programs you start by hand, in tmux or screen, or from cron get the limit of your login session. Check:/etc/security/limits.conf (or a new file in /etc/security/limits.d/), then log out and back in:
Cause 3: A program leaks file descriptors
If the count from Step 1 grows all day and never drops, the program opens files or connections and doesn’t close them. A higher limit only delays the error. Check what it keeps open:socket:[...] entries point to unclosed connections; the same file name many times points to a file opened in a loop.
Fix: update the program or report the bug to its developer. Until then, restart it on a schedule.
Cause 4: inotify limits (file watchers)
Tools that watch files (tail -f, Node.js dev servers, sync tools, some game panels) use inotify, which has its own per-user limits. They report the same error, for example tail: inotify cannot be used, reverting to polling: Too many open files.
Check:
How to check it worked
Repeat Step 1 after the restart:Frequently asked questions
I set limits.conf but my service still has 1024. Why?
limits.conf only applies to login sessions through PAM. systemd services need LimitNOFILE in their unit (Cause 1).
What value should I use?
65535 is plenty for most web servers, databases and game servers. Some vendors recommend more; follow their documentation for that program.
What does “Too many open files in system” mean?
That is the system-wide limit (fs.file-max), not a per-process one. It is rare on current kernels; check with cat /proc/sys/fs/file-nr, and look for a leak (Cause 3) before raising it.
Related guides
VPS and dedicated server guides
Every guide in this section.
Manage services with systemctl
Overrides, restarts and status.
Kernel settings with sysctl
Make kernel settings permanent.
Tune Linux for game servers
Limits and settings for busy servers.
High load on a Linux server
Find what slows the server down.
Checked against the official systemd systemd.exec and systemd-system.conf manuals, the limits.conf and prlimit manuals and the nginx core module documentation on 4 November 2026; the error (Python and Bash),
/proc/PID/limits, ulimit, prlimit and the inotify sysctl values were tested on Ubuntu 24.04 LTS. The systemd override was not tested, because systemd doesn’t run in our test container.Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026