An asynchronous operation can look slow even when its underlying work is fast. When Node.js has no available thread for a filesystem, DNS, cryptographic, or compression operation, the request waits in a queue before execution begins. The default pool contains four threads, and the pool is shared across these operation classes. section 11.1.10
JavaScript still runs on one main thread, but libuv dispatches selected work to background threads. Consequently, operating-system CPU usage combines event-loop activity, V8 background work, cryptography, DNS, filesystem operations, and other pool work; it does not directly measure event-loop capacity. section 11.4.1
Use these symptoms to distinguish pool saturation from ordinary I/O latency:
- Compare DNS lookup duration with the expected cached result; unusually high lookup latency can indicate that DNS work is waiting for a pool thread. section 11.1.10
- Inspect uvMetricsInfo: loopCount tracks event-loop iterations, events counts processed events, and eventsWaiting reports currently waiting events. section 11.1.10
- Do not scale infrastructure from aggregate CPU alone: pool-heavy work can leave the event loop available, while one busy event-loop core can block requests despite low total CPU. section 11.4.1
const { performance } = require('node:perf_hooks');
setImmediate(() => {
console.log(performance.nodeTiming.uvMetricsInfo);
});
{
loopCount: 1,
events: 2,
eventsWaiting: 0
}Reads event-loop and pending-event metrics through performance.nodeTiming.uvMetricsInfo. section 11.1.10
const fs = require('node:fs');
setInterval(() => {
const start = performance.now();
fs.stat(__filename, () => {
const elapsed = performance.now() - start;
if (elapsed > 10) {
console.log(`Thread pool delay: ${elapsed.toFixed(1)} ms`);
}
});
}, 1000);Measures delayed fs.stat callbacks as a practical signal of thread-pool delay. section 11.1.10












