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
clair: limit db connections pool (PROJQUAY-2659) #722
clair: limit db connections pool (PROJQUAY-2659) #722
Conversation
Restrict the max number of open connections to the clair postgres. If HPA is managed we have control over the max number of pods so we can calculate the max number of connections per pod. If HPA is not managed then we can't properly estimate the max number of pods so we decrease the connection pool size.
/cherry-pick redhat-3.7 |
@ricardomaraschini: once the present PR merges, I will cherry-pick it on top of redhat-3.7 in a new PR and assign it to you. In response to this:
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. |
@@ -406,9 +416,8 @@ func clairConfigFor(log logr.Logger, quay *v1.QuayRegistry, quayHostname, preSha | |||
"migrations": true, | |||
}, | |||
"matcher": map[string]interface{}{ | |||
"connstring": dbConn, | |||
"max_conn_pool": 100, |
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.
How do we decide what should be in this map and what should be in the connstring string?
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.
@quay/clair should be able to shine some light here
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.
Clair's config is documented (via the go types) here. In this specific instance, we deprecated the dedicated connection pool size to make it uniformly specified in the connection string.
@ricardomaraschini: new pull request created: #723 In response to this:
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. |
Restrict the max number of open connections to the clair postgres. If
HPA is managed we have control over the max number of pods so we can
calculate the max number of connections per pod. If HPA is not managed
then we can't properly estimate the max number of pods so we decrease
the connection pool size.