prom-client icon indicating copy to clipboard operation
prom-client copied to clipboard

v8 heap_size_limit

Open sakari opened this issue 1 year ago • 2 comments

Would it be possible to add heap_size_limit gauge to the default nodejs metrics that get collected?

It would be useful for displaying an upper limit for heap usage of node processes

sakari avatar May 21 '24 14:05 sakari

take a look to N|solid it is a nodejs alternative 100% compatible which provides telemetry out of the box, no instrumentation needed. Even the metrics you're looking for and much more.

I wrote a blog post some time ago about how to integrate it with prometheus+grafana, but currently you can connect anything that supports OTLP

riosje avatar Jul 11 '24 14:07 riosje

{ total_heap_size: 6897664, total_heap_size_executable: 524288, total_physical_size: 6356992, total_available_size: 4340358888, used_heap_size: 5763352, heap_size_limit: 4345298944, malloced_memory: 278632, peak_malloced_memory: 1114624, does_zap_garbage: 0, number_of_native_contexts: 1, number_of_detached_contexts: 0, total_global_handles_size: 8192, used_global_handles_size: 5344, external_memory: 2302264 }

I support this. Being able to chart response time curves versus max heap size would be a useful comparison for capacity planning and server tuning purposes.

"Should I run 32 instances per machine at N memory limit, or 30 copies and increase the memory limit per instance by 5%?" is just the sort of question I've been asked in the past.

jdmarshall avatar Jul 07 '25 00:07 jdmarshall