Friday 14 April 2017

Node + Express: loadtest causing the application to quit with Error: accept ENFILE

My app quits at relatively low stress point when I run load test on it. For testing I use this npm package loadtest.

I run the test at 1000 requests per second with 10 concurrency for 10 seconds.

loadtest http://localhost:3000/my/api -t 10 -c 10 --rps 1000

The application quits after about two seconds and gives the following error which is not very useful.

events.js:163
      throw er; // Unhandled 'error' event
      ^

Error: accept ENFILE
    at exports._errnoException (util.js:1050:11)
    at TCP.onconnection (net.js:1462:24)

Apparently, this is related to the number of open files. I tried this command ulimit -n <number> but it doesn't help. It's limited at 9999.

My local machine is a Mac OS Sierra, CPU: 1.6GHz, RAM: 8GB.



via Sorakthun Ly

No comments:

Post a Comment