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

Fix slow uploads under HTTP2 #602

Closed
aquaspy opened this issue Sep 9, 2023 · 2 comments · Fixed by #603
Closed

Fix slow uploads under HTTP2 #602

aquaspy opened this issue Sep 9, 2023 · 2 comments · Fixed by #603

Comments

@aquaspy
Copy link

aquaspy commented Sep 9, 2023

Describe the bug

Uploads on Nextcloud are much slower than the expected. This happens with their recommended NGINX settings for HTTP2, but there is a tested and known fix.

Context

  • Hardware: VPS bought online 3 CPU 4GB of ram and SSD disk.
  • YunoHost version: 11.2.4
  • I have access to my server: Through SSH and through the webadmin
  • Are you in a special context or did you perform some particular tweaking on your YunoHost instance?: No
  • Using, or trying to install package version/branch: 27.0.2~ynh1
  • If upgrading, current package version: It's the latest available version

Steps to reproduce

1- Go to your Nextcloud domain
2- Upload a large file and check the upload speed. It will be really slow considering your network speed and the server distance.

Expected behavior

The upload should be faster. You can compare with other upload services like Send for example.

How to fix

It's quite easy, we just need to apply the suggested fix from this issue: nextcloud/documentation#9578

The exact commit is: nextcloud/documentation@9c0e018

For more information, you can read this Cloudflare blog: https://blog.cloudflare.com/delivering-http-2-upload-speed-improvements/

In short, we need to add this line:

    # The settings allows you to optimize the HTTP2 bandwitdth.
    # See https://blog.cloudflare.com/delivering-http-2-upload-speed-improvements/
    # for tunning hints
    client_body_buffer_size 512k;

At conf/nginx.conf

It can be added on line 49, right after "#pagespeed off;"

I did tests on my end, and I got a HUGE difference on the upload, up to 5 times faster. It would be really great. The mainstream documentation already applied this patch too:

https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html

Thanks for all the hard work on this project! I really appreciate it

@ericgaspar ericgaspar mentioned this issue Sep 9, 2023
@ericgaspar ericgaspar linked a pull request Sep 9, 2023 that will close this issue
@lapineige
Copy link
Member

Thanks for reporting and documenting all of this !
@ericgaspar made it real here #603 👌

@aquaspy
Copy link
Author

aquaspy commented Sep 16, 2023

Thank you so much guys! I'll go ahead and close this issue :)

Thanks for making the world a better place

@aquaspy aquaspy closed this as completed Sep 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants