-
Notifications
You must be signed in to change notification settings - Fork 157
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
Minimum GOMAXPROCS should be 1 #10
Conversation
Codecov Report
@@ Coverage Diff @@
## master #10 +/- ##
==========================================
+ Coverage 93.37% 93.58% +0.21%
==========================================
Files 7 7
Lines 181 187 +6
==========================================
+ Hits 169 175 +6
Misses 10 10
Partials 2 2
Continue to review full report at Codecov.
|
maxprocs/maxprocs.go
Outdated
// Min sets the minimum GOMAXPROCS value that will be used. | ||
func Min(n int) Option { | ||
return optionFunc(func(cfg *config) { | ||
cfg.minGOMAXPROCS = n |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be worth either handling n<1 or noting in the docs that passing n<1 leaves GOMAXPROCS
unchanged.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea, will note that GOMAXPROCS
< 1 will have no affect.
We previously set the minimum GOMAXPROCS value to 2 as that was the minimum allocation we expected internally. However, if the allocation is actually smaller, we should use lower GOMAXPROCS. This will also allow us to reduce the allocation size and use a more appropriate GOMAXPROCS which will reduce the amount of CFS throttling.
b2d808b
to
c405dbb
Compare
We previously set the minimum GOMAXPROCS value to 2 as that was the
minimum allocation we expected internally. However, if the allocation is
actually smaller, we should use lower GOMAXPROCS.
This will also allow us to reduce the allocation size and use a more
appropriate GOMAXPROCS which will reduce the amount of CFS throttling.