Diagnostic step 1
Short-term mitigation: increase system and PM2 worker ulimit (fs.file-max and limits.conf) and restart processes in a rolling fashion. Monitor FD usage with lsof and /proc/<pid>/fd counts. This is reversible and low-risk.
Generated Oct 14, 2026, 9:39:02 AM
Short-term mitigation: increase system and PM2 worker ulimit (fs.file-max and limits.conf) and restart processes in a rolling fashion. Monitor FD usage with lsof and /proc/<pid>/fd counts. This is reversible and low-risk.
Instrument the app to record open descriptor counts on each worker periodically and log stack traces or endpoint context when descriptor count passes thresholds.
Replace blocking fs operations in hot paths with streaming async APIs; ensure temp files are created with secure atomic temp file libraries and closed promptly, or use in-memory streams if payload size permits.
Review and enable connection pooling to upstream services (DB, auth) and tune TCP TIME_WAIT handling (reuse via SO_REUSEPORT not recommended lightly); consider reusing keep-alive sockets.
If FD leaks suspected from native modules, run a controlled canary with heap/FD tracing and isolate suspected modules. Escalate to module maintainers or Node.js support if a native bug is reproducible with small repro.