I have in my application a calculation like
var points= [...3000];
for (var i = 0; i < points.length; i++) {
for (var j = i+1; j < points.length-1; j++) {
for (var k = k+1; k < points.length; k++) {}
}
}
I use a 2 core processor and 2GB of RAM and the calculation is solved in 97132ms I did an upgrade on my server and I'm using a 4 core and 8GB of RAM, but i got the same result after upgrade
I try
if (cluster.isMaster) {
var numCPUs = os.cpus().length;
// Master:
// Let's fork as many workers as you have CPU cores
for (var i = 0; i < numCPUs; ++i) {
cluster.fork();
}
and execute my application like node --nouse-idle-notification --expose-gc --stack_size=7168 --max-old-space-size=7168 bin/www
I think de node v8 doesn't use 100% from my CPU