Performance

Capacity and saturation

Capacity is the sustainable work rate under stated latency and error requirements. Saturation occurs when a finite resource, such as a connection pool, cannot serve additional demand without waiting or rejection. A queue can hide overload briefly while increasing response time. Bound both running work and waiting work; reject or defer new work when limits are reached. Under stable steady-state conditions, Little’s Law relates average in-system work L, arrival/completion rate λ, and mean time W: L = λW. Use compatible boundaries and units; it is not an instantaneous sizing formula during overload. A connection pool of four does not imply four requests per second: service time matters. Compare queue wait with service time to diagnose bottlenecks before increasing concurrency. Increasing concurrency without a bound can worsen queueing, memory pressure and downstream failures. Sources: https://nodejs.org/download/release/v22.16.0/docs/api/perf_hooks.html.

Formal Syntax & Structure

nodejs syntaxnodejs
L = arrivalRate * meanTimeSeconds (steady-state model)

Working Example

Example Snippetnodejs
const rate=120, meanSeconds=0.075;console.log(rate*meanSeconds);
Node.js Reference