Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3906abe
Added max_requests_connection for downstream connection.
Feb 4, 2021
ff52d2d
Moved max_requests_connection to core.v3.HttpProtocolOptions.
Feb 11, 2021
5fa29e3
Fixed format and release docs.
Feb 11, 2021
163c635
Undo deprecation.
Feb 11, 2021
3fecf7e
Fixed CI.
Feb 25, 2021
68301da
Merge remote-tracking branch 'upstream/main' into mx_rq_conn
Feb 25, 2021
236b9dc
Fix.
Feb 25, 2021
e46bd37
fix
Apr 1, 2021
6744578
Merge remote-tracking branch 'upstream/main' into mx_rq_conn
Apr 1, 2021
944e461
fix trailing whitespace
Apr 1, 2021
69b3990
fix.
Apr 8, 2021
aed45e3
fix
Jun 4, 2021
50fbcfb
Merge remote-tracking branch 'upstream/main' into mx_rq_conn
Jun 4, 2021
a34504e
Implemented for downstream.
Jun 4, 2021
cab8b98
fix format
Jun 4, 2021
a1b6593
fix docs
Jun 4, 2021
306227e
fix
Jun 4, 2021
f9f204d
fix comment
Jun 7, 2021
0a46515
added config test
Jun 7, 2021
8ed8e32
Merge remote-tracking branch 'upstream/main' into mx_rq_conn
Jun 7, 2021
c74bfd2
Honor old config
Jun 14, 2021
97988ae
Added test
Jun 15, 2021
7607d85
Merge remote-tracking branch 'upstream/main' into mx_rq_conn
Jun 15, 2021
a5ec9d8
fix integration test
Jun 23, 2021
c70c421
Merge remote-tracking branch 'upstream/main' into mx_rq_conn
Jun 23, 2021
86ff39e
fix ci
Jun 23, 2021
2418fd0
fix
Jun 23, 2021
310a0cc
fix
Jun 25, 2021
9926092
fix
Jun 25, 2021
bfa9cac
Added more test
Jun 29, 2021
5f9360e
fix
Jul 9, 2021
f53cf49
Merge remote-tracking branch 'upstream/main' into mx_rq_conn
Jul 9, 2021
6d80d9f
updated docs.
Jul 9, 2021
67d99a1
fix comments
Jul 14, 2021
bdc5c59
Merge remote-tracking branch 'upstream/main' into mx_rq_conn
Jul 14, 2021
83dd809
typos
Jul 14, 2021
5306bb1
Merge branch 'main' into mx_rq_conn
Jul 14, 2021
318096c
fix
Jul 14, 2021
f6989ee
added stat docs.
Jul 14, 2021
13d1358
fix
Jul 14, 2021
a1cd357
Updated comment
Jul 15, 2021
8a97141
Merge remote-tracking branch 'upstream/main' into mx_rq_conn
Jul 15, 2021
ee2bfd9
fix rst
Jul 15, 2021
ebf6747
Merge branch 'main' into mx_rq_conn
Jul 15, 2021
b34e753
fix comment
Jul 16, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion api/envoy/config/cluster/v3/cluster.proto
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,11 @@ message Cluster {
// is respected by both the HTTP/1.1 and HTTP/2 connection pool
// implementations. If not specified, there is no limit. Setting this
// parameter to 1 will effectively disable keep alive.
google.protobuf.UInt32Value max_requests_per_connection = 9;
//
// .. attention::
// This field has been deprecated in favor of the :ref:`max_requests_connection <envoy_api_field_config.core.v3.HttpProtocolOptions.max_requests_connection>` field
google.protobuf.UInt32Value max_requests_per_connection = 9
[deprecated = true, (envoy.annotations.disallowed_by_default) = true];
Comment thread
lambdai marked this conversation as resolved.
Outdated

// Optional :ref:`circuit breaking <arch_overview_circuit_break>` for the cluster.
CircuitBreakers circuit_breakers = 10;
Expand Down
14 changes: 4 additions & 10 deletions api/envoy/config/cluster/v4alpha/cluster.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion api/envoy/config/core/v3/protocol.proto
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ message UpstreamHttpProtocolOptions {
bool auto_san_validation = 2;
}

// [#next-free-field: 6]
// [#next-free-field: 7]
message HttpProtocolOptions {
option (udpa.annotations.versioning).previous_message_type =
"envoy.api.v2.core.HttpProtocolOptions";
Expand Down Expand Up @@ -104,6 +104,10 @@ message HttpProtocolOptions {
// If this setting is not specified, the value defaults to ALLOW.
// Note: upstream responses are not affected by this setting.
HeadersWithUnderscoresAction headers_with_underscores_action = 5;

// Optional maximum requests for a downstream connection.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for a downstream connection? My perception is that HttpProtocolOptions could be used by both upstream and downstream connections.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change it to for both upstream and downstream connections.

// If not specified, there is no limit.
google.protobuf.UInt32Value max_requests_connection = 6;
}

// [#next-free-field: 8]
Expand Down
6 changes: 5 additions & 1 deletion api/envoy/config/core/v4alpha/protocol.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions docs/root/version_history/current.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ New Features
* grpc_json_transcoder: added option :ref:`strict_http_request_validation <envoy_v3_api_field_extensions.filters.http.grpc_json_transcoder.v3.GrpcJsonTranscoder.strict_http_request_validation>` to reject invalid requests early.
* grpc_json_transcoder: filter can now be configured on per-route/per-vhost level as well. Leaving empty list of services in the filter configuration disables transcoding on the specific route.
* http: added support for `Envoy::ScopeTrackedObject` for HTTP/1 dispatching. Crashes while inside the dispatching loop should dump debug information.
Comment thread
mk46 marked this conversation as resolved.
Outdated
* http: added support for :ref:`max_requests_connection <envoy_v3_api_field_config.core.v3.HttpProtocolOptions.max_requests_connection>` for downstream connection.
* http: added support for :ref:`preconnecting <envoy_v3_api_msg_config.cluster.v3.Cluster.PreconnectPolicy>`. Preconnecting is off by default, but recommended for clusters serving latency-sensitive traffic, especially if using HTTP/1.1.
* http: change frame flood and abuse checks to the upstream HTTP/2 codec to ON by default. It can be disabled by setting the `envoy.reloadable_features.upstream_http2_flood_checks` runtime key to false.
* overload: add support for scaling :ref:`transport connection timeouts<envoy_v3_api_enum_value_config.overload.v3.ScaleTimersOverloadActionConfig.TimerType.TRANSPORT_SOCKET_CONNECT>`. This can be used to reduce the TLS handshake timeout in response to overload.
Expand All @@ -88,3 +89,4 @@ New Features

Deprecated
----------
* cluster: :ref:`max_requests_per_connection <envoy_v3_api_field_config.cluster.v3.Cluster.max_requests_per_connection>` is deprecated in favor of :ref:`max_requests_connection <envoy_v3_api_field_config.core.v3.HttpProtocolOptions.max_requests_connection>`.
1 change: 1 addition & 0 deletions generated_api_shadow/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ proto_library(
"//envoy/config/retry/omit_canary_hosts/v2:pkg",
"//envoy/config/retry/omit_canary_hosts/v3:pkg",
"//envoy/config/retry/previous_hosts/v2:pkg",
"//envoy/config/retry/previous_hosts/v3:pkg",
"//envoy/config/route/v3:pkg",
"//envoy/config/tap/v3:pkg",
"//envoy/config/trace/v3:pkg",
Expand Down
6 changes: 5 additions & 1 deletion generated_api_shadow/envoy/config/cluster/v3/cluster.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion generated_api_shadow/envoy/config/core/v3/protocol.proto

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions source/common/http/http1/conn_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ void ActiveClient::StreamWrapper::onResetStream(StreamResetReason, absl::string_

ActiveClient::ActiveClient(HttpConnPoolImplBase& parent)
: Envoy::Http::ActiveClient(
parent, parent.host()->cluster().maxRequestsPerConnection(),
parent, parent.host()->cluster().commonHttpProtocolOptions().max_requests_connection(),
1 // HTTP1 always has a concurrent-request-limit of 1 per connection.
) {
parent.host()->cluster().stats().upstream_cx_http1_total_.inc();
}

ActiveClient::ActiveClient(HttpConnPoolImplBase& parent, Upstream::Host::CreateConnectionData& data)
: Envoy::Http::ActiveClient(
parent, parent.host()->cluster().maxRequestsPerConnection(),
parent, parent.host()->cluster().commonHttpProtocolOptions().max_requests_connection(),
1, // HTTP1 always has a concurrent-request-limit of 1 per connection.
data) {
parent.host()->cluster().stats().upstream_cx_http1_total_.inc();
Expand Down
8 changes: 5 additions & 3 deletions source/common/http/http2/conn_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ uint64_t maxStreamsPerConnection(uint64_t max_streams_config) {

ActiveClient::ActiveClient(HttpConnPoolImplBase& parent)
: Envoy::Http::ActiveClient(
parent, maxStreamsPerConnection(parent.host()->cluster().maxRequestsPerConnection()),
parent, maxStreamsPerConnection(parent.host()->cluster().commonHttpProtocolOptions().max_requests_connection(),
parent.host()->cluster().http2Options().max_concurrent_streams().value()) {
codec_client_->setCodecClientCallbacks(*this);
codec_client_->setCodecConnectionCallbacks(*this);
Expand All @@ -67,14 +67,16 @@ ActiveClient::ActiveClient(HttpConnPoolImplBase& parent)
ActiveClient::ActiveClient(Envoy::Http::HttpConnPoolImplBase& parent,
Upstream::Host::CreateConnectionData& data)
: Envoy::Http::ActiveClient(
parent, maxStreamsPerConnection(parent.host()->cluster().maxRequestsPerConnection()),
parent, maxStreamsPerConnection(parent.host()->cluster().commonHttpProtocolOptions().max_requests_connection()),
parent.host()->cluster().http2Options().max_concurrent_streams().value(), data) {
codec_client_->setCodecClientCallbacks(*this);
codec_client_->setCodecConnectionCallbacks(*this);
parent.host()->cluster().stats().upstream_cx_http2_total_.inc();
}

bool ActiveClient::closingWithIncompleteStream() const { return closed_with_active_rq_; }
bool ActiveClient::closingWithIncompleteStream() const {
return closed_with_active_rq_;
}

RequestEncoder& ActiveClient::newStreamEncoder(ResponseDecoder& response_decoder) {
return codec_client_->newStream(response_decoder);
Expand Down
5 changes: 3 additions & 2 deletions source/common/tcp/conn_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ namespace Tcp {
ActiveTcpClient::ActiveTcpClient(Envoy::ConnectionPool::ConnPoolImplBase& parent,
const Upstream::HostConstSharedPtr& host,
uint64_t concurrent_stream_limit)
: Envoy::ConnectionPool::ActiveClient(parent, host->cluster().maxRequestsPerConnection(),
concurrent_stream_limit),
: Envoy::ConnectionPool::ActiveClient(
parent, host->cluster().commonHttpProtocolOptions().max_requests_connection(),
concurrent_stream_limit),
parent_(parent) {
Upstream::Host::CreateConnectionData data = host->createConnection(
parent_.dispatcher(), parent_.socketOptions(), parent_.transportSocketOptions());
Expand Down
6 changes: 3 additions & 3 deletions source/common/tcp/original_conn_pool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,9 @@ OriginalConnPoolImpl::PendingRequest::~PendingRequest() {

OriginalConnPoolImpl::ActiveConn::ActiveConn(OriginalConnPoolImpl& parent)
: parent_(parent),
connect_timer_(parent_.dispatcher_.createTimer([this]() -> void { onConnectTimeout(); })),
remaining_requests_(parent_.host_->cluster().maxRequestsPerConnection()), timed_out_(false) {

Comment thread
mk46 marked this conversation as resolved.
connect_timer_(parent_.dispatcher_.createTimer([this]() -> void {
onConnectTimeout(); })),
remaining_requests_(parent_.host_->cluster().commonHttpProtocolOptions().max_requests_connection(), timed_out_(false) {
parent_.conn_connect_ms_ = std::make_unique<Stats::HistogramCompletableTimespanImpl>(
parent_.host_->cluster().stats().upstream_cx_connect_ms_, parent_.dispatcher_.timeSource());

Expand Down