-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
etcd: avoid creating large leases #96836
Comments
@mborsz: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/sig scalability |
In fact we may consider using leaseReuseDurationSeconds with lower value than 1m instead of introducing objects limit (maybe both). This will reduce number of objects per lease and also will spread deletion of all events over 1m (instead of scheduling deletion of all 1m of events at the same time). |
How about make leaseReuseDurationSeconds configurable as a tuning option firstly? |
Sounds reasonable to me. |
/assign |
After making leaseReuseDurationSeconds configurable, we still need to have better observability to be able to consciously tune this value:
The rationale for adding 2, while we have 1 is that e.g. in scalability tests the most problematic case is when we create a huge number of events in a short period of time on cluster bootstrap, before we have prometheus running. I think those tests can be a good starting point for parameter tuning. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-contributor-experience at kubernetes/community. |
This has been addressed by linked PRs. |
Currently we create a single etcd lease for each 1m of events (code). With high event throughput, this can create large number of objects reusing the same lease. While the lease_revoke operation in etcd is atomic, this blocks all other operations for long period of time.
Currently, in #96038 we are seeing occasional event etcd restarts. All of them happens approx. 1h after cluster start and correlates with lease_revoke operations on initial events. After the lease_revoke I see a number of errors like
/health error; QGET failed etcdserver: request timed out (status code 503)
.To fix this issue (blocking lease_revoke for a long time making health check fail), we shouldn't be creating large etcd leases.
Proposal: Let's introduce a limit of objects attached to a single lease. When the "prevLease" in leaseManager reaches object limit, we force starting a new one. The exact limit of objects needs to be determined (e.g. by running some scalability test with additional logs or by adding some new metric to kube-apiserver (what exactly?)).
/cc @wojtek-t
The text was updated successfully, but these errors were encountered: