I’d like to restrict child processes from writing too much data or taking up too much cpu time (infinite loop). In C, I’d call setrlimit(2) to do that. Is there something like this in node.js?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As far as I know, there is no node.js extension that provides
setrlimit()functionality, but you can work around the limitation with a small shell workaround hack:Looks like core node.js will never have
setrlimit()now that it supports Windows and is no longer a POSIX-only framework: https://github.com/joyent/node/pull/2143Update: I converted the rejected Node patch into a separate
posixextension module which is now available in NPM and Github.