clustering on one cpu



  • Is it worth setting up two NodeBB processes if I only have one CPU? Will I see any benefit from the clustering? Or should I assume one process per core?

    Specifically the clustering defined here: http://nodebb.readthedocs.io/en/latest/scaling/index.html#utilise-clustering



  • Are you using CPU to mean core? Clustering with one thread engine (vCPU) would be bad, you'd be contending for resources without benefit. Clustering with many cores that are not needed for other things could be beneficial. Are you seeing performance issues? A single thread engine (vCPU) can handle millions of hits a month without working hard at all. You'd have to be pretty huge to have any reason to consider a second thread engine (vCPU) for NodeBB.



  • We have one vCPU for nginX, several for MongoDB, one for each NodeBB instance (we host many on one system) and some idle for the OS to use as needed. That's beneficial. Clustering adds tons of overhead and unless you are thread bound AND have offloaded other functions, you will only add latency by doing so. Scaling out hurts you until you've exhausted scaling up.



  • @scottalanmiller said in clustering on one cpu:

    Are you using CPU to mean core? Clustering with one thread engine (vCPU) would be bad, you'd be contending for resources without benefit. Clustering with many cores that are not needed for other things could be beneficial. Are you seeing performance issues? A single thread engine (vCPU) can handle millions of hits a month without working hard at all. You'd have to be pretty huge to have any reason to consider a second thread engine (vCPU) for NodeBB.

    I wrote this last night and meant that I have one core, not specifically one CPU.

    Thanks for the insight though!



  • Ah, with just one core, then you want to minimize instances as much as possible. That one thread engine is already going to be context switching just for basic tasks. You don't want to add anything to it. I would suggest three vCPU as a minimum as your three big workers can each load into cache and stay there.



  • @scottalanmiller said in clustering on one cpu:

    Ah, with just one core, then you want to minimize instances as much as possible. That one thread engine is already going to be context switching just for basic tasks. You don't want to add anything to it. I would suggest three vCPU as a minimum as your three big workers can each load into cache and stay there.

    My site isn't too busy, so I may stick with the 1 GB of RAM 1 CPU node on Digital Ocean for now. If it gets lots of the 503 errors at some point, I may add the extra CPU.


  • Admin

    @teh_g Keep in mind that the 503 threshold is conservative, it is likely okay for you to raise that number by a bit before having to spin up new servers.



  • @julian said in clustering on one cpu:

    @teh_g Keep in mind that the 503 threshold is conservative, it is likely okay for you to raise that number by a bit before having to spin up new servers.

    We did that too, helped a lot.


Log in to reply
 

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.