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

Set the max number of driver instances to CPU cores #25

Merged
merged 1 commit into from
Jun 14, 2017

Conversation

vmarkovtsev
Copy link
Contributor

  • Add the environment variable

@vmarkovtsev vmarkovtsev force-pushed the master branch 2 times, most recently from 41f4a82 to 5ed231b Compare June 14, 2017 09:58
pool.go Outdated
return MovingAverage(10, MinMax(1, 10, AIMD(1, 0.5)))
maxInstances := 0
// Try to read maxInstances from the environment variable
maxInstancesEnv := os.Getenv("BBLFSH_SCALING_MAX_INSTANCES")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it'd be better to move this context dependant code outside and pass them as arguments explicitely

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see that DefaultScalingPolicy() is used in many places, including the tests. What shall I do with all of those?

Copy link
Member

Choose a reason for hiding this comment

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

@abeaumont that can be done by not using DefaultScalingPolicy() and instantiated it instead.

Nonetheless, this code should be in func init(), initializing a global variable (e.g. DefaulMaxInstancesPerDriver), and then using that variable here.

But you're right that at some point we should move this kind of configuration to server.go and propagate it up to the cli package. I think would leave that to a further PR though.

@vmarkovtsev vmarkovtsev force-pushed the master branch 2 times, most recently from 66086af to 739d5d0 Compare June 14, 2017 10:08
pool.go Outdated
return MovingAverage(10, MinMax(1, 10, AIMD(1, 0.5)))
maxInstances := 0
// Try to read maxInstances from the environment variable
maxInstancesEnv := os.Getenv("BBLFSH_SCALING_MAX_INSTANCES")
Copy link
Member

Choose a reason for hiding this comment

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

@abeaumont that can be done by not using DefaultScalingPolicy() and instantiated it instead.

Nonetheless, this code should be in func init(), initializing a global variable (e.g. DefaulMaxInstancesPerDriver), and then using that variable here.

But you're right that at some point we should move this kind of configuration to server.go and propagate it up to the cli package. I think would leave that to a further PR though.

@codecov
Copy link

codecov bot commented Jun 14, 2017

Codecov Report

Merging #25 into master will decrease coverage by 0.53%.
The diff coverage is 42.85%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #25      +/-   ##
==========================================
- Coverage   61.03%   60.49%   -0.54%     
==========================================
  Files          13       13              
  Lines         675      681       +6     
==========================================
  Hits          412      412              
- Misses        225      229       +4     
- Partials       38       40       +2
Impacted Files Coverage Δ
pool.go 87.09% <42.85%> (-3.51%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fc0811c...751d64d. Read the comment docs.

@vmarkovtsev vmarkovtsev force-pushed the master branch 2 times, most recently from f9ec4bc to 96f8939 Compare June 14, 2017 10:21
@vmarkovtsev
Copy link
Contributor Author

@smola Did as you said, changed the corresponding test to pass.

@smola smola merged commit 75c92cb into bblfsh:master Jun 14, 2017
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.

None yet

3 participants