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

285
Visualizações
React js build crashing when more than 20 users accessing it at same time with an error Error: EMFILE: too many open files

My react application's production build is running in a windows server 2019, having intel Xeon 6204R CPU 4 core and 16 Gb ram. The app is working fine but if more than 20 users using the app at the same time then it is crashing with an Error-

Error: EMFILE: too many open files, open 'C:\ess\build\index.html'

Image of error I am getting while the react build crashes.

I am not able to understand if this error is because of some node limitation or on windows I have to change any setting or is it because my react code is not optimized or opening unnecessary files.

fixes I have tried-
1- created own node server to serve react build instead of serve package.
2- Monkey patching the fs module of node js with the graceful-fs module.
3- Tried to add watchman still not working.

Monkey-Patching I have done in my server.js file-

const fs = require('fs')
const gracefulFs = require('graceful-fs')
gracefulFs.gracefulify(fs);

I tried to test it with other code samples

monkey-patching for fs.readFile working fine.

    for (x = 0; x < 10000; x++) {
        fs.readFile('testfiles/' + x, 'utf8', (err, data) => {
          data && console.log('reading file', data);
          err && console.log(err?.toString());
        })
    }

but for fs.open still getting the same error after 8188 files.

 for (x = 0; x < 10000; x++) {
fs.open('testfiles/' + x, 'rs+',  function(err, fd) {
    fd && console.log('reading file', fd);
      if(err && i==0){
        console.log('here', err?.toString());
        i++;
      }
    });
  }

Error: EMFILE: too many open files, open 'C:\ess\testfiles\8189'

I have also tried to find ulimit alternative of Linux in windows but still not able to find it.

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