jjmutumi / tus_client

A tus client for dart
MIT License
32 stars 41 forks source link

The speed cannot be stable at high speed, and the speed changes frequently up and down. #28

Open zxl777 opened 2 years ago

zxl777 commented 2 years ago
_client = TusClient(
                                  Uri.parse("https://master.tus.io/files/"),
                                  _file,
                                  store: TusMemoryStore(),
                                  maxChunkSize: 8 * 1024 * 1024);

The speed cannot be stable at high speed, and the speed changes frequently up and down.

截屏2022-04-20 21 10 15
jjmutumi commented 2 years ago

I think this should be expected because of the extra latency setting up the HTTP request for the next chunk. I'm not sure of a workaround for this because this is the way TUS protocol works.

If the TUS protocol is updated to use HTTP 2 then maybe this latency could go away because we can reuse the connection.

May be increasing chunk size would speed up the upload but might make using the library less useful for users with poor / bad networks.

zxl777 commented 2 years ago

It's not a problem with the TUS protocol, I use the web to upload to the TUS server much smoother and faster. Please refer to this webpage https://uppy.io/examples/dashboard/ , you can also use an html page of uppy to upload tus and test it.