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
High CPU usage as a result of constant to CredHub client construction #2300
Comments
😱 |
concourse/concourse#2300 Signed-off-by: Nader Ziada <nziada@pivotal.io>
We have stumbled upon this issue (see discuss) |
Update for ya'll, our fix moved through the pipeline so it should be coming in the next release |
We don't think the proposed fix works after having investigated with a profiler. More details are in this PR: vmware-archive/atc#291 |
We (Pivotal RelEng team) deploy with a nightly build containing the initial fix here. But our ATC VMs are still working pretty hard (~30% CPU across 8 cores and 4 ATC VMs) and we're frequently seeing "too many open files" so it may be that the issue isn't completely fixed in the two commits linked above. |
Yep, we've merged vmware-archive/atc#291 now which should actually fix it. Thanks again @iferunsewe! |
A number of users have reported high CPU usage with v3.14.1. This seems to be coming from the lazy CredHub client construction, which was introduced to fix #2154 but seems to be unintentionally creating a CredHub client repeatedly rather than just once (on first use).
I think this is happening because this doesn't return a pointer: https://github.com/concourse/atc/blob/master/creds/credhub/manager.go#L98 ... and so the client is always assigned on a copy.
We should also make sure this is safe for concurrent use. I believe the current code won't be happy with
-race
once we make it a pointer. This may be a good time to use*sync.Once
: https://golang.org/pkg/sync/#OnceThe text was updated successfully, but these errors were encountered: