Nodejs has a built in clustering mechanism that manages multiple child processes spawn by a master process. This allows the app to scale across multiple processes on multiple threads/cores. the clustering process has a load balancer, but doesn't manage state. this works well for this simple api since no state is needed, just req -> resp.
this should be the first scaling initiative before scaling with docker/k8s.
Nodejs has a built in clustering mechanism that manages multiple child processes spawn by a master process. This allows the app to scale across multiple processes on multiple threads/cores. the clustering process has a load balancer, but doesn't manage state. this works well for this simple api since no state is needed, just req -> resp.
this should be the first scaling initiative before scaling with docker/k8s.
https://nodejs.org/docs/latest-v16.x/api/cluster.html#cluster
https://blog.appsignal.com/2021/02/03/improving-node-application-performance-with-clustering.html https://www.w3schools.com/nodejs/ref_cluster.asp https://blog.logrocket.com/optimize-node-js-performance-with-clustering/ https://medium.com/tech-tajawal/clustering-in-nodejs-utilizing-multiple-processor-cores-75d78aeb0f4f https://www.freecodecamp.org/news/scaling-node-js-applications-8492bd8afadc/amp/