Why does ClassCraft run 4 instances per core?


Classcraft uses an 8 core server and runs 4 Meteor instances per core. Why set things up this way instead of just running 8 meteor instances (1 per core)?

Source for classcraft on 8 * 4:


Take a look at the “Maximizing throughput” section of this: https://www.phusionpassenger.com/documentation/ServerOptimizationGuide.html

especially where it reads:

if your CPUs are not used constantly, e.g. because they’re often blocked on I/O, … increasing the number of processes/threads does increase concurrency and throughput, at least until the CPUs are saturated.

It is all about CPU utilization, and modern CPU architectures being very efficient in context switching, so the cores = instances formula is actually an old concern. Perhaps it is still valid for some underpowered cloud/vps virtual cpu’s, but that’s for you to check up on.

I happily make use of CPU over-utilization.

In fact, you are doing that on your own computer. Bring up the process monitor / task manager and see how many different pieces of software are running at the same time. It certainly is more than the number of cores you have.