Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

284
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda