Description
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:
lib,src: remove post-gc event infrastructure
Remove the 'gc' event from the v8 module and remove the supporting
infrastructure from src/. It gets the axe because:
- There are currently no users. It was originally conceived as
an upstreamed subset of StrongLoop's strong-agent GC metrics,
but the strong-agent code base has evolved considerably since
that time and has no use anymore for what is in core.- The implementation is not quite sound. It calls into JS land
from inside the GC epilog and that is unsafe. We could fix
that by delaying the callback until a safe time but because
there are no users anyway, removing it is all around easier.PR-URL: #174
Reviewed-By: Trevor Norris trev.norris@gmail.com
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 via uv_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.