In New Relic's APM, the Node VMs page provides useful runtime data for troubleshooting performance issues and monitoring the health of your application.
one.newrelic.com > All capabilities > APM & services > (select an app) > 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:
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 VMs 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.
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.
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.
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.
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.
This chart shows the CPU utilization of the Node.js 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.js process, divided by wall-clock time.
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.js 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.
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.
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: