DEV Community

Discussion on: How can Nodejs handle many requests ?

Collapse
 
arswaw profile image
Arswaw

The Cluster module in NodeJS has what you need. The documentation has a simple example to start. The way it works is that is causes the threads, (which run on as each individual CPU core) to share the same port. It then load balances requests on the various threads.

If you want to have a long running compute operation, you might try the NodeJS Child Process core module.