Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not use up with node v0.10.0 (v0.10+?) #65

Open
cmawhorter opened this issue May 13, 2013 · 0 comments
Open

Do not use up with node v0.10.0 (v0.10+?) #65

cmawhorter opened this issue May 13, 2013 · 0 comments

Comments

@cmawhorter
Copy link

If up becomes saturated with (very) minimal traffic, the server will become unresponsive to requests and memory usage will skyrocket along with CPU.

I only tested locally, so it's possible it might just be me, but I doubt it.

You may see this message:

(libuv) Failed to create kqueue (24)

index.js

process.title = 'up-test';

var up = require('up')
    , server = require('http').Server().listen(3100);

var srv = up(server, __dirname + '/blah.js', {
        numWorkers: 4
});

blah.js

process.title = 'up-test-worker';

var http = require('http');

module.exports = http.Server(function (req, res) {
  res.writeHead(200);
  res.end('Hello World');
  console.log('connection...' + new Date());
});

setInterval(function() { console.log(process.pid + ' waiting for conntections...'); }, 5000);

Use apache's benchmarking tool:

ab -n16 -c8 http://localhost:3100/

c can be anything > numWorkers
n should be anything > c

On rare occasions, the above command will succeed without causing errors. Might want to try higher numbers.

I didn't investigate too deeply beyond "oh... up is broken", but I think it has something to do with this: http://stackoverflow.com/a/15537504/670023

I think this was discussed in #62, but I wanted to make something more prominent and supply a test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant