-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
High load on node library when CPU profiling #4450
Comments
After that issue, I brushed up on my knowledge of profiling reports, but I'm still a bit rusty, but here's a go:
This section, at the top, refers to what parts are using how much CPU. As you can see, the CPP libraries are using some, as they are the backbone of Node.js. Node itself is using a large portion of the CPU, typically in response to whatever code you are running. Looking down at the report, Additionally, there's also flamegraphs. These are human-visualizable graphs of CPU usage. They could also help you identify what parts of your script are using the most CPU (https://nodejs.org/en/learn/diagnostics/flame-graphs) |
Thanks for your response. elastic-apm-node is a module I added to help me tracking down my performance issue 😕 |
Haha. Well, according to the profile report, it looks like |
I finally obtained a flamegraph, thanks to 0x. As I feared, it seems my high CPU is mostly coming from my HTTP sending, using axios. I will try using a Worker to avoid blocking my app. Thanks. |
here is how I would interpret the profile output. it looks at the CPU consumption of the process from three different perspectives (that corresponds to three different sections in the log):
from the first two sections it is already obvious that now, in this case, I would look air the hope this helps! |
Node.js Version
v18.9.0
NPM Version
v10.7.0
Operating System
Ubuntu 20.04 Linux 5.4.0-92-generic
Subsystem
inspector
Description
Hello,
I have an app that is basically subscribing to MQTT channels and sending HTTP request.
I have a high RAM and CPU load on my app and I am trying to find out the culprit.
I ran a
node --prof
to run a CPU profiling and here is the result.My report indicates node library using 61.4% :
What does that mean ?
I found the following issue that looks like my problem, but no solution has been found:
#4422
Thanks.
Minimal Reproduction
No response
Output
processed.txt
Before You Submit
The text was updated successfully, but these errors were encountered: