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

resourcemanger: add cpu scheduler #39886

Merged
merged 32 commits into from
Jan 5, 2023
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
14901ca
improve code
hawkingrei Dec 16, 2022
c528b13
*: fix revive false positive with generics
hawkingrei Dec 6, 2022
b354171
*: fix revive false positive with generics
hawkingrei Dec 6, 2022
2470c69
*: fix revive false positive with generics
hawkingrei Dec 6, 2022
6b3ff7b
update
hawkingrei Dec 6, 2022
bd60251
manage -> manager
hawkingrei Dec 6, 2022
6787d94
update
hawkingrei Dec 6, 2022
ca126e8
*: upgrade manage
hawkingrei Dec 7, 2022
e1ce5fb
use RWMutex
hawkingrei Dec 8, 2022
8c5287d
update commit
hawkingrei Dec 8, 2022
e9144c5
update commit
hawkingrei Dec 8, 2022
ce63425
refactor
hawkingrei Dec 9, 2022
279f27c
improve code
hawkingrei Dec 12, 2022
3ec7dc4
add comments
hawkingrei Dec 12, 2022
e7a8496
add comments
hawkingrei Dec 12, 2022
7e2e1bd
update test
hawkingrei Dec 12, 2022
2cfff72
minCPUSchedulerInterval use atomic value
hawkingrei Dec 12, 2022
681677b
minCPUSchedulerInterval use atomic value
hawkingrei Dec 12, 2022
1548c33
*: cpu resource manager
hawkingrei Dec 13, 2022
32a4f05
*: cpu resource manager
hawkingrei Dec 13, 2022
986a6a1
resourcemanger: add cpu scheduler
hawkingrei Dec 13, 2022
14cb418
resourcemanger: add cpu scheduler
hawkingrei Dec 13, 2022
1c873dd
resourcemanger: add cpu scheduler
hawkingrei Dec 13, 2022
4f1504b
resourcemanger: add cpu scheduler
hawkingrei Dec 13, 2022
8de0b4e
expression: close recordset
hawkingrei Dec 14, 2022
3588a50
*: add test
hawkingrei Jan 3, 2023
a509c0d
*: add test
hawkingrei Jan 3, 2023
d35f3e2
update bazel
hawkingrei Jan 3, 2023
da11763
update bazel
hawkingrei Jan 3, 2023
1abbfb9
bazel update
hawkingrei Jan 4, 2023
ce0cfec
update
hawkingrei Jan 4, 2023
1a4c7d6
Merge branch 'master' into add_resource_manage_2
ti-chi-bot Jan 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
*: fix revive false positive with generics
Signed-off-by: Weizhen Wang <[email protected]>
  • Loading branch information
hawkingrei committed Jan 4, 2023
commit b354171df79fb76b526c47d8925f2b5d0749672d
4 changes: 2 additions & 2 deletions resourcemanage/scheduler/gradient2_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const (
defaultSmoothing float64 = 0.2
defaultMinConcurrency int = 2

defaultOverloadConcurrencyDelta int = 2 // minimum concurrency = user setting concurrency - delta
MaxOverloadConcurrencyDelta int = 2 // max concurrency = user setting concurrency + delta
)

// Gradient2Scheduler is a scheduler that uses the gradient of the queue length
Expand Down Expand Up @@ -71,6 +71,6 @@ func (b *Gradient2Scheduler) tune(_ util.Component, p util.GorotinuePool) float6
gradient := mathutil.Max(0.5, mathutil.Min(1.0, p.LongRTT()/float64(p.ShortRTT())))
newLimit := float64(p.Running())*gradient + float64(p.GetQueueSize())
newLimit = float64(p.Running())*(1-b.smoothing) + newLimit*b.smoothing
newLimit = mathutil.Max(float64(defaultMinConcurrency), mathutil.Min(float64(defaultOverloadConcurrencyDelta+p.Cap()), newLimit))
newLimit = mathutil.Max(float64(defaultMinConcurrency), mathutil.Min(float64(MaxOverloadConcurrencyDelta+p.Cap()), newLimit))
return newLimit
}