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

docs: add note about using cluster networking-less #17031

Closed

Conversation

pimlie
Copy link
Contributor

@pimlie pimlie commented Nov 14, 2017

Although the primary use-case for the cluster module is networking, the module provides a generic master/worker interface that could also be used if you dont use networking at all. Currently the docs are a bit ambiguous about this as only the primary use-case is ever mentioned, this remark should clarify that the cluster module can also be used without disadvantages if you dont use networking.

Refs: nodejs/help#970

Checklist
Affected core subsystem(s)

doc

@nodejs-github-bot nodejs-github-bot added cluster Issues and PRs related to the cluster subsystem. doc Issues and PRs related to the documentations. labels Nov 14, 2017
@devsnek
Copy link
Member

devsnek commented Nov 14, 2017

networking-less is kinda awk, maybe just without networking

@pimlie pimlie force-pushed the docs-cluster-networkingless-comment branch from 30ccd24 to 0bf0173 Compare November 14, 2017 22:37
@pimlie
Copy link
Contributor Author

pimlie commented Nov 14, 2017

Thanks, you are probably right. Changed both the commit as the commit message

@pimlie
Copy link
Contributor Author

pimlie commented Nov 15, 2017

@Trott Strange, I received an email with your comment about not thinking that networking is the primary use-case for cluster but don't see your comment listed here on github?

The main reason I wrote that networking is the primary use-case is because I have been startled by the current documentation for weeks and @bnoordhuis confirmed this in the referenced nodejs/help issue. Maybe otherwise the Cluster docs could use more of an overhaul then just adding this sentence?

Let me give you a few examples of why I think the current documentation is quite ambiguous if networking isn't the primary use-case:

  • The first/introduction paragraph says The cluster module allows easy creation of child processes that all share server ports. To me this is much more a statement then an introduction for the listed example that uses networking. Although nowhere is said that you can only use cluster with networking, it also doesn't specifically state the inverse which could imply that only the listed example use-case is supported. Hence the ambiguity.

  • Under How It Works again except for the first sentence this whole paragraph only talks about incoming connections and how they are shared between workers. And as this is the only thing that's talked about, it doesnt leave much room to the reader for a use-case without networking.

  • Options like schedulingPolicy or events like listening that only apply to networking are not labelled as such. Of course it is implied and it may even be trivial that they are, but as I said before whats trivial for one may be inconclusive for another. Especially in the bigger picture of the cluster docs as a whole

Not sure if this translates correctly to English, but in Dutch we say All pilsner is beer but not all beer is pilsner. I guess you could say that currently the cluster docs only talk about pilsner (with networking) while it applies to all beers (without networking)? 🍻

@gireeshpunathil
Copy link
Member

I guess the primary use case for cluster is to attain vertical sclability (in-system) to suppliment any short-comings the single-threaded node has in exploiting the multiple cores in the host, and as the primary use case of node is web workload, the cluster naturally inherited it. Nothing stopping one from using cluster for other purposes such as massive computation in a distributed manner. The doc changes looks good to me, thanks!

@Trott
Copy link
Member

Trott commented Nov 15, 2017

@pimlie OK, you convinced me. I never thought of it that way, but the docs seem to make that assumption.

(You didn't see my comment on GitHub because I deleted it immediately after leaving it. I realized I probably wasn't adding a whole lot to the conversation with my question so I deleted it. I guess GitHub sends notifications immediately because the comment was probably there for a matter of seconds. Oh well. Lesson learned.)

@@ -109,7 +109,8 @@ will be dropped and new connections will be refused. Node.js does not
automatically manage the number of workers, however. It is the application's
responsibility to manage the worker pool based on its own needs.


Although the primary use for the cluster module is networking, this module
can also be used for all other master/worker use-cases (without networking).
Copy link
Member

@Trott Trott Nov 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: remove "all" as certainly there are use cases where it is not the right choice.

I'd probably strip it down further to:

Although a primary use case for the `cluster` module is networking, it can
also be used for other use cases requiring worker processes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, sounds better indeed!

Although the primary use-case for the cluster module is networking, the
module provides a generic master/worker interface that could also be
used if you dont use networking at all. Currently the docs are a bit
ambiguous about this as only the primary use-case is ever mentioned,
this remark should clarify that the cluster module can also be used
without disadvantages if you dont use networking.

Refs: https://github.com/nodejs/help/issues/970a
@pimlie pimlie force-pushed the docs-cluster-networkingless-comment branch from 0bf0173 to 9cf0592 Compare November 15, 2017 13:55
@pimlie
Copy link
Contributor Author

pimlie commented Nov 15, 2017

Updated as per @Trott comments

@addaleax
Copy link
Member

Landed in adb7be2, thanks for the PR! 🎉

@addaleax addaleax closed this Nov 18, 2017
addaleax pushed a commit that referenced this pull request Nov 18, 2017
Although the primary use-case for the cluster module is networking, the
module provides a generic master/worker interface that could also be
used if you dont use networking at all. Currently the docs are a bit
ambiguous about this as only the primary use-case is ever mentioned,
this remark should clarify that the cluster module can also be used
without disadvantages if you dont use networking.

PR-URL: #17031
Refs: nodejs/help#970
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins pushed a commit that referenced this pull request Dec 12, 2017
Although the primary use-case for the cluster module is networking, the
module provides a generic master/worker interface that could also be
used if you dont use networking at all. Currently the docs are a bit
ambiguous about this as only the primary use-case is ever mentioned,
this remark should clarify that the cluster module can also be used
without disadvantages if you dont use networking.

PR-URL: #17031
Refs: nodejs/help#970
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@MylesBorins MylesBorins mentioned this pull request Dec 12, 2017
gibfahn pushed a commit that referenced this pull request Dec 19, 2017
Although the primary use-case for the cluster module is networking, the
module provides a generic master/worker interface that could also be
used if you dont use networking at all. Currently the docs are a bit
ambiguous about this as only the primary use-case is ever mentioned,
this remark should clarify that the cluster module can also be used
without disadvantages if you dont use networking.

PR-URL: #17031
Refs: nodejs/help#970
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
MylesBorins pushed a commit that referenced this pull request Dec 19, 2017
Although the primary use-case for the cluster module is networking, the
module provides a generic master/worker interface that could also be
used if you dont use networking at all. Currently the docs are a bit
ambiguous about this as only the primary use-case is ever mentioned,
this remark should clarify that the cluster module can also be used
without disadvantages if you dont use networking.

PR-URL: #17031
Refs: nodejs/help#970
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
gibfahn pushed a commit that referenced this pull request Dec 20, 2017
Although the primary use-case for the cluster module is networking, the
module provides a generic master/worker interface that could also be
used if you dont use networking at all. Currently the docs are a bit
ambiguous about this as only the primary use-case is ever mentioned,
this remark should clarify that the cluster module can also be used
without disadvantages if you dont use networking.

PR-URL: #17031
Refs: nodejs/help#970
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
@gibfahn gibfahn mentioned this pull request Dec 20, 2017
@MylesBorins MylesBorins mentioned this pull request Dec 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cluster Issues and PRs related to the cluster subsystem. doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants