Too Many Open Files
Fix the "too many open files" error killing a Node.js API under traffic.
A intermediate Linux challenge worth 10 points. Solve it hands-on in a real Linux environment in your browser - no local setup, no fake shells.
The Challenge
Your Node.js payment API rejects connections at peak load. dmesg shows "too many open files". The service runs as user nodeapp.
Your tasks:
- Check the running process fd limits: cat /proc/$(pgrep nodeapp)/limits
- Edit /etc/security/limits.conf — add soft and hard nofile 65536 for nodeapp
- Edit /etc/pam.d/common-session to ensure pam_limits.so is loaded
- Verify with cat /proc/$(pgrep nodeapp)/limits after session reload
- Run check to validate