Linuxexit code > 0

Too many open files

$Error: accept tcp [::]:80: accept4: too many open files

Analysis

The process or the system has reached the limit of open file descriptors.

Common Triggers

  • High-traffic servers not configured for high concurrency.
  • Resource leaks (processes not closing files/sockets).

Debug Checks

  • $Check current limit: ulimit -n.
  • $See open files for a PID: ls /proc/<pid>/fd | wc -l.

Resolution

1
Increase ulimit: ulimit -n 65535 (temp) or edit /etc/security/limits.conf (perm).
2
Fix file/socket leaks in the application code.