Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

149
Visualizações
node http performance under windows

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);
}

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda