Closed ducpx closed 7 months ago
Clients like tus-js-client
support uploading chunks of a single file in parallel. Have a look at its parallelUploads
option: https://github.com/tus/tus-js-client/blob/main/docs/api.md#paralleluploads
Clients like
tus-js-client
support uploading chunks of a single file in parallel. Have a look at itsparallelUploads
option: https://github.com/tus/tus-js-client/blob/main/docs/api.md#paralleluploads
Do you know how to config server to support uploading file in parallel? I knew that if the server does not support this feature, client can not upload a file in parallel.
tusd supports this out-of-the-box for file-based storage and S3 storage without any additional configuration necessary. It is not supported on GCS or Azure Storage yet.
Ok thanks. Let's me try to see how it works.
@Acconut I have added some code for uprading our tus upload from v1.9 to v2.0. in backend, using this:
tusd "github.com/tus/tusd/v2/pkg/handler"
in client, adding this to js client: arallelUploads: 5
var defaultOptions = {
endpoint: "",
fingerprint: _fingerprint2.default,
resume: true,
onProgress: null,
onChunkComplete: null,
onSuccess: null,
onError: null,
headers: {},
chunkSize: Infinity,
withCredentials: false,
uploadUrl: null,
uploadSize: null,
overridePatchMethod: false,
retryDelays: null,
parallelUploads: 5
};
Then, try to upload a file (about 3Gb), it shows about 10 seconds slower than non-parallel uploading.
It's slower. Should we keep working with parallel uploading?
Thanks
Parallel uploads are not guaranteed to make uploads faster as multiple requests then have to share the connection. A single HTTP request is usually able to fully utilize the available network throughput and adding more requests won't increase the available throughput. Plus, the server must concatenate the uploads together, which also takes times. In production, we also don't use parallel uploads for those exact reasons.
I recommend you to benchmark the uploads with and without parallel uploads. If you don't get a benefit from it, you should disable it.
I got your point. Thank you
I'm using tus lib with fileserver backend. I want to have the parallel upload feature to enable clients upload chunks in parallel.