Benchmarking Node.js setTimeout at Scale: Memory, Lateness and Restart Risks
A DEV Community article argues that the question of how many setTimeout calls Node.js can handle depends on the specific machine, so it offers a benchmark script rather than quoting figures. The author deliberately withholds personal results, since they would not transfer to other servers, Node versions or workloads. The benchmark measures per-timer memory cost, lateness relative to scheduled times, and the effect of many pending timers on event-loop delay. It recommends running the script at several sizes, adding background CPU load and using realistic payloads for more representative results. The article also flags that pending timers are lost when a process restarts, a risk that cannot be measured by the script itself.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in