The following coed gives me an EINVAL error and Node crashes:
var posix = require('posix');
console.log(posix.getrlimit('nofile'));
posix.setrlimit('nofile', {soft: 10000});
ERROR:
/var/myfil/index.js:19
posix.setrlimit('nofile', {soft: 10000});
^
Error: EINVAL, Invalid argument
at Object.<anonymous> (/var/myfile/index.js:19:7)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
What is the problem? It's exactly like the docs.
That happens if you try to set a soft limit that's higher than the hard limit.
Try setting them both:
posix.setrlimit('nofile', { soft: 10000, hard: 10000 });
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With