Comments (11)
Added support for node!
Let us know if you have any feedback!
from pyroscope.
@petethepig I've wrote some kind of wrapper around nodejs profiling in 2019, you can find them there: cpu and heap. Now that i re-read them i find them pretty ugly but it works quite well (i've been using in prod since).
I tried to document as much as i could back then inside both package's readme, however there are still few things worth to know:
- google/pprof-nodejs is using C++ addon so it can be quite hard to setup correctly for newcomers (requires gcc when installing deps)
- generally using
inspector
works well but you are essentialy using main thread cpu to receive/transmit profiling data back to your platform and specially goes between c++ and js which generally block userland code, hence introducing overhead. - Both of them are only able to profile JS code, some work was started to hook with
pref
dynamically at runtime (currentlyperf
is only togglable with cli: docs) which would then make available profiling of C++ code too (so V8, libuv and nodejs itself)
Generally you'll find some historic in the nodejs's diag working group: nodejs/diagnostics#148 nodejs/diagnostics#444 nodejs/diagnostics#150
Feel free to reach out (mail in bio) if you have any questions
Edit: Congrats on the launch on HN btw :)
from pyroscope.
Let us know if you have any feedback!
Feedback: I don't think it's usable, which is probably why it's not a very popular package.
@Rperry2174, although Node support is added, Node 18 LTS as of 2022-10 is still not supported. pyroscope-nodejs relies on pprof, which only supports Node 10, 12 or 14.
I can see that pyroscope-nodejs is moving to use @datadog/pprof
in grafana/pyroscope-nodejs#19, but this merge request will be 1 year old next month.
It would be great to have support for Node 18 to make it usable.
from pyroscope.
I don't understand why you would need to profile v8 for nodejs. that's like profiling CPython compared to simply python as you already did. let v8 devs take care of v8, they have their tools.
now for nodejs, you can hook require, this will allow you to modify any local or global module, maybe look at istanbul instrumentor on npm. you could just hook everything and only profile if delta time is over 0.01s.
note that in node the architecture is event based but still a stack trace would be useful.
from pyroscope.
Some time ago I did a summary on NodeJS profilers: https://github.com/slonka/nodejs-production-ready-profiling - things might be outdated but you might find some useful info there.
from pyroscope.
Found this project, seems promising, but this is for heap profiling:
from pyroscope.
~0x seems promising for CPU profiling https://github.com/davidmarkclements/0x ~
But the problem is it does the whole process from start to finish, no way to do 10 second intervals.
from pyroscope.
This is promising https://github.com/google/pprof-nodejs
from pyroscope.
Also not directly related to NodeJS but you might find this interesting for browser profiling: https://wicg.github.io/js-self-profiling/
from pyroscope.
don't understand why you would need to profile v8 for nodejs. that's like profiling CPython compared to simply python as you already did. let v8 devs take care of v8, they have their tools.
I had an issue with v8 deoptimization that pushed one of my app CPU usage to >80% (vs 40% baseline). You can also have C++ dependencies (like grpc) that won't be profiled.
Even if issues like this are rare, doesn't mean its useless to support those. Altrought its hard to support perf
i agree.
now for nodejs, you can hook require, this will allow you to modify any local or global module, maybe look at istanbul instrumentor on npm. you could just hook everything and only profile if delta time is over 0.01s.
I would suggest to lookup performance for this, this is highly ineficient and block the main thread (so it slow your app), the v8 profiler is using a seperate thread.
from pyroscope.
Adding these to the list from Node.js slack:
https://github.com/Unitech/pm2
https://pm2.io/docs/enterprise/guides/profiling/
https://blog.rafaelgss.com.br/node-cpu-profiler
https://github.com/serkan-ozal/middy-profiler
from pyroscope.
Related Issues (20)
- Investigate store-gateway panic
- Add options to re-enable removed features in flame graph view: filter function table and do not hide narrow call stack bars HOT 2
- Add export to pprof HOT 2
- Don't try delete old ingester blocks without bucket store configured HOT 4
- some icons not showing up
- Python package pyroscope-io not working with Python 3.12 HOT 2
- Some characters make tags / labels unquery-able HOT 1
- No more adhoc feature since 1.3.0 upgrade
- module memberlist-kv has failed immediately on 240.0.0.0/4 subnet HOT 3
- Flamegraph: Filter textbox doesn't filter top table HOT 4
- Provide an API that explains the query execution plan
- eBPF: Matching of PID fails in nested namespace deployment HOT 1
- API to check whether there is any data for the current tenant
- Fail to install simple pyroscope using helm chart HOT 5
- Healthcheck keeps failing HOT 1
- The backend API should provide additional information in the HTTP response when there's an error HOT 4
- Profiles heatmap
- Profile entries HOT 3
- Time range "with lenses"
- Can you release a helm chart for pyroscope 1.4.0? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyroscope.