Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

286
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!