-
Notifications
You must be signed in to change notification settings - Fork 483
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
Given nginx configuration slows down uploads over https #1106
Comments
Thanks for the report! I remember hearing something similar some time ago, but there were no concrete results at the time. We haven't noticed a slowdown from using HTTP/2, but we are also using HAProxy in our deployments, not Nginx. When looking for information on this, one can find many similar reports, for example:
It seems as if the default configuration for HTTP/2 on Nginx is not optimized for uploads. So this is not a bug in tusd, but rather the result of a missing configuration, as some people report tuning the configuration helped improve upload speed. The last link from above also links to a CloudFlare article, which dives into the topic of upload speed with HTTP/2. I haven't read it fully yet, but it seems as if it provides some potential hints to optimize upload speed. I want to look more into this, but maybe you can also read into it a bit. |
We encountered the same problem. The upload speed is only about 20% when HTTP/2 is enabled with Nginx v1.27. The CloudFlare article says they sent the patch to NGINX upstream. But I couldn't find either the commit or the code in the repo of Nginx. Maybe it's declined for some reason. |
Overall, this seems be a problem with the proxy and not tusd directly. We use HAProxy in production and have added this config to improve HTTP/2 performance:
I'm not sure if Nginx's http2 module provides a similar setting: http://nginx.org/en/docs/http/ngx_http_v2_module.html I cannot tell if the patch from CloudFlare was accepted or integrated in another way into Nginx. Maybe it's worth to ask Nginx about this problem directly. FYI, I also contacted the author to see if they have more insights: https://x.com/tus_io/status/1859544062962913582 |
Describe the bug
The given nginx configuration in the official docs - nginx.conf slows down uploads over https. I setup tusd on my virtual machine and after proxying it through nginx, I noticed significant drop in upload speeds (a factor of 20). Initially I thought that it was happening due to some issue in ssl encryption or proxy buffering by nginx. But, after a bit of experimenting, it turned out that this line was the root cause -
listen 443 http2 ssl;
The 'http2' configuration slowed down the uploads by a huge factor. Once I removed it, the speeds were back to normal again, as fast as on http.
Not sure if anyone else has faced this issue, but I thought it would be helpful for anyone running into this.
To Reproduce
Steps to reproduce the behavior:
Setup details
Please provide following details, if applicable to your situation:
The text was updated successfully, but these errors were encountered: