Library that implements the google-perftools remote interface as a Express/Connect-compatible router.
npm install --save node-remote-pprof
Add the /pprof
endpoint to your application
const express = require('express');
const pprof = require('node-remote-pprof');
const app = express();
app.use('/pprof', pprof());
app.listen(3000);
Run the application
node --perf-basic-prof .../app.js
The --perf-basic-prof
command-line is needed for resolving Javascript symbols dynamically.
Use the pprof
tool to profile the application
pprof --web localhost:3000
Note: Either the original pprof
or the go version should work here.
This library is very rough, and only got light testing on mac OS High Sierra and some Linux derivates. Expect bugs and missing features.
By default the application will run with heap profiling disabled, this can be controlled by settingthe HEAPPROFILE
environment variable to the prefix of the heap dumps to create.
Alpine Linux/musl is not supported right now: See https://github.com/gperftools/gperftools/issues/693 for details and further links.
Apache-2.0.