FAQ
What is the relationship between the Node.js Performance Platform runtime and the community Node.js runtime?
The Node.js Performance Platform runtime is fully compatible with the corresponding versions of the community Node.js runtime. For more information, see the version mapping.
Does the Node.js Performance Platform runtime affect performance?
The Node.js Performance Platform runtime writes monitoring data to memory in the main thread every minute and uses a separate log thread to write logs to a file. Therefore, the performance impact is negligible.
When you perform a fault diagnosis, the diagnostic feature runs for 3 minutes and then automatically returns to the normal running state.
What extra features does the Node.js Performance Platform runtime provide?
Runtime memory status monitoring for the Node.js V8 virtual machine.
libuv runtime status monitoring.
Online fault diagnosis features, such as heap snapshots, CPU profiles, and GC traces.
Why does the console show 0 instances after I deploy the Node.js Performance Platform runtime?
Step 1: Check whether agenthub started successfully. Run the following command to check if an agenthub instance is running.
u@h:~$ agenthub list |- App ID -|- PID -|---- Start Time -----|--- Config Path ------------------------------------| | 12345 | 29015 | 2018-07-11 16:53:44 | /path/to/your/config.json | |----------|-------|---------------------|----------------------------------------------------| u@h:~$If no agenthub instance is running, start agenthub in DEBUG mode and check the ~/.agenthub.log file for error details.
DEBUG=* agenthub start config.json cat ~/.agenthub.logStep 2: Check the agenthub configuration. On the
Instancespage, clickView running Node.js processesand then clickCheck process.
Diagnostic operation failure
Diagnostic operations must run sequentially. If you start a new operation before the current one is complete, the new operation fails. An operation is considered complete when the dump button on the Files page is enabled. A diagnostic report takes a few seconds to generate. A heap snapshot can take from several seconds to several minutes, depending on the heap size. Other operations run for 3 minutes.
Agenthub abnormal exit
If the agenthub list command cannot find the agenthub instance after you start it by running agenthub start config.json, start agenthub in DEBUG mode.
DEBUG=* agenthub start config.json
Then, check the ~/.agenthub.log file for error information.
After you fix the error, restart agenthub normally.
agenthub stop all # Stop agenthub
agenthub start config.json
How to deploy multiple applications on one server
We strongly recommend that you deploy only one application per server.
If you must deploy multiple applications on the same server, you can use one of the following two methods:
Request a different App ID and
App Secretfor each application. UseNODE_LOG_DIRto specify different paths for the runtime logs. Ensure that these paths match thelogdirpath in theconfig.jsonfile. This lets you start multiple agenthub instances.Start one agenthub instance. Point the runtime logs for all applications to the same directory. The default is
/tmp. You can adderror_logandpackagesto the array in the configuration file.
Use one of these methods for your deployment.
How to use the Node.js Performance Platform runtime with applications managed by pm2
If the community Node.js runtime and pm2 are already installed before you install the Node.js Performance Platform runtime:
After you install the Node.js Performance Platform runtime, reinstall pm2. Ensure that the output of
which pm2contains the.tnvmfield.Kill all pm2 processes, including the
PM2 v0.15.8: God Daemondaemon process.Restart the application using pm2.
$ ENABLE_NODE_LOG=YES pm2 start app.js
If the community Node.js runtime and pm2 are not installed before you install the Node.js Performance Platform runtime:
After you install pm2, start the application directly using pm2.
$ ENABLE_NODE_LOG=YES pm2 start app.js
Console displays system monitoring data but not process monitoring data
On the Instances page, click View running Node.js processes and then click Check process to investigate.
How to handle multiple instances with the same hostname
Add the "agentidMode": "IP" configuration item to the configuration file.
For example, assume you have two instances that both have the hostname app_container. Their IP addresses are 10.10.12.124 and 10.10.12.123. If you add "agentidMode": "IP" to the configuration, the instance IDs become app_container_12124 and app_container_12123. For more information, see the details.
What are slow HTTP logs?
HTTP requests with a response time (RT) greater than 400 ms.
What are abnormal logs?
These are logs generated by your application that contain an
error stack. They are located in the log file specified byerror_login theconfig.jsonfile.
What are module dependencies?
These are the npm modules specified by
packagesin theconfig.jsonfile. Modules that have security risks are highlighted in red.
What do the system monitoring metrics mean?
Basic information
The latest reported values for each metric. The metrics are described below.
Long-term data
Memory
memory_sys: The percentage of system memory usage.memory_node: The percentage of total system memory used by all Node.js processes combined.
CPU
cpu_sys: The percentage of system CPU usage.cpu_node: The sum of the CPU usage percentages of all Node.js processes.
Load
load1: The average load over 1 minute.load5: The average load over 5 minutes.load15: The average load over 15 minutes.The following is reference information for
Load. TheLoadvalue is normalized. For an N-core CPU, the actual load isLoad × N:0.7 < Load < 1: Good. New tasks can be processed promptly.Load = 1: Tasks may soon require additional waiting time to be processed. This situation requires attention.Load > 5: Tasks require a long waiting time. Intervention is needed.Typically, you should check
load15first. If it is high, checkload1andload5to determine if there is a downward trend. Aload1value greater than 1 for a short period is not a cause for concern. However, aLoadvalue that remains high for a long time requires attention.
QPS
The sum of HTTP requests per second processed by all Node.js processes in the instance.
GC
gc_avg: The average percentage of time spent on garbage collection across all Node.js processes.gc_max: The maximum percentage of time spent on garbage collection by a single Node.js process within a one-minute interval.
Apdex
The Node.js Performance Platform defines user satisfaction based on the HTTP response time (RT). The default threshold, T, is 100 ms:
satisfied:RT <= Ttolerating:T < RT < 4 * Tfrustrated:RT > 4 * TFormula:
satisfied + tolerating / 2For example:
If, in one minute, 60% of HTTP requests are
satisfied, 30% aretolerating, and 10% arefrustrated:The Apdex score is
0.6 + (0.3 / 2) = 0.75
Apdex detail
This provides a detailed breakdown of HTTP requests by response time.
node process count
The number of Node.js processes running in the instance.
Disk
The disk usage of the instance.
What do the process monitoring metrics mean?
Overall heap information
rss: The actual memory used by the process, including both on-heap and off-heap memory.heap_total: The total size of the heap memory.heap_used: The amount of heap memory currently in use.
GC Information
scavenge_duration: The percentage of time spent onscavengegarbage collection.marksweep_duration: The percentage of time spent onmarksweepgarbage collection.
Heap space composition
The size of each memory space in the heap: code_space, lo_space, map_space, new_space, and old_space.
QPS Trend
The number of HTTP requests per second handled by this process.
CPU Trend
The parameters now, cpu_15, cpu_30, and cpu_60 indicate the CPU usage of the process over the last 1 s, 15 s, 30 s, and 60 s, respectively.
Timer trends
This indicates the number of timers in the process.
All timers in the
jslayer with the same timeout value are counted as a single entry in this statistic.
Libuv Handle Trend
The statistics for libuv handles in this process, where:
Each TCP connection uses one handle.
Each open file uses one handle.
How to configure alert items
For more information, see User Guide: Configure Alerts.
How does the Node.js Performance Platform perform fault diagnosis?
For more information, see the Fault Diagnosis User Guide.
What is the difference between abnormal logs and performance logs?
Abnormal logs are generated by the application.
Performance logs are written by the runtime to the directory specified by
NODE_LOG_DIR(the default is/tmp) if you setENABLE_NODE_LOG=YES. By default, performance logs are not written. A new log file is created each day. For example, the filenode-20171010.logcontains the logs from October 10, 2017.
How to determine if there is a memory leak
The memory monitoring metrics section shows that memory usage continuously increases over time.
How to determine if there is a CPU hot spot function
CPU usage remains consistently high.