Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Multiple now clients in one node instance
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brendan  
View profile  
 More options Mar 18 2012, 7:50 pm
From: Brendan <brend...@gmail.com>
Date: Sun, 18 Mar 2012 16:50:08 -0700 (PDT)
Local: Sun, Mar 18 2012 7:50 pm
Subject: Multiple now clients in one node instance
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!


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Brendan  
View profile  
 More options Mar 19 2012, 4:24 am
From: Brendan <brend...@gmail.com>
Date: Mon, 19 Mar 2012 01:24:37 -0700 (PDT)
Local: Mon, Mar 19 2012 4:24 am
Subject: Re: Multiple now clients in one node instance
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:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »