-
Notifications
You must be signed in to change notification settings - Fork 76
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
Update GOMAXPROCS configuration #4013
Conversation
87e65a7
to
d3c1b73
Compare
if currentP > int(controllerContext.Cfg.GoMaxProcs) { | ||
p := runtime.GOMAXPROCS(int(controllerContext.Cfg.GoMaxProcs)) | ||
logger.Sugar().Infof("Change max golang procs to %d", p) | ||
if _, err := maxprocs.Set(maxprocs.Min(controllerContext.Cfg.GoMaxProcs)); err != nil { |
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.
1 是否有日志,能看到 设置效果
2 代码中 简短的 comment。说明下 设置为多少了
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.
{"level":"INFO","ts":"2024-09-04T05:27:16.125Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:74","msg":"maxprocs: Updating GOMAXPROCS=1: using minimum allowed GOMAXPROCS"}
调高 limit,GOMAXPROCS 也相应增加
{"level":"INFO","ts":"2024-09-04T05:28:26.389Z","logger":"spiderpool-controller","caller":"cmd/daemon.go:74","msg":"maxprocs: Updating GOMAXPROCS=2: determined from CPU quota"}
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4013 +/- ##
=======================================
Coverage 80.83% 80.83%
=======================================
Files 51 51
Lines 4514 4514
=======================================
Hits 3649 3649
Misses 699 699
Partials 166 166
Flags with carried forward coverage won't be shown. Click here to find out more. |
883d2c4
to
09884b1
Compare
- Replace manual GOMAXPROCS setting with maxprocs package for improved handling. - Log a warning if setting GOMAXPROCS fails. - Ensure min value is used when setting max procs from configuration. Signed-off-by: lou-lan <loulan@loulan.me>
09884b1
to
6d241a4
Compare
Update GOMAXPROCS configuration Signed-off-by: robot <tao.yang@daocloud.io>
fix #3993, Update GOMAXPROCS configuration