-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Add GC Insights #4496
Comments
are there specific data points you'd like to retrieve from the GC, or simply be able to call a callback before/after the GC? also, I believe this API only addresses the GC calls that interrupt the main thread, and not for those collections happening off the main thread. |
I'd opt for a minimum set of metrics in the beginning.
Further information, e.g. heap statistics, could be retrieved in user-land via
I traced the usage of the v8 What I want to say: The GC prologue and epilogue callbacks are called whenever the GC Tracer runs. As such it should be sufficient for our use case as well. |
@nodejs/ctc Thoughts? |
One thing to note is that this use-case has some overlap with tracing and trace-event (some background). Now that blink's trace-event has landed in V8 4.9, once we implement a trace-event buffer in Node.js, we should be able to expose the trace stream to user space which could include these gc trace events. |
That is some very big overlap. I like where the trace-event discussions are going. If trace-event works out and is controllable via Node.js, my proposal would be completely obsolete. Still got some questions in my head and will post them to the WG. I'll update this issue once these questions are resolved. Thank you @ofrobots. |
@ofrobots could you explain what that does in some more detail? In general I think this sounds useful. (Although I don't know this area in any great detail.) |
+1 - today monitoring GC activites needs modules like memwatch-next, gc-profiler or gc-stats. I hear sometimes complains from windows users having problems to compile those native modules ...it would be great to have this available in node! |
Hi, any progress for this issue? It looks windows support here dainis/node-gcstats#18 stucks as well. I just want to know if it makes sense to invest more time in gc-stats windows support/providing pre-compiled modules for gc-stats. |
Nothing of note so far. |
I think this has been superseded by nodejs/diagnostics#84. I'll go ahead and close this out but let me know if I should reopen. |
As more and more enterprise customers are using Node.js, the demand for Node.js monitoring increased as well. Node.js already supports a bunch of ways for retrieving interesting information, but GC information is lacking. Many platforms, e.g. the JVM, support means to programmatically retrieve information about GCs. It would be useful if Node.js had these features too.
The main users for GC insights will probably be monitoring products. The way these products currently access GC information is via native addons that make use of
AddGCEpilogueCallback
. An example open source implementation of this is node-gcstats. Strongloop, Ruxit, Instana and others have their own, probably similar implementations.Users of such monitoring tools, or more generally users interested in GC activity, need to compile native addons in order to access this information. It is hard to explain why users need to do this (or have a package such as
build-essential
installed). This gets increasingly harder in Java shops which are used to having everything in the platform. Building these addons automatically on install only reduces this problem, but doesn't remove it.Node.js used to contain post-gc event infrastructure, but it was removed at the end of last year (Dec 2014) by @bnoordhuis with the following commit:
I believe that we got users of such functionality (mainly through monitoring products) and that we could fix the implementation (the second argument in the commit comment). For these reasons, I propose to add the removed functionality back to the
v8
module and improve on it, e.g. by scheduling work viauv_queue_work
. I am willing to do this work and open a PR.Disclaimer: I am working for Instana and we have a Node.js sensor with GC information.
The text was updated successfully, but these errors were encountered: