rclone icon indicating copy to clipboard operation
rclone copied to clipboard

Please support using multiple tcp connection for file downloading/uploading

Open ytrezq opened this issue 5 years ago • 14 comments

My isp is throttling per tcp connection speed.

So that in my case using rclone copy folder onedrive: is capped at around 100Mb/s

But if I do that same copy using multiple rclone mount using different cache dir and mount points then I’m getting an equivalent amount of 100Mb/s per mount point through splitting the upload through several copies.

It would be great that instead of dealing with several rclone commands I would be to use a single rclone copy myfolder onedrive: but with using a --concurrent-connection 4 option or even go further by adding the ability to use this with several network interfaces matching different isp.

ytrezq avatar Apr 17 '21 09:04 ytrezq

This is really about using several connections as transferring several files at once over the same connection (increasing --transfer beyond default value) doesn’t change the transfer rate unlike using several rclone commands.

ytrezq avatar Apr 17 '21 11:04 ytrezq

Using --transfer should increase the number of connection in use unless onedrive is connecting via HTTP/2.

If you take a look at a transfer with -vv --dump headers then you'll be able to see whether HTTP/2 is in use.

A global flag to disable HTTP/2 would probably be a good idea if so...

ncw avatar Apr 17 '21 16:04 ncw

@ncw it’s http 1.1 already. So this isn’t related.

ytrezq avatar Apr 17 '21 18:04 ytrezq

If it is http 1.1 then it should be using 1 TCP connection per file or download thread which is what you wanted.

Can you try this beta with the --disable-http2 flag? Then multi thread downloads should each use their own TCP stream as wil --transfers.

v1.56.0-beta.5411.6c0e25033.fix-5253-disable-http2 on branch fix-5253-disable-http2 (uploaded in 15-30 mins)

ncw avatar Apr 19 '21 16:04 ncw

Any luck with --disable-http2 ?

ncw avatar Apr 28 '21 10:04 ncw

@ncw as I said, http2 was already disabled, so it s something else.

ytrezq avatar Apr 28 '21 10:04 ytrezq

I was hoping you'd try that flag anyway if you've got time - thanks.

ncw avatar Apr 28 '21 22:04 ncw

fwiw i've been having some issues with onedrive being able to get remotely close to my gigabit speed on downloads (it's been doing a max of about 8-10 MB/s with http2).

On this version however, with http2 disabled, it's getting over 100 MB/s.

ghost avatar Apr 30 '21 18:04 ghost

fwiw i've been having some issues with onedrive being able to get remotely close to my gigabit speed on downloads (it's been doing a max of about 8-10 MB/s with http2).

On this version however, with http2 disabled, it's getting over 100 MB/s.

That is good to know thanks.

I've merged that flag to master now which means it will be in the latest beta in 15-30 minutes and released in v1.56

ncw avatar Apr 30 '21 19:04 ncw

@ncw also, https://beta.rclone.org/branch/fix-5253-disable-http2/v1.56.0-beta.5411.6c0e25033.fix-5253-disable-http2/ is lacking linux static builds.

ytrezq avatar May 06 '21 14:05 ytrezq

That flag is now in the latest beta so you don't need that branch any more @ytrezq

ncw avatar May 12 '21 10:05 ncw

I had the same problem with my nginx webdav The number of tcp connections is always only one with nginx http2 enabled

the --disable-http2 option worked for me, but it doesn't seem to be updated in the documentation rclone.org/docs

xiahuaijia avatar Feb 03 '22 20:02 xiahuaijia

the --disable-http2 option worked for me, but it doesn't seem to be updated in the documentation rclone.org/docs

You are right, it isn't...

I've added a bit of docs for that which will go live on the website when 1.58 is released.

ncw avatar Feb 04 '22 10:02 ncw

Note that this is likely caused by https://github.com/golang/go/issues/37373 if adding --disable-http2 makes things run quicker

ncw avatar Sep 14 '22 09:09 ncw