-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
queryfrontend 20% latency overhead #4571
Comments
I was thinking that maybe our HTTP client isn't honoring keep-alive properly. I believe this is the relevant place where the request is handled: https://github.com/cortexproject/cortex/blob/master/pkg/frontend/transport/handler.go#L119. Isn't this missing a |
Yes, so that is the problem albeit in a different place + the default http.DefaultTransport is used which is quite limited in the number of idle connections: https://github.com/cortexproject/cortex/blob/master/pkg/frontend/downstream_roundtripper.go#L39. Let me try to fix this. |
@GiedriusS wow, impressively fast action 😁. Once this lands in Cortex I'll be happy to poke around some more and see how much of improvement we get over the latency mentioned in the description that we are currently observing on our side. |
Make the HTTP downstream tripper configurable so that it would be possible to set the number of maximum idle connections per host to more than 2 so that HTTP keep-alive connections could be used on higher loads. Solves thanos-io#4571. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
* query-frontend: make HTTP downstream tripper configurable Make the HTTP downstream tripper configurable so that it would be possible to set the number of maximum idle connections per host to more than 2 so that HTTP keep-alive connections could be used on higher loads. Solves #4571. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com> * CHANGELOG: add entry Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
Hey @GiedriusS,
EDIT: OK, I think this was caused by the fact that the interactive tests overrides the default for max concurrent queries to |
Mhm, is it reproducible when more maximum concurrent queries are permitted? |
It's not reproducible with higher number of concurrent queries (e.g. the default I am actually now unsure about how precise the original report we received about those 20% was and whether there might have been something else going on that would explain the difference. But from what I can conclude from my tests, there is no perceivable difference for the end user regardless of whether doing query through frontend or directly on query (with the obvious exception of the case when the operator sets query to handle only |
So as I said in my findings above I could not confirm the issue with 20% latency increase on query frontend, this is for me the conclusion of the issue. As for the rest of the task, I opened a PR to add some benchmarks to query frontend, so feel free to have a look - #4723 |
…4623) * query-frontend: make HTTP downstream tripper configurable Make the HTTP downstream tripper configurable so that it would be possible to set the number of maximum idle connections per host to more than 2 so that HTTP keep-alive connections could be used on higher loads. Solves thanos-io#4571. Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com> * CHANGELOG: add entry Signed-off-by: Giedrius Statkevičius <giedrius.statkevicius@vinted.com>
@matej-g let's close this, then? (: |
Ah, right 🙂 Please close it |
We see that on first query range queries (cold cache) can take extra 20% of time if they go through query-frontend query range.
AC:
cc @matej-g
The text was updated successfully, but these errors were encountered: