1

Trying to get the best performance from my application with as little setup as possible.

I'm struggling to find a consensus online of whether it would be better to use the Node cluster module in a Docker container, or to use a cluster of Docker instances instead.

OPINION: Node cluster first, then Docker cluster

OPINION: Don't use Node cluster in a Docker instance

Community
  • 1
  • 1
hoodsy
  • 894
  • 2
  • 11
  • 19

1 Answers1

2

Depends what "best performance" means? What is the bottleneck in your case? CPU? RAM? Network? Disk-I/O? Advantages of a node cluster:

  • All communication is in memory.

Disadvantage

  • The solution doesn't scale beyond one host. If the host is overloaded, then so is your service

Advantages of a docker cluster:

  • high availability.
  • more network bandwidth, more resources as you have more hosts

Assuming you run your software as a service in docker anyway, I can't see the issue of "little setup as possible". Use both if it makes sense.

CFrei
  • 3,552
  • 1
  • 15
  • 29
  • Network is the bottleneck in my case. Do I have more network availability if my machine has 4 cores and I run 4 docker instances or 1 docker instance and a node cluster utilizing all 4 cores? Do I potentially lose performance by not using the ```cluster``` module? – hoodsy May 10 '17 at 18:43
  • 1
    if you have 1 host it just doesn't matter what you choose. I would pack my software in docker containers anyways for the whole build chain. Really depends now if you want rolling updates (=> docker cluster) or only have one system (=> nodejs cluster). – CFrei May 10 '17 at 20:41