You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been chatting with @zbjornson on another PR about making sure the aggregator doesn't gum up the primary thread when run in cluster mode, and it's dawned on me that rather than splitting up clusterMetrics() with setImmediates, it would be much simpler if the main thread could offload stats monitoring to a worker, which can then use all the CPU it wants.
Activity
jdmarshall commentedon Jul 11, 2025
After I finish #688 I might have time to look at this.
Add Worker Support.
Add Worker Support.
jdmarshall commentedon Jul 13, 2025
I've been working in this code recently.
I have a PoC but I may be stuck.
I've been chatting with @zbjornson on another PR about making sure the aggregator doesn't gum up the primary thread when run in cluster mode, and it's dawned on me that rather than splitting up clusterMetrics() with setImmediates, it would be much simpler if the main thread could offload stats monitoring to a worker, which can then use all the CPU it wants.
Problem is the Node folks didn't get the worker API right on the first or second try (see also piscina, and https://nodejs.org/api/worker_threads.html#workerpostmessagetothreadthreadid-value-transferlist-timeout which is unstable but allows you to message arbitrary workers)
jdmarshall commentedon Jul 14, 2025
I have a working prototype now, by using n + 1 BroadcastChannels
But it supports autodiscovery, and shunting collection into a Worker.
Add Worker Support.
jdmarshall commentedon Dec 9, 2025
#693