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

kube-proxy iptables min-sync-period default 1sec #92836

Merged
merged 1 commit into from Jul 12, 2020

Conversation

aojea
Copy link
Member

@aojea aojea commented Jul 6, 2020

What type of PR is this?

Uncomment only one /kind <> line, hit enter to put that in a new line, and remove leading whitespace from that line:

/kind api-change
/kind bug
/kind cleanup

/kind deprecation
/kind design
/kind documentation

/kind failing-test

/kind feature

/kind flake

What this PR does / why we need it:

Currently kube-proxy defaults the min-sync-period for
iptables to 0. However, as explained by Dan Winship,

"With minSyncPeriod: 0, you run iptables-restore 100 times.
With minSyncPeriod: 1s , you run iptables-restore once.
With minSyncPeriod: 10s , you also run iptables-restore once,
but you might have to wait 10 seconds first"

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

This is causing issues in KIND jobs, when there are multiple endpoints updates, the kube-proxy fails to acquire the iptables lock

Does this PR introduce a user-facing change?:

kube-proxy iptables min-sync-period defaults to 1 sec. Previously, it was 0.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. kind/flake Categorizes issue or PR as related to a flaky test. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Jul 6, 2020
@k8s-ci-robot k8s-ci-robot added sig/network Categorizes an issue or PR as relevant to SIG Network. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 6, 2020
@aojea
Copy link
Member Author

aojea commented Jul 6, 2020

/sig-network
/assign @thockin @danwinship
/cc @BenTheElder

@danwinship
Copy link
Contributor

@BenTheElder pointed out that there had been a default originally (2s), but it was removed in #36332. But it was reverted because it was causing serious problems, and following links from there, it seems like this was just because the original implementation of minSyncPeriod was broken. (eg, it blocked the informer thread while waiting until it was allowed to do an update, rather than doing the updates in a different thread)

When Tim wrote BoundedFrequencyRunner in #46266 he set a 10s default for certain cluster templates/setup scripts (eg cluster/gce/gci/configure-helper.sh) but didn't change the command-line/config default.

I think 1s is a much better default value than either 0s or 10s; it works much more smoothly than 0s in the case where you get a bunch of updates all at once (eg, deleting a large deployment), but unlike 10s it's not noticeably slower when you have steady-but-not-overwhelming updates.

Is it the very best possible value for every cluster? Would 2s be better than 1s? I dunno. But 10s, while maybe appropriate for some clusters, seems way too high as a default, given that most(?) people are currently surviving with 0s. (That said, this PR does not change the minSyncPeriod for any of the cases that are currently setting it to 10s, since they're overriding the default anyway.)

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 6, 2020
@thockin
Copy link
Member

thockin commented Jul 7, 2020 via email

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2020
Currently kube-proxy defaults the min-sync-period for
iptables to 0. However, as explained by Dan Winship,

"With minSyncPeriod: 0, you run iptables-restore 100 times.
 With minSyncPeriod: 1s , you run iptables-restore once.
 With minSyncPeriod: 10s , you also run iptables-restore once,
 but you might have to wait 10 seconds first"
@aojea
Copy link
Member Author

aojea commented Jul 7, 2020

/retest

@danwinship
Copy link
Contributor

We had lots of reports of people whose iptables runs were 4-5 seconds each

And most of that time was probably spent waiting to get the iptables lock. We've made huge improvements to the iptables situation in the last few years. I don't think old data points are valid any more. But I don't currently have any new data points to offer...

If we're going to lower this

Note that this PR does not lower the value for anyone; it raises the default value from 0 to 1s for people who are not currently explicitly setting it.

@aojea
Copy link
Member Author

aojea commented Jul 7, 2020

/retest

Copy link
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

I think I considered this but thought maybe it would break someone. In hindsight, that's pretty clearly the wrong choice.

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 7, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, thockin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 7, 2020
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@spiffxp spiffxp added this to the v1.19 milestone Jul 9, 2020
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

3 similar comments
@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

@fejta-bot
Copy link

/retest
This bot automatically retries jobs that failed/flaked on approved PRs (send feedback to fejta).

Review the full test history for this PR.

Silence the bot with an /lgtm cancel or /hold comment for consistent failures.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/failing-test Categorizes issue or PR as related to a consistently or frequently failing test. kind/flake Categorizes issue or PR as related to a flaky test. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/network Categorizes an issue or PR as relevant to SIG Network. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants