-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
feat(server): add h1 idle_timeout
#3743
Conversation
4362e38
to
d76e8d8
Compare
@sfackler / @seanmonstar is there a possibility on getting this PR reviewed? I am also interested in getting H1 idle timeouts available :) |
If you want, you can use the TOML snippet in my PR description to avoid needing to wait for review :) |
With the idle time configurable we can prevent a pile up of open connections which never see any activity. See also on the hyper issue tracker: ``` hyperium/hyper#3743 hyperium/hyper#1628 hyperium/hyper#2355 hyperium/hyper#2827 ```
Today I investigated further and reached the conclusion that this PR is unnecessary for my use-case because, contrary to my prior belief, In other words, unmodified
This PR would only be relevant for users who want to set different values for header read timeout and idle timeout. Any such user is welcome to:
Other timeouts, like reading the body and writing the response, could also be added outside of Considering the above, I will close this PR. I intend to open a new PR that only includes my fixes to the existing test cases. |
Motivation
Older browsers sometimes open 6 or more H1 connections and keep them alive and idle after resources are loaded, costing server resources and distracting from DoS attackers. In my specific case, DoS mitigation required limiting TCP connections per IP address, but limits had to be high to account for multiple legitimate H1 browsers on the same IP address.
Related: #1628
Related: #2355
Changes
idle_timeout
setting, optimized to avoid creating an additional timer per requestAutomatically send(deferred due to: Consider providing constants for keep-alive and proxy-connection header names. http#142)keep-alive: timeout=#
headerTesting
Future work
hyper-util
(feat(server): add support foridle_timeout
. hyper-util#146)