2

I have a node.js server. I undertsand that 1 node process is bound to 1 CPU/CORE. So I have 2 CORE box, the I use cluster to launch 2 processes to utilize the 2 CORES of box.

However, I am not able to understand how would this work with EC2 instances ECU concept.

for eg. an m1.large instance has 2 vCPUs with 4 ECU's (Effective compute unit)

When I launch node.js with cluster, it launches 2 node processes. However, on my desktop which has 8 cores, it launches 8 node processes.

Now I am wondering whether node.js sever on m1.large with 2 cores and 4 ECUs would perform any better than a box with just 2 CORES and no ECU's

Please answer my query.

GJain
  • 5,025
  • 6
  • 48
  • 82

1 Answers1

2

Amazon ECU are virtual core because they are basically virtual sever with 2 real core of a xeon processor.So a box with real 2 core will perform better than a virtual ECU.And also I dont think than amazon ECU are the same thing like the real cpu core Amazon elastic cloud. As far i am working with nodejs and EC2 on my production server i simply set up two thing to utilize the max cpu power of a m1.large instance.

  1. Multiple node process behind the nginx as reverse proxy load-balencer

    a. I set up different nodejs process on different port.

    b. On front of them an nginx load balancer o distribute the load across each thread.

  2. I have also tries hands with forking child process with main thread using Cluster module .

I finally ends up with nginx and coz its have less management than cluster and also cluster is in experimental stage.

I have also tries exploring more about EC2 and nodejs here is my another answer Utilizing cpu core with nodejs.

And i also suggest you just try some of the solution and keep monitoring your system in each case like cpu uses memory io and finally you will get the better solution for your use case. Every application has its own requirement.So its better to try and find what your applications real need .

Community
  • 1
  • 1
Vivek Bajpai
  • 1,617
  • 1
  • 19
  • 35