logo My Digital Garden

Quick Tip: Node JS profiling

By James Kolean on Oct 13, 2020
NetlifyToolsQuick Tip
banner

Clinic is a tool to profile your node apps. https://clinicjs.org/

You should visit the site to learn how to use the tool. Following is just a cheat sheet.

This assumes you have a Node JS application you can start with node app.js

Install Autocannon

Autocannon is a benchmarking tool written in node

yarn global add autocannon
node app.js
autocannon -c 2 -d 5 localhost:8000

Install Clinic

yarn global add clinic
clinic -h

Run Clinic

clinic doctor --autocannon [ -c 20 -d 5 -m GET 'http://localhost:3000/' ] -- node app.js
clinic bubble --autocannon [ -c 20 -d 5 -m GET 'http://localhost:3000/' ] -- node app.js
clinic flame --autocannon [ -c 20 -d 5 -m GET 'http://localhost:3000/' ] -- node app.js
© Copyright 2023 Digital Garden cultivated by James Kolean.