Debugging Node.js in Production
summary
Netflix runs Node across its site and debugs production by sampling and post‑mortem state, not guessing. Request latency issues use perf at 99Hz for 30s (≈20–23k samples) and V8’s perf_basic_prof_only_functions (Node 5.0x / backport 4.3) to get JS frames, then visualize hot paths with a flame graph to find a single bad line (lodash merge vs assign) that collapses a wide CPU flame and cuts latency and CPU. Crashes and leaks use core dumps (process.on('uncaughtException') and gcore) loaded into mdbv8; find js objects shows module objects growing from ~230k to ~323k caused by try/catch require without caching, and reverse references locate the root.
AI-written summary · about
