If you are talking about clustering NodeJS inside another docker component, I don't think this will give you an extra boost. NodeJS, as you said, runs on a single thread, so either pm2 (I really use it) or the docker will have the same effect in terms of load balancing.
NodeJS has a web worker concept to handle how it handles incoming requests, but even a not-so-fast server will handle hundreds of requests because it is a non-blocking architecture.
I know that I still need to dig into the Docker that I want, but I don’t have the time, but I would do this to have 1 docker image on the server (virtual or physical) and then run pm2 multiple instances from node inside him.
The reason for this is that I want Docker to handle dependencies for me, and I want pm2 to handle cluster management, as it has cool features like restarting automatically when memory reaches the target or restarting the node error
source share