Comment by jjice
6 months ago
Node gives access to event loop utilization stats that may be of value.
import { performance, EventLoopUtilization } from 'node:perf_hooks'
performance.eventLoopUtilization()
See the docs for how it works and how to derive some value from it.
We had a similar situation where our application was heavily IO bound (very little CPU) which caused some initial confusion with slowdown. We ended up added better metrics surrounding IO and the event loop which lead to us batch dequeuing our jobs in a more reasonable way that made the entire application much more effective.
If you crack the nut on this issue, I'd love to see an update comment detailing what the issue and solution was!
Nut has been cracked! https://news.ycombinator.com/item?id=44436679
And yeah, I've been using prometheus' `collectDefaultMetrics()` function so far to see event loop metrics, but it looks like node:perf_hooks might provide a more detailed output... thanks for sharing