Code Monkey home page Code Monkey logo

Comments (4)

nLassimonneAdveez avatar nLassimonneAdveez commented on August 13, 2024 1

Thanks for your response. elastic-apm-node is a module I added to help me tracking down my performance issue 😕
I will try without this module.

from help.

nLassimonneAdveez avatar nLassimonneAdveez commented on August 13, 2024 1

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.
FYI, what we were seeing on elastic-apm-node seems to only be a wrapper, hiding the real culprit.

Thanks.

from help.

RedYetiDev avatar RedYetiDev commented on August 13, 2024

After that issue, I brushed up on my knowledge of profiling reports, but I'm still a bit rusty, but here's a go:

 [Shared libraries]:
   ticks  total  nonlib   name
  100357   61.4%          /usr/local/nvm/versions/node/v18.9.0/bin/node
  37636   23.0%          /usr/lib/x86_64-linux-gnu/libc-2.31.so
   4053    2.5%          /usr/lib/x86_64-linux-gnu/libpthread-2.31.so
    339    0.2%          /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.28
    130    0.1%          [vdso]

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, elastic-apm-node (especially the http-apm-client files) appears to be using a decent amount of CPU, so maybe that's the bottleneck?


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)

from help.

RedYetiDev avatar RedYetiDev commented on August 13, 2024

Thanks for your response. elastic-apm-node is a module I added to help me tracking down my performance issue 😕

I will try without this module.

Haha. Well, according to the profile report, it looks like knex is also using a lot of CPU. I highly recommend flamegraphs to determine what functions are using the most CPU.

from help.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.