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

Production Use #1

Closed
ghost opened this issue Jun 18, 2014 · 3 comments
Closed

Production Use #1

ghost opened this issue Jun 18, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Jun 18, 2014

Thank you the research.

I see a small typo bug.
It should be
var worker = workers[worker_index(connection.remoteAddress, num_processes)];

The scripts works well for me.

elad pushed a commit that referenced this issue Jun 18, 2014
Fix typo, pointed out by @maxime-crunding in issue #1.
@elad
Copy link
Owner

elad commented Jun 18, 2014

Thanks! Fixed.

@elad elad closed this as completed Jun 18, 2014
@ghost
Copy link
Author

ghost commented Jun 18, 2014

I want to use this code in production.
Do you have any recommendation/addition?

@elad
Copy link
Owner

elad commented Jun 18, 2014

Yes, there's a caveat, see joyent/node issue #7784. I would wait a bit before using it in production, unless the caveat is insignificant for your scenario.

In some cases the master process seems to not get the connection event causeing the client to hang. If the client retries, it usually succeeds. However this is still unreliable.

If this won't be fixed in the next couple of days I will rewrite the example in this repository using a different approach.

Here's what I have in mind:

  • Start multiple node.js instances on different ports
  • Use nginx upstream with ip_hash as suggested in http://socket.io/docs/using-multiple-nodes/
  • Use cluster for respawning
  • Add an example of communicating between the node.js processes when broadcasting messages

@ghost ghost changed the title Great work Production Use Jun 23, 2014
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