Coder Social home page Coder Social logo

Comments (7)

ducpx avatar ducpx commented on August 17, 2024 1

Ok thanks. Let's me try to see how it works.

from tusd.

Acconut avatar Acconut commented on August 17, 2024 1

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.

from tusd.

Acconut avatar Acconut commented on August 17, 2024

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

from tusd.

ducpx avatar ducpx commented on August 17, 2024

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

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.

from tusd.

Acconut avatar Acconut commented on August 17, 2024

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.

from tusd.

vunguyen1989 avatar vunguyen1989 commented on August 17, 2024

@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

from tusd.

vunguyen1989 avatar vunguyen1989 commented on August 17, 2024

I got your point.
Thank you

from tusd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.