Search code examples
node.jsapachearchitectureload-balancingpm2

Load balancing in node server


I have created a node server using express. I using this architecture as follows: -> I am serving node port as proxy on domain using apache. -> I am using pm2 for handling node process. I have created two cluster and ran individually on different cores. (http://pm2.keymetrics.io/docs/usage/cluster-mode/)

My question is

  1. Am i doing this correct way as production standard?
  2. Do i need load balancing on apache level? because clusters will come in picture after apache?

Am i correct?


Solution

  • Yes, that's correct architecture.

    But Nginx and Pm2 go more hand in hand. Apache is okay too.