3 ms·
> If you have multiple cores and a single-threaded application that you'd like to scale, then assuming the other resources are plentiful, just spawn multiple in
by troncheadle 11y ago
> If you have multiple cores and a single-threaded application that you'd like to scale, then assuming the other resources are plentiful, just spawn multiple instances and pin them to those extra cores.
Not to mention, this is part of the core functionality of node. The cluster module is built in. https://nodejs.org/api/cluster.html https://nodejs.org/api/cluster.html.
- iends 11y agoCluster isn't sufficient because you cannot communicate between processes really.
- cphoover 11y agonode child process module supports IPC bidirectional communication between parent and child processes.
- MrLeap 11y agohttps://www.npmjs.com/package/bobbin https://www.npmjs.com/package/bobbin my buddy wrote this npm module to make that use case easy. I've put it to work and it's pretty awesome.