How to fix "too many open files" error on Linux
Answered
16
My application crashes with "too many open files" error. How can I increase the file descriptor limit?
W
Asked by
web_developer
Platinum
•
285 rep
1 Answer
9
Check current limits
# Check soft limit
ulimit -Sn
# Check hard limit
ulimit -Hn
# Check for specific process
cat /proc/PID/limits
Increase limits temporarily
ulimit -n 65535
Increase limits permanently
# Edit /etc/security/limits.conf
* soft nofile 65535
* hard nofile 65535
root soft nofile 65535
root hard nofile 65535
# For systemd services, edit service file
[Service]
LimitNOFILE=65535
N
Gold
•
255 rep
Your Answer
You need to be logged in to answer questions.
Log In to Answer