I'm trying to measure the performance of my application and bumped into an issue with the Windows system. When I'm bombarding the app below via the http://localhost:8001/ address, I get about 4 thousand requests. However, if I start doing the same from another laptop, I get only ~150 requests per second. The network is a home WiFi with about 45Mbps speed. What is more important, the amount of instances does not make any difference, the speed is always the same 150 requests per second. I've disabled the firewall on the machine with the server application but still see the same 150 requests per second. Please, help me understand this issue, what is going on?
UPD: I create the load using ab -c 10 -n 1000 http://<host>:8001/ where <host> is either the name of another laptop or localhost.
const http = require('http');
const cluster = require('cluster');
const numCPUs = 8;
const requestListener = function (req, res) {
res.writeHead(200);
if (req.url === '/test') {
res.end(JSON.stringify(content)); // some big payload
return;
}
res.end('some small payload');
}
cluster.schedulingPolicy = cluster.SCHED_RR;
if (cluster.isMaster) {
console.log(`Master ${process.pid} is running on ${numCPUs} CPUs`);
for (let i = 0; i < numCPUs; i++) {
cluster.fork();
}
cluster.on('exit', (worker, code, signal) => {
console.log(`worker ${worker.process.pid} died`);
});
} else {
const server = http.createServer(requestListener);
server.listen(8001);
}