-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Jittering periods of some kubelet's sync loops: #20726
Jittering periods of some kubelet's sync loops: #20726
Conversation
Labelling this PR as size/XL |
a52d0a2
to
a8e4099
Compare
GCE e2e build/test failed for commit a52d0a2d3b2c5e31760139673584dc67e8ee4497. |
GCE e2e build/test failed for commit a8e40992f0f4decadbaf5af27d5e7b21d68ffef7. |
IIUC, this PR is based on #19917, and only the last commit (a8e40992f0f4decadbaf5af27d5e7b21d68ffef7) is new. The jitters introduced into kubelet in that commit don't really matter. What should be modified is the the individual workers' (pod workers, probers) sync/probing period. kubernetes/pkg/kubelet/pod_workers.go Line 212 in ff04de4
kubernetes/pkg/kubelet/pod_workers.go Line 214 in ff04de4
kubernetes/pkg/kubelet/prober/worker.go Line 96 in ff04de4
In general, I think introducing jitters is good. I did some tests after #19850 was merged and jittering period did not have significant difference in the cpu resource usage data. Perhaps with more pods (100 per node), this would make a difference. I would like to get some data before the PR is merged though. |
That is correct. Thanks for the tips, I will take a look. |
Could we separate out the PR's? It seems this should be 2 different PRs.
Our profiles simply show a flattening of the spikes, but the ~90th-percentile usually remains steady. You would need something like pbench to see the spikes b/c most profiling would average it away. |
@timothysc, only the last commit is new. The rest is just #19917.
Could you share some numbers? That'd be very useful. |
@yujuhong @timothysc this is meant to be a distinct PR which depends on #19917 |
PR needs rebase |
Looks like the other commit landed so we can probably rebase this one. |
c0cf0d1
to
0f98e73
Compare
GCE e2e build/test failed for commit c0cf0d1578408387045fdafa80241c46cf2460ed. |
Labelling this PR as size/M |
probeTicker := time.NewTicker(time.Duration(w.spec.PeriodSeconds) * time.Second)
...
probeLoop:
for w.doProbe() {
// Wait for next probe tick.
select {
case <-w.stop:
break probeLoop
case <-probeTicker.C:
// continue
}
} got replaced with
Why? reasoning: The for loop can be replaced equivalently with:
Once The second step is replacing |
If the doProbe returns false, the Until will not stop :(. Grrr |
GCE e2e test build/test passed for commit 0f98e735fce2d3bc7335ca6ede6fba9d1a499ce6. |
@@ -39,6 +40,14 @@ type PodWorkers interface { | |||
|
|||
type syncPodFnType func(*api.Pod, *api.Pod, *kubecontainer.PodStatus, kubetypes.SyncPodType) error | |||
|
|||
const ( |
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.
So I think @yujuhong is the expert on which timers to mod here.
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.
Can we use a smaller factor such as 0.5? I think that should be enough to distribute the sync times.
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.
Both factors decreased to 0.5
The author of this PR is not in the whitelist for merge, can one of the admins add the 'ok-to-merge' label? |
@ingvagabund thanks for your help in seeing this one through. |
Np. Thank you all for spending your time on reviewing the PR. |
Tagging for @yujuhong |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
We shouldn't LGTM PRs with WIP in the title. |
@bgrant0607 my bad, I had missed that. |
Ah, I see @pmorie changed the title. Nevermind. The change hasn't been reflected in the submit queue yet. |
GCE e2e build/test failed for commit 392fc66. |
cluster didn't started correctly @k8s-bot e2e test this please github issue: #IGNORE |
GCE e2e test build/test passed for commit 392fc66. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e test build/test passed for commit 392fc66. |
Automatic merge from submit-queue |
Auto commit by PR queue bot
@wojtek-t why didn't you file an issue for the cluster failing to start? |
@pweil- will our rebase catch this? |
@jeremyeder this should be included |
In order to synchronize the current state of Kubernetes's objects (e.g. pods, containers, etc.),
periodic synch loops are run. When there is a lot of objects to synchronize with,
loops increase communication traffic. At some point when all the traffic interfere cpu usage curve
hits the roof causing 100% cpu utilization.
To distribute the traffic in time, some sync loops can jitter their period in each loop
and help to flatten the curve.
kubelet sync loops that are jittered: