> On 30 Sep 2014, at 21:05, Jason Grima <[email protected]> wrote:

> So to my question: What approach is Node better suited to? 
>       • a single monolithic runtime
>       • multiple instances on a single machine - I've seen the new "Cluster" 
> module, which certainly looks interesting, but is listed as experimental... 
>       • multiple instances on multiple machines with proxying/vhosting
>       • some other configuration

Yes, it is better suited to these! ;-)

It's actually good for all of those.

> I've seen some examples of load balancing between processes on a single 
> server, load balancing between servers, using a primary node instance as a 
> routing controller, using a single node instance for everything, multiple 
> http servers in a single js app, and it all seems pretty straight forward, 
> but I'm not sure of the pros/cons of the different approaches, so I'm after 
> recommendations and best practices (if there are any) rather than just 
> blundering forward.

Multiple http servers in a single app is an unusual and purpose-specific 
configuration.

You cluster -- whether with cluster or another load balancer -- when you need 
to scale past a single process. Cluster's got some changes coming in 0.12, but 
the API should be stable. A load balancer in another process is probably better 
for now. If you actually need to scale past a single process.

Multiple machines, of course, let you scale past a single box's limits, and can 
let you start working on redundancy.

All of the clustering options mean you have to manage state synchronization if 
your requests aren't stateless, like any app. This will be natural to you 
coming from PHP, where each request throws away its data at the end, and you 
synchronize with a database, cache or session store.

Aria

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/76CB69CA-E3CB-4131-9572-5676938030FF%40nbtsc.org.
For more options, visit https://groups.google.com/d/optout.

Reply via email to