-
Notifications
You must be signed in to change notification settings - Fork 43
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
Keep-Alive not working for HTTP forwarded traffic (CloudFlare related) #968
Comments
Hi @Power2All, Thank you for sharing it. Sorry for the delay; I was on holiday :-). I wonder how you monitor the number of connections and how you realized those connections were not being used. What is the expected behaviour from Actix? Should Actix keep the connection open to reuse it (when the client is using Http 1.1), so the total number of connections is lower? I've been reading that HTTP2 and HTTP3 don't use this header: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive. These newer protocols already keep the connection open. |
No worries, hope you had a fun vacation :) I can monitor them through the "ss -s" command in Linux. Active connections tracked are shown there. Yes, you are right that Keep-Alive is ignored on HTTP2, is because HTTP2 already utilizes a Keep-Alive behavior. The Keep-Alive is basically only meant for HTTP/1.1 Currently Gbitt runs in UDP only mode, as the bandwidth usage exceeded my limitation (roughly 50TB per month). UDP has been optimized a lot, using more threading to alleviate the incoming packets. |
Figured out with Actix (which Torrust isn't using) doesn't handle Keep-Alive when traffic from CloudFlare is coming from a pure HTTP (port 80) protocol. It seems it only works on HTTP/2 traffic, and in HTTPS (SSL). The Keep-Alive is then triggered, and lowers the amount of connections significantly.
I applied a HTTP to HTTPS forward through CloudFlare, with an 301 permanent forward setting, which seems to have solved the issue.
This might come in handy for people who run this tracker behind CloudFlare.
This information might be handy to know for @josecelano
The text was updated successfully, but these errors were encountered: