NOTE
StrongLoop Arc and slc are no longer under active development, and will soon be deprecated. Arc's features are being included in the IBM API Connect Developer Toolkit: Please use it instead.
Skip to end of metadata
Go to start of metadata

Profiling means generating CPU profiles and heap memory snapshots for an application.  These can help detect memory leaks and other run-time issues.

StrongLoop tools enable you to profile both local and remote Node applications.  You can:

Using the StrongLoop profiler demo app

The StrongLoop profiler demo app is a simple LoopBack application that showcases CPU and heap profiling.  

The demo app includes a load generator script that makes two POST requests:

  • POST /documents - creates multiple instances of the document object and burns CPU. Use the CPU profiler to see the CPU usage.
  • POST /documents/content - increases the Document count. Use the heap profiler to see the increased object count.

Install demo app

Install the profiler demo app from GitHub:

Perform monitoring

Run the app:

Then display the application status to ensure that the application is running:

You should see something like this:

Now, run the load generator script:

You can collect CPU and heap profiling data using the slc ctl commands and Google Chrome tools.

For example, to profile CPU consumption for worker process number one (1):

Then, after a few seconds, stop CPU profiling:

To profile heap memory consumption:

See slc ctl for more details.

  • No labels