xmppo / node-xmpp-bosh

An XMPP BOSH & WebSocket server (connection manager) written on node.js using Javascript
https://github.com/xmppo/node-xmpp-bosh
263 stars 85 forks source link

can we configure module to work with multi core CPU? #22

Closed vinnitu closed 12 years ago

dhruvbird commented 12 years ago

Nope, node.js is single threaded.

You can however start multiple instances of the bosh server and reverse proxy using nginx and the nginx-sticky-module (mentioned in README.md).

vinnitu commented 12 years ago

But what about cluster? i mean http://nodejs.org/api/cluster.html

dhruvbird commented 12 years ago

With cluster, you are essentially fork()ing processes. Similar to what you would do if using nginx as a reverse proxy and making the sessions sticky in some way.

It is not very clear to me how cluster manages to ensure that multiple requests from the same client will be routed to the same bosh server instance.

vinnitu commented 12 years ago

I think master node can works like nginx module. No?

dhruvbird commented 12 years ago

No idea - I couldn't find that info. anywhere on the project page.

In the long term though, it probably makes sense to support the cluster since I can imagine that people would want to run a cluster of bosh proxies.

For the near future though, the cluster API is highly unstable and subject to change. I'll reopen the issue when the API stabilizes.

dhruvbird commented 12 years ago

On second though, it seems that the sticky-session functionality is something that is application specific and will have to be programmed in by the programmer in the http serving function as shown in the example on this page: http://nodejs.org/api/cluster.html