-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Allow configuration of upstream connection limits in Envoy #6829
Conversation
This allows a user to configure the envoy connect proxy with 'max_connections', 'max_queued_requests', and 'max_requests'. These values are defined in the local proxy on a per-service instance basis and should thus NOT be thought of as a global-level or even service-level value.
Another high-level question I have regarding this configuration/PR is whether we want to use this opportunity to add support for configuring upstream values like these in From my understanding, centralizing configuration in the |
Great job @crhino! I've not yet dug through code but will soon but want to share initial feedback on the PR description and questions. Overall I think this looks great and is a sensible place to start. I think the next discussion after this PR is where the right place to add this in On the naming choosen, I think all of it is great and appreciate the research and rationale there. My only suggestion would be that
You're exactly right this is the plan but it's actually way more subtle and difficult that it seems - I have an RFC in progress for it but the sticky part is resolving how upstream ports are assigned and discovered once the definition isn't tied to a specific instance. So yes that's coming but we shouldn't mix it up here just yet! |
I agree I don't think I have a strong opinion on this naming, other than I like |
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.
@crhino this looks great!
I had one minor question inline and I'll wait for docs update to approve as it seems worth doing in one PR.
I like this name better personally and I don't think deviation form Envoy naming is necessarily bad - we are trying to find a middle ground that's agnostic enough for any proxy after all so being precise/meaningful is more important to me than copying Envoy. It's a bit better UX but it also hopefully means other proxy implementations end up implementing something closer since the semantics are more precise.
Link to the preview docs website Edit: Just realized you can click the Netlify details and it will take you to the preview. 💥 |
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.
Approving because I think this is good as is.
Do you think we should add detail to the docs to point out that max connections doesn't really do much for http2 traffic while max requests doesn't really do what you want for http1?
I don't think that's too envoy specific as the way those protocols use connections is likely to be the same in any proxy?
Hey there, This issue has been automatically locked because it is closed and there hasn't been any activity for at least 30 days. If you are still experiencing problems, or still have questions, feel free to open a new one 👍. |
Fixes #6359
This PR adds a
limits
field to the upstream configuration of a connect envoy proxy. Thislimits
field is intended to contain configuration regarding connections/requests of the given service to the specified upstream, such asmax_connections
,max_pending_requests
, andmax_requests
.This is currently only allowed on the
proxy.upstreams[*].config
part of the service definition, a future improvement would be to allow these upstream configurations to be set in a service'sservice-defaults
central config.Example:
UX
Some relevant UX decisions I made, looking for feedback on this.
Limits Block
I chose to scope this section under a
limits
block in order to more concretely define them as related, as well as simplify the implementation. This should be a natural place to add more related configuration if necessary as well.I considered naming this something to the effect of
connection_limits
, but felt that was a little too wordy when typing.max_* Naming
After looking into the big three proxy configuration (Envoy, Nginx, HAProxy), I eventually settled on keeping the naming that Envoy uses for these values.
For
max_connections
andmax_pending_requests
, all three had similar configuration values, although they varied in whether those values were set on a per-server or per-{cluster,frontend} basis.For
max_requests
, this represents the max allowed in-flight requests to an upstream cluster by Envoy. This is mostly useful in a HTTP/2 context, since HTTP/1.1 requests are mostly bounded by the max_connections parameter. I was not able to find an equivalent configuration option in HAProxy or Nginx.I also considered changing
max_requests
tomax_inflight_requests
ormax_concurrent_requests
to be more specific in naming, but decided it was better to keep 100% consistent with Envoy than to change a single name.TODO
service-defaults
in this PR or future one.