Hacker News new | ask | show | jobs
by jitl 525 days ago
Start node with `node --inspect-brk …` or send SIGUSR1 to a running node process to expose the debug protocol port.

Then, connect with Chrome developer tools. You should see a NodeJS icon in the devtools if there’s a node process on your machine listening on the devtools port. You can use SSH port forwarding or similar to connect to processes on other machines like in a production environment.

Use the Chrome developer tools to take a profile, save it to disk, then analyze it using https://profiler.firefox.com

In production we use Datadog to collect and inspect profiles.