-
Notifications
You must be signed in to change notification settings - Fork 227
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
Provider: MaxConnsPerHost tests with creating 60 service accounts #842
Provider: MaxConnsPerHost tests with creating 60 service accounts #842
Conversation
In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically. To do so, a Grafana Labs employee must promote the Drone build. For maintainers, it's better to run only the Cloud tests you need, rather than all of them. You can do so by setting the following parameter when promoting:
|
internal/provider/provider.go
Outdated
@@ -340,6 +340,7 @@ func createGrafanaClient(d *schema.ResourceData) (string, *gapi.Config, *gapi.Cl | |||
auth := strings.SplitN(d.Get("auth").(string), ":", 2) | |||
cli := cleanhttp.DefaultClient() | |||
transport := cleanhttp.DefaultTransport() | |||
transport.MaxConnsPerHost = 2 |
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.
limiting the amount of concurrent HTTP connections from the provider makes it not overload the API and DB
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.
Can you make that a comment in the code?
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.
LGTM, thanks!
internal/provider/provider.go
Outdated
@@ -340,6 +340,7 @@ func createGrafanaClient(d *schema.ResourceData) (string, *gapi.Config, *gapi.Cl | |||
auth := strings.SplitN(d.Get("auth").(string), ":", 2) | |||
cli := cleanhttp.DefaultClient() | |||
transport := cleanhttp.DefaultTransport() | |||
transport.MaxConnsPerHost = 2 |
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.
Can you make that a comment in the code?
why/what
We have seen that too many simultaneous calls to grafana API can cause the DB to be congested.
Features
downside
might slow down terraform providers for our users
fixes
#827