Node.js VMs statistics page

In New Relic APM, the Node VMs page provides useful runtime data for troubleshooting performance issues and monitoring the health of your application.

Access to this feature depends on your subscription level.

Compatibility and requirements

Some of the charts on the Node VMs page require you to install the New Relic Native Metrics Module in addition to the Node.js agent. For installation instructions, see Node VM Measurements.

View Node VM statistics

New Relic APM - Node VMs page 1.png
rpm.newrelic.com/apm > APM > (select an app) > Monitoring > Node VMs: When multiple servers are reporting to the same application, the page breaks charts down by server. You can view data for an individual server and obtain additional details by selecting a server from the Servers filter at the top of the page.

To correlate spikes or upward trends in any of these measurements with specific transactions:

  1. Go to rpm.newrelic.com/apm > APM > (select an app) > Monitoring > Node VMs.
  2. Select the time period by clicking and dragging within any of the charts.
  3. Navigate to the Transactions page or any other page.

As you go to other pages, the time picker selection will remain the same.

Analyze performance issues

Here is a summary of the data available on individual Node VM charts. By using all of the charts together, you can troubleshoot performance issues. For example:

  • When the application starts using more objects, memory usage will increase, and garbage collection (GC) will run more frequently. CPU utilization will increase due to time spent in GC.
  • Abnormally long synchronous code execution can increase CPU utilization. This will show spikes in the Event loop max CPU time per tick chart.
GC pause time

The amount of time spent in garbage collection. For a single server, the chart shows average, max, and total time per minute. For multiple servers, the chart shows total time grouped by server.

Typically, spikes in GC time or frequency indicate a potential issue.

GC pause frequency

The number of times GC runs were executed per minute. For a single server, the chart is broken down by the type of GC. For multiple servers, the chart shows total number of GC calls (all types combined) grouped by server.

GC pause time by type

This chart shows the total time spent in garbage collection per minute, broken down by GC type. It is only shown when viewing a single server. You might see the following types depending on your version of Node.js and app activity:

Value Description
Scavenge The most common garbage collection method. Node.js will typically trigger one of these every time the VM is idle.
MarkSweepCompact The heaviest type of garbage collection V8 may do. If you see many of these happening you will need to either keep fewer objects around in your process or increase V8's heap limit.
IncrementalMarking A phased garbage collection that interleaves collection with application logic to reduce the amount of time the application is paused. Only in Node.js v6 or higher.
ProcessWeakCallbacks After a garbage collection occurs, V8 will call any weak reference callbacks registered for objects that have been freed. This measurement is from the start of the first weak callback to the end of the last for a given garbage collection. Only in Node.js v6 or higher.
Memory usage

This chart shows the amount of memory consumed by the Node.js process. For multiple servers, the chart shows total memory grouped by server. For a single server, the chart is segmented by the following types of memory:

Value Description
Non-heap The memory allocated to data outside V8's heap (for example, buffers, sockets).
V8 heap (used) The amount of memory being used by V8 (for example, JavaScript objects).
V8 heap (free) The amount of memory set aside by V8 for memory pooling. This memory isn't being actively used, but is set aside for V8 to freely allocate more as needed.
CPU utilization

This chart shows the CPU utilization of the Node process.

For multiple servers, the chart shows total CPU utilization grouped by server. For a single server, the chart is segmented by the following:

Value Description
User

The time spent executing the user code, divided by wall clock time.

System The time spent in the system kernel on behalf of the Node process, divided by wall clock time.
Event loop — ticks per minute

This chart shows the number of event loop ticks per minute. A tick is a single turn of the event loop, in which functions that are ready to be executed are run.

As a part of each event loop turn, Node waits for pending I/O to complete. Once any I/O events are received, the event loop executes callbacks associated with it. Therefore, the number of ticks per minute corresponds to how frequently I/O events occur.

Event loop — max CPU time per tick
This chart shows the maximum time spent in a single tick per minute. This is useful with detecting an abnormally long event loop tick, which indicates long synchronous code execution.
New Relic APM - Node VMs page 2.png
rpm.newrelic.com/apm > APM > (select an app) > Monitoring > Node VMs: When a Node.js app is hosted on a single server, the VMs page lists more detailed performance statistics for each chart. If you have multiple servers, you can view data for an individual server by selecting a server from the Servers filter at the top of the page.

View clusters of multiple processes

When multiple Node.js processes on the same server report to the same New Relic application, these charts will show aggregated data. This is because each worker process in a cluster has its own separate Node.js runtime and collects separate data.

Clusters Comments
Sum across all workers

The following charts show a sum across all workers:

  • GC pause time - Total time per minute
  • GC pause frequency
  • GC pause time by type
  • CPU utilization
  • Event loop ticks per minute
Average from all workers

The following charts show an average from all workers:

  • Memory usage
  • GC pause time — average
Max across all workers

The following charts show max across all workers:

  • GC pause time — max
  • Event loop — max CPU time per tick

For more help

Additional documentation resources include:

Recommendations for learning more: