Skip to content
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

sidecar: increase MaxIdleConnsPerHost or allow it to be configured #1953

Closed
blockloop opened this issue Jan 7, 2020 · 0 comments
Closed

Comments

@blockloop
Copy link
Contributor

blockloop commented Jan 7, 2020

The thanos sidecar is mounted to a single Prometheus instance where it establishes an HTTP connection for queries against that machine. It's using the http.DefaultTransport when connecting to that client which has MaxIdleConnsPerHost set to 2 by default see DefaultMaxIdleConnsPerHost. We run a large, heavily used cluster and we're receiving about 1.7k queries per second from some machines. Because of this load we are constantly over the connection pool limit so new connections are being established and destroyed. This causes our machines to run low on ports since each connection sits in a TIME_WAIT state for 60s, consuming a port.

Since the connection pool size depends entirely on the setup I think there should be a flag to allow us to run sidecar with custom connection pool size. Perhaps --prometheus.connection-pool-size?

Here are some examples showing the TIME_WAIT connections being created in excess in the second example: https://tleyden.github.io/blog/2016/11/21/tuning-the-go-http-client-library-for-load-testing/

This graph shows HTTP requests between sidecar and Prometheus on our machines.
image

blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
blockloop added a commit to blockloop/thanos that referenced this issue Jan 8, 2020
@squat squat closed this as completed in 8dbfe3d Jan 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant