Diagnostic step 1
Instrument the Node handler: replace synchronous processing with asynchronous or offload to worker pool (worker_threads or separate service). Add try/catch to log exceptions and ensure the worker does not crash silently.
Generated Oct 20, 2026, 9:41:02 AM
Instrument the Node handler: replace synchronous processing with asynchronous or offload to worker pool (worker_threads or separate service). Add try/catch to log exceptions and ensure the worker does not crash silently.
Run a repro locally with the same payload and monitor process (strace, node --trace-uncaught) to catch crashes; check PM2 logs for reasons of restart.
Temporarily enable proxy_buffering off and raise proxy_read_timeout to confirm Nginx isn't dropping due to timeout; do not leave infinite timeouts in production.
Monitor ulimit -n, ephemeral ports (ss -s), and dmesg for OOM/killed-by-signal entries; scale workers or use a job queue for heavy processing.
If offload not possible, front the API with a request queue (Redis/sidecar) and return a 202 with progress endpoint to avoid long-lived HTTP connections.