node-clinic
Clinic.js diagnoses your Node.js performance issues
Clinic.js is a set of four Node.js performance profiling tools that diagnose why a server is slow, using too much CPU, leaking memory, or waiting too long on I/O, each producing a visual HTML report.
Clinic.js is a performance profiling toolkit for Node.js applications. It was originally built by NearForm, an open source consultancy, and it gives developers a way to spot why their Node.js server is running slowly, eating too much memory, or pausing unexpectedly. The project is no longer actively maintained, and because it depends heavily on Node.js internal details, results may not always be accurate on newer Node.js versions.
The toolkit works by wrapping your normal server startup command. You run something like "clinic doctor -- node server.js", then send traffic to the server using a benchmarking tool, and finally shut the server down. Clinic.js collects data during that window and produces a visual report telling you what kind of problem it found: too much CPU work, slow input/output operations, memory issues, and so on.
There are four separate tools inside the package. Doctor is the starting point: it diagnoses what category of problem you have and points you toward the right next tool. Bubbleprof focuses on time spent waiting for things like database calls or file reads. Flame shows you which functions in your code are consuming the most CPU time. Heap Profiler tracks memory allocation to help identify leaks.
Installation is a single npm command, and the tools are used from the command line. Each tool also has a programmable interface for teams that want to automate profiling inside their own scripts or CI pipelines. There is a workaround documented for running the tools inside a Podman container, where an interactive prompt about usage statistics can cause the container to exit early: setting the NO_INSIGHT environment variable suppresses that prompt.
The project supports Node.js version 16 and above. Full documentation and interactive demos are available on the clinicjs.org website, along with example repositories for each of the four tools.
Where it fits
- Diagnose the root cause of a slow Node.js server, CPU, I/O wait, or memory, using Clinic Doctor before diving deeper
- Profile which functions burn the most CPU time in a Node.js app using Clinic Flame's flamegraph output
- Track down memory leaks in a long-running Node.js service using the Heap Profiler
- Analyze time spent waiting on database calls or file I/O using Clinic Bubbleprof's async visualization