Node.js CPU load balancing

cpu, cpu-usage, jmeter, node.js, performance

Solution

Are you using `cluster` module to load-balance and Node 0.10.x?

If that's so, please update your node.js to 0.11.x.

Node 0.10.x was using balancing algorithm provided by an operating system. In 0.11.x the algorithm was changed, so it will be more evenly distributed from now on.

Problem

I created test with JMeter to test performance of Ghost blogging platform. Ghost written in Node.js and was installed in cloud server with 1Gb RAM, 1 CPU. I noticed after 400 concurrent users JMeter getting errors. Till 400 concurrent users load is normal. I decide increase CPU and added 1 CPU. But errors reproduced and added 2 CPUs, totally 4 CPUs. The problem is occuring after 400 concurrent users. I don't understand why 1 CPU can handle 400 users and the same results with 4 CPUs. During monitoring I noticed that only one CPU is busy and 3 other CPUs idle. When I check JMeter summary in console there were errors, about 5% of request. See screenshot. I would like to know is it possible to balance load between CPUs?

Original source

Related problems