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

Batch updates of multiple Pods. #4531

Merged
merged 2 commits into from
Feb 19, 2015

Conversation

wojtek-t
Copy link
Member

Try to batch updates of multiple Pods in Kubelet, to avoid multiple (expensive) calls to Docker.
This is slightly (by ~10-20%) reducing the latency of starting the last Pod when we're starting 50 equal pods on the same node.

case <-time.After(kl.resyncInterval):
glog.V(4).Infof("Periodic sync")
}
// If we already caught some update, try to wait for some short time
// to possibly batch it with other incoming updates.
for ; unsyncedPod; {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit:

for unsyncedPod {
   ...
}

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

@vmarmol
Copy link
Contributor

vmarmol commented Feb 18, 2015

Overall this looks good (although I'm guessing it's still a WIP). The whole waiting seems a bit bad. I don't have a better solution though :) Do we know what kind of win we get from doing this versus making SyncPod() faster? From what we mentioned in #4119.

@vmarmol vmarmol assigned vmarmol and unassigned dchen1107 Feb 18, 2015
@vmarmol
Copy link
Contributor

vmarmol commented Feb 18, 2015

@dchen1107 taking this over from you, let me know if you would still like to review :)

@wojtek-t
Copy link
Member Author

Why do you think that this waiting is bad - I used a very similar pattern in my previous project and it worked pretty well. The missing this we may want to do here is to not try to accumulate a possibly infinite number of notifications, but instead set a limit for time (or number of those notifications that can be batched).

Regarding making SyncPods() faster - we definitely want to do it to. I will start working on it today. If you think that we should wait with this PR for that one, I'm fine with that.

@vmarmol
Copy link
Contributor

vmarmol commented Feb 19, 2015

I don't have a more technical reason than it being racy (although does improve performance in practice). I'm fine with the PR as is :)

LGTM and will merge, but if you have time tomorrow can you run your tests again and see the gain this gets us? I'm curious to track how we improve there,

vmarmol added a commit that referenced this pull request Feb 19, 2015
@vmarmol vmarmol merged commit 40cb417 into kubernetes:master Feb 19, 2015
@wojtek-t wojtek-t deleted the batch_requests_in_kubelet branch March 20, 2015 07:37
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.

3 participants