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

overload: scale http stream idle timeout #14155

Merged
merged 6 commits into from
Dec 11, 2020

Conversation

akonradi
Copy link
Contributor

Commit Message: Scale HTTP stream idle timeout
Additional Description:
Allow scaling the timeout used for HTTP streams in response to overload conditions.
This allows Envoy to reclaim resources from long-lived but otherwise idle streams
when the proxy is overloaded.

Risk Level: low
Testing: ran tests
Docs Changes: API documentation changes to fix a bug and add the new enum
Release Notes: none
Platform Specific Features: none
Fixes #11427

/cc @antoniovicente

The connection timeout applies to the idle timeout in the common HTTP
protocol options message in the HttpConnectionManager, not to the
RouteAction idle timeout.

Signed-off-by: Alex Konradi <akonradi@google.com>
Add a new enum value to allow scaling the timeout applied to incoming
HTTP streams from downstream clients.

Signed-off-by: Alex Konradi <akonradi@google.com>
@repokitteh-read-only
Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to api/envoy/.
CC @envoyproxy/api-watchers: FYI only for changes made to api/envoy/.

🐱

Caused by: #14155 was opened by akonradi.

see: more, trace.

@akonradi
Copy link
Contributor Author

I'm happy to add an entry in the release notes, but the current version already includes one about scaled timers, which are new in this version. Since this PR justs add an additional timer to be scaled, it didn't seem worth another entry.

@antoniovicente antoniovicente self-assigned this Nov 24, 2020
@yanavlasov yanavlasov self-assigned this Dec 1, 2020
@yanavlasov
Copy link
Contributor

Are there any integration tests for scaled timer?

@akonradi
Copy link
Contributor Author

akonradi commented Dec 1, 2020

I don't think so. I'd expect to find them in test/integration/overload_integration_test.cc

@antoniovicente
Copy link
Contributor

I don't think so. I'd expect to find them in test/integration/overload_integration_test.cc

It would be ideal to have tests that would fail if the changes to source were reverted for whatever reason. Same feedback applies to all other scaled timeouts.

@yanavlasov
Copy link
Contributor

I think having integration tests would be very beneficial as they test a much more complete system and you can have clear signal which timeout was affected. I honestly could not figure out if the existing unit tests even covers new functionality.

@akonradi
Copy link
Contributor Author

akonradi commented Dec 4, 2020

I've proposed an integration test in #14290 for the existing scaled timer. I'm ambivalent towards either merging the changes in here to then add a test on top of it, or waiting for the PR to land on its own first.

@akonradi
Copy link
Contributor Author

akonradi commented Dec 7, 2020

See akonradi@530d653 for an integration test (based on merging in #14290 otherwise I'd just push it here)

…-timer

Signed-off-by: Alex Konradi <akonradi@google.com>
Add an integration test for scaling the HTTP stream timeout.

Signed-off-by: Alex Konradi <akonradi@google.com>

EXPECT_EQ(response->headers().getStatusValue(), "408");
EXPECT_THAT(response->body(), HasSubstr("stream timeout"));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you merge master and run this under tsan a few times to make sure this new test doesn't suffer problems similar to the other one? I think we should be good since the tests have different structure but it'll be good to be safe.

…le-http-stream-timer

Signed-off-by: Alex Konradi <akonradi@google.com>
antoniovicente
antoniovicente previously approved these changes Dec 9, 2020
@akonradi
Copy link
Contributor Author

akonradi commented Dec 9, 2020

Sorry, forgot to reply. I ran this locally under TSAN and it passed 100 times.

@antoniovicente
Copy link
Contributor

@envoyproxy/api-shepherds, could you please take a look?

@mattklein123 mattklein123 self-assigned this Dec 9, 2020
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

LGTM. Should this have a release note also?

/wait

@akonradi
Copy link
Contributor Author

akonradi commented Dec 9, 2020

I'm happy to add an entry in the release notes, but the current version already includes one about scaled timers, which are new in this version. Since this PR justs add an additional timer to be scaled, it didn't seem worth another entry.

WDYT?

@mattklein123
Copy link
Member

I think it would be good to be clear in the release notes about all of the timers that can be scaled so updating the existing one would be good?

Signed-off-by: Alex Konradi <akonradi@google.com>
Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Thanks!

@mattklein123 mattklein123 merged commit 6246920 into envoyproxy:master Dec 11, 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

Successfully merging this pull request may close these issues.

[http] Adaptive timeouts for idle HTTP client connections waiting for a request
4 participants