Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

jiangyaoguo
Copy link
Contributor

Fixes #11912

  1. Add rate limit for event record in pkg/client/unversioned/record.
  2. Add parameter of event record qps and burst in kubelet.

@k8s-bot
Copy link

k8s-bot commented Aug 26, 2015

Can one of the admins verify that this patch is reasonable to test? (reply "ok to test", or if you trust the user, reply "add to whitelist")

If this message is too spammy, please complain to ixdy.

@jiangyaoguo jiangyaoguo force-pushed the rate-limit-events-in-kubelet branch 5 times, most recently from 3f7ec28 to 904a823 Compare August 26, 2015 14:00
@jiangyaoguo
Copy link
Contributor Author

@lavalamp @krousey

Copy link
Contributor

Choose a reason for hiding this comment

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

Change help string to: "If > 0, limit event creations per second to this value. If 0, unlimited. [default=0.0]"

@lavalamp
Copy link
Contributor

We have default rate-limiting in the client. Should document how that interacts with this event QPS limit.

Like, I think right now if your client has a limit of 5 QPS and your events have a limit of 10 QPS, then effectively events are limited to 5 QPS and everything else could be starved. I'm not sure if this is a feature or a bug.

@jiangyaoguo jiangyaoguo force-pushed the rate-limit-events-in-kubelet branch 2 times, most recently from 5d5cbe6 to 9c6cbbb Compare August 27, 2015 17:50
@jiangyaoguo
Copy link
Contributor Author

@lavalamp Thanks a lot for your review and advise. I made changes as you said and I'm not sure about where to document interacts of event QPS and client QPS. Should we suggest event QPS lower than client's default limit of 5 QPS?

@k8s-github-robot k8s-github-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 1, 2015
@k8s-github-robot
Copy link

Labelling this PR as size/L

Copy link
Contributor

Choose a reason for hiding this comment

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

Terribly sorry that I've been sitting on this, I guess I didn't see that you pushed changes. I have been thinking about this for a bit, and it occurs to me that there's another way to do this.

The solution you have here will work, but there's two downsides:

  • People pass nil everywhere now.
  • It's unpredictable how much quota will be left for non-event client usage.

An idea that fixes both of these is:

  1. Make a copy of kcfg.KubeClient
  2. Modify the copy's internal RESTClient.Throttle object (I think enough is public that you can do this)
  3. Start recording to this copied client.

Then you don't have to add throttling to the event recorder at all, and the event QPS won't count against the regular QPS.

I'm sorry for not thinking of this to begin with. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lavalamp Thanks a lot for your idea. Totally agree with you. I think this will make event recorder behavior more clear. Will update this pr soon.

1. Add EvnetRecordQps and EventBurst parameter in kubelet.
2. If  EvnetRecordQps and EventBurst was set, rate limit events in kubelet
with a independent ratelimiter as setted.
@jiangyaoguo jiangyaoguo force-pushed the rate-limit-events-in-kubelet branch from 9c6cbbb to 1460a1f Compare September 9, 2015 09:00
@k8s-github-robot k8s-github-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Sep 9, 2015
@k8s-github-robot
Copy link

Labelling this PR as size/XL

@k8s-bot
Copy link

k8s-bot commented Sep 9, 2015

GCE e2e build/test passed for commit 1460a1f.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm, I'm puzzled about why github shows such a bad diff on this file. Weird.

@lavalamp
Copy link
Contributor

lavalamp commented Sep 9, 2015

This looks great, thank you very much for bearing with me!

LGTM

@lavalamp lavalamp added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 9, 2015
@k8s-github-robot
Copy link

The author of this PR is not in the whitelist for merge, can one of the admins add the 'ok-to-merge' label?

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Sep 9, 2015

GCE e2e build/test passed for commit 1460a1f.

@k8s-github-robot
Copy link

Automatic merge from SubmitQueue

k8s-github-robot pushed a commit that referenced this pull request Sep 9, 2015
@k8s-github-robot k8s-github-robot merged commit c993cf6 into kubernetes:master Sep 9, 2015
zmerlynn added a commit that referenced this pull request Sep 14, 2015
…-#13192-upstream-release-1.0

Automated cherry pick of #13192
@ikehz ikehz mentioned this pull request Oct 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants