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

Given nginx configuration slows down uploads over https #1106

Open
namandureja opened this issue Apr 9, 2024 · 1 comment
Open

Given nginx configuration slows down uploads over https #1106

namandureja opened this issue Apr 9, 2024 · 1 comment
Labels

Comments

@namandureja
Copy link

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:

  1. Run tusd behind a proxy (nginx).
  2. Enable ssl and listen to 443 port with http2 configuration enabled.
  3. Test the upload speed.
  4. Disable the http2 configuration.
  5. Test the upload speed again.

Setup details
Please provide following details, if applicable to your situation:

  • Operating System: Linux, amd64
  • Used tusd version: v2.4.0
  • Used tusd data storage: AWS S3
  • Used tusd configuration: tusd -port -s3-bucket= -behind-proxy -disable-cors;
  • Used tus client library: tested with both uppy and tus-js-client
@namandureja namandureja added the bug label Apr 9, 2024
@Acconut
Copy link
Member

Acconut commented Apr 19, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants