For anyone following from home, I hacked up a solution that seems to
work.
I modified now/lib/nodeclient/now.js in a couple ways:
- Get rid of the code that returns an existing now instance for the
same URI, i.e. get rid of:
if (Object.prototype.hasOwnProperty.call(nowObjects, uri)) {
return nowObjects[uri];
}
- Force socket.io to create a new connection for the same URI, rather
than reusing an existing one:
var socket = io.connect(uri, { 'force new connection': true });
Now I can stress test my node server using now, which is really neat.
Would love to hear if there's a better way of doing this!
On Mar 19, 10:50 am, Brendan <brend...@gmail.com> wrote:
> hi all,
> I want to use a node instance to stress my node server. I could do
> something like this on my node instance:
> var nowjs = require('../node_modules/now/lib/nodeclient/now.js');
> for (var i = 0; i < 10; i++)
> now[i] = nowjs.nowInitialize('http://localhost:8080');
> but the code in now/lib/nodeclient/now.js sees the same URL being used
> and returns a prior instance.
> Is there a good way to establish multiple now instances on a single
> node instance, to really stress my server?
> thanks!