-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Automated cherry pick of #111477: Share a single etcd3 client logger across all clients #111649
Automated cherry pick of #111477: Share a single etcd3 client logger across all clients #111649
Conversation
This logger is responsible for 20% of the API server's memory usage when many CRDs are installed. See the below issue for more context. kubernetes#111476 Signed-off-by: Nic Cope <nicc@rk0n.org>
Currently the API server creates one etcd client per CRD. If clients aren't provided a logger they'll each create their own. These loggers can account for ~20% of API server memory consumption on a cluster with hundreds of CRDs. Signed-off-by: Nic Cope <nicc@rk0n.org>
Logic copied from https://github.com/etcd-io/etcd/blob/v3.5.4/client/v3/client.go#L374 Signed-off-by: Nic Cope <nicc@rk0n.org>
Replicated from https://github.com/etcd-io/etcd/blob/v3.5.4/client/v3/logger.go#L47 The logic of this function doesn't make a lot of sense to me, but copying it will avoid any behaviour change. Signed-off-by: Nic Cope <nicc@rk0n.org>
Hi @negz. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
c := logutil.DefaultZapLoggerConfig | ||
c.Level = zap.NewAtomicLevelAt(etcdClientDebugLevel()) | ||
l, err := c.Build() |
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.
Note that the original PR used logutil.CreateDefaultZapLogger
. That function was introduced in etcd v3.5.3, whereas this release branch uses v.3.5.1. The logic here matches that of CreateDefaultZapLogger
per https://github.com/etcd-io/etcd/blob/v3.5.4/client/pkg/logutil/zap.go#L24.
/ok-to-test |
/triage accepted |
/kind bug |
/lgtm @kubernetes/release-managers @cpanato - for cherrypick approval |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: negz, wojtek-t 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 |
/cc kubernetes/release-managers |
/lgtm |
/test pull-kubernetes-e2e-kind-ipv6 |
/retest-required |
Cherry pick of #111477 on release-1.23.
#111477: Share a single etcd3 client logger across all clients
For details on the cherry pick process, see the cherry pick requests page.