What are file descriptors and how do you handle 'too many open files'?
⚡
Quick Answer
FDs are handles for files/sockets; the error means a process hit its ulimit -n; raise the limit and check for leaks.
Detailed Answer
Every open file and socket consumes an FD, capped per process by ulimit -n (and system-wide by fs.file-max). 'Too many open files' means the cap was hit — often a leak (unclosed sockets). Raise the soft/hard limits (limits.conf or the systemd unit LimitNOFILE) and fix the leak; monitor with lsof/ls /proc/<pid>/fd.
💡
Interview Tip
Mention systemd LimitNOFILE for services.
linuxfile-descriptorsulimit