Too many open files using child_process

I get the following error only on my Rackspace Ubuntu Maverick instance ... but not on my local Ubuntu Lucid VM:

pipe(): Too many open files
pipe(): Too many open files

child_process.js:223
  var fds = this._internal.spawn(path,
                           ^
Error: Error spawning
    at ChildProcess.spawn (child_process.js:223:28)
    at child_process.js:10:15
    etc..etc..

The code that generates it:

function getHeader(url, callback)
{
  var client = spawn('curl', ['-I', url]);
  client.stdout.on('data', function(data)
  {
    client.kill('SIGTERM');
    callback(data.toString('utf8'));
  });
}
+5
source share
1 answer

It would be useful to know how low your hosting provider has set a file limit: it ulimit -nwill tell you that the limit is setrlimits(2)indicated on the number of open file descriptors for each process. Typical installations use 1024. Perhaps they installed it much lower to limit memory usage in the kernel.

, , Rackspace ( , , /etc/security/limits.conf), , . , , , .

, node . /proc/$(pidof node.js)/fd/, , . , , ?

+3

All Articles