Skip to content

3.1: Reset KeepAliveTimeout on HTTP/2 ping #24858

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

Merged
merged 4 commits into from
Aug 13, 2020

Conversation

JamesNK
Copy link
Member

@JamesNK JamesNK commented Aug 13, 2020

Description

Kestrel has a KeepAliveTimeout option. This timeout controls how long Kestrel will keep an inactive HTTP connection alive before closing it. The default value is 2 minutes. The behavior is important because a client might connect to a server, then their network drops, and Kestrel needs a way to remove the unused connection.

In HTTP/1.1 and HTTP/2 the timeout is reset whenever a new request starts. The change in this PR extends HTTP/2 to also reset the timeout when a HTTP/2 ping is received on the connection.

Keeping a connection that is not receiving requests via HTTP/2 pings offers performance benefits. It keeps connections "warm" so that the first request after a period of inactivity does not need to reestablish the connection (open TCP socket, make TLS handshake, make HTTP/2 connection handshake) for the first request.

Customer Impact

Performance

Regression?

No

Risk (see taxonomy)

Low-Medium. The code change is small. However there is the possibility that resetting the KeepAliveTimeout in a new place (processing incoming pings) could have unforeseen side-effects.

Link the PR to the original issue and/or the PR to master.

Original issue: #24601

Changes from #24644 and #24804

Packaging impact? (if a libraries change)

  • Change is to ASP.NET runtime (Microsoft.AspNetCore.Server.Kestrel.Core assembly)

@ghost ghost added the area-servers label Aug 13, 2020
@JamesNK JamesNK requested a review from Pilchie August 13, 2020 00:39
@JamesNK JamesNK added the Servicing-consider Shiproom approval is required for the issue label Aug 13, 2020
@ghost
Copy link

ghost commented Aug 13, 2020

Hello human! Please make sure you've included the Shiproom Template in a comment or (preferably) the PR description. Also, make sure this PR is not marked as a draft and is ready-to-merge.

@Pilchie Pilchie added this to the 3.1.x milestone Aug 13, 2020
@leecow leecow added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Aug 13, 2020
@leecow leecow modified the milestones: 3.1.x, 3.1.8 Aug 13, 2020
@wtgodbe wtgodbe merged commit 229e496 into release/3.1 Aug 13, 2020
@wtgodbe wtgodbe deleted the jamesnk/ping-keepalive-31 branch August 13, 2020 22:06
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants