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

Adds --cluster support #2596

Merged
merged 2 commits into from
Aug 30, 2016
Merged

Adds --cluster support #2596

merged 2 commits into from
Aug 30, 2016

Conversation

flovilmart
Copy link
Contributor

@flovilmart flovilmart commented Aug 26, 2016

Adds ability to start a mulitprocessed parse-server through cluster when using the CLI.

  • Use --cluster to automatically select the number of processes
  • Use --cluster 2 to start 2 processes

@codecov-io
Copy link

codecov-io commented Aug 27, 2016

Current coverage is 92.10% (diff: 100%)

Merging #2596 into master will decrease coverage by <.01%

@@             master      #2596   diff @@
==========================================
  Files            98         98          
  Lines         11956      11956          
  Methods        1463       1463          
  Messages          0          0          
  Branches       1931       1931          
==========================================
- Hits          11013      11012     -1   
- Misses          943        944     +1   
  Partials          0          0          

Powered by Codecov. Last update 2aa14ad...af5d49a

@steven-supersolid
Copy link
Contributor

When a forked process exits, the behaviour is a little different to throng which seems to be restarting that process: https://github.com/hunterloftis/throng/blob/master/lib/throng.js#L39 This would be important in keeping a constant number of processes when one of them has a problem.

LGTM apart from that and really useful.

@flovilmart
Copy link
Contributor Author

Uhh you're right :) so call another fork on('exit'), I'll run some tests locally to see what's going on

@@ -85,7 +85,8 @@ if (options.cluster) {
cluster.fork();
}
cluster.on('exit', (worker, code, signal) => {
console.log(`worker ${worker.process.pid} died`);
console.log(`worker ${worker.process.pid} died... Restarting`);
cluster.fork();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@steven-supersolid I believe that will do :)

@ghost
Copy link

ghost commented Aug 29, 2016

@flovilmart updated the pull request - view changes

@flovilmart flovilmart modified the milestone: 2.2.19 Aug 30, 2016
@flovilmart
Copy link
Contributor Author

flovilmart commented Aug 30, 2016

Merging as reviewed by @steven-supersolid and side effect less.

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

Successfully merging this pull request may close these issues.

3 participants