-
Notifications
You must be signed in to change notification settings - Fork 672
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
Contour should configure a client request timeout #1073
Comments
I wasn't sure which timeout did what, so I spent some time reading Envoy documentation. Here's what I found: 1073Envoy timeoutsThere are five timeouts you can set on connections through Envoy, three at the the connection manager, and two at the route. Connection manager timeoutsidle_timeoutApplies to the idle period when no streams are active, and will terminate the connection. There is no default, but we set to 60s in Contour (see the previous issue) stream_idle_timeoutthis applies to each individual stream that is part of a connection. It may be configured at both the connection manager and per-route granularity. Header/data/trailer events on the stream reset the idle timeout. Note that I believe that 'events' in this context refers to the edge of one of those three things - header, data or trailer, not to the reception of packets. Will need to check Envoy code to confirm. Defaults to 5 minutes. We currently don't set a value. request_timeoutThis applies to requests from the connection manager to upstream clusters. This timer starts when the request is started, and is disabled when the last byte of the request is sent upstream. That is, this is an Envoy timeout for the sending of data to the upstream backend, not a client timeout. However, since we are proxying requests, it is a proxy (heh) for a client timeout. This defaults to disabled, we currently do not set it. drain_timeoutThis is about how long Envoy will wait between sending the HTTP/2 start of shutdown message and shutting down the connection. Defaults to 5s, we do not set it. Route timeoutsThese timeouts apply on a per-route basis, and cover the communication with the upstream cluster. timeoutSpecifies the upstream timeout for the route. If not specified, the default is 15s. This spans between the point at which the entire downstream request (i.e. end-of-stream) has been processed and when the upstream response has been completely processed. We do not set this one, but it establishes an upper bound on the upstream response time. idle_timeoutSimilarly to the connection manager stream_idle_timeout, this sets how long that streams matching this route can be idle. A new header or data encoding or decoding event will reset this timer. It is unset by default, and the connection manager stream_idle_default value is used instead. If this is set, it overrides the connection manager value, even if idle_timeout is set to zero (which disables the timeout). ThoughtsSetting a |
@youngnick thanks for the update. Do you think we need to do anything for 0.13? If this isn't urgent that we ship it next week for 0.13 would you mind moving the milestone to 0.14? |
I don't think there's any urgency, so I'll move it. |
Moving to rc1 to decide if we want to address this for Contour 1.0 |
The way Envoy talks about these timeouts is very oriented towards Envoy itself, so I made a diagram to help. We already allow setting the route-level timeout in HTTPProxy, which is, from the client's point of view, a response timeout. But we don't have anything that approximates a request timeout. The connection manager request timeout is the correct place for this. In Contour, this should be a global setting, that defaults to disabled (which is the Envoy default). So, in summary, we should:
|
@youngnick thanks for following this thought. Do you want to look at
These two (the latter might come for free) for rc.1? |
Yep, I think so. |
Uses the Envoy Connection Manager request_timeout setting. Fixes projectcontour#1073. Signed-off-by: Nick Young <ynick@vmware.com>
Uses the Envoy Connection Manager request_timeout setting. Fixes projectcontour#1073. Signed-off-by: Nick Young <ynick@vmware.com>
Uses the Envoy Connection Manager request_timeout setting. Fixes projectcontour#1073. Signed-off-by: Nick Young <ynick@vmware.com>
Uses the Envoy Connection Manager request_timeout setting. Fixes projectcontour#1073. Signed-off-by: Nick Young <ynick@vmware.com>
Uses the Envoy Connection Manager request_timeout setting. Fixes projectcontour#1073. Signed-off-by: Nick Young <ynick@vmware.com>
Uses the Envoy Connection Manager request_timeout setting. Fixes projectcontour#1073. Signed-off-by: Nick Young <ynick@vmware.com>
Uses the Envoy Connection Manager request_timeout setting. Fixes projectcontour#1073. Signed-off-by: Nick Young <ynick@vmware.com>
Uses the Envoy Connection Manager request_timeout setting. Fixes #1073. Signed-off-by: Nick Young <ynick@vmware.com>
In #1070 the timeout for idle connections was set to 60 seconds, but we punted on setting a request timeout because no reasonable value could be found.
This issue is to track the research on a reasonable value which should be applied for all requests. This is complicated by the following factor:
The text was updated successfully, but these errors were encountered: