How do file hosts control(?) the speed at which your file gets downloaded?

265 views

Just curious how do file hosts (e.g. Rapidgator) control the speed at which you are able to download a file?

For example, if you choose a free option, you download the file at X hours. However when you’re a Premium user, the file is downloaded 10x faster.

Like it’s the same file with the same file size, right? What do they do so that there will be difference at which a user will be able to download a file depending on their subscription? If it’s feasible, would also like a visualization of what happens when your browser downloads via free vs. via premium account.

Thank you!

Edit: grammar

In: 18

4 Answers

Anonymous 0 Comments

A file is stored somewhere on disk. To send a file to the destination the code enters a loop: read some data, send the data to the destination. Rinse and repeat until done.

You can easily measure how fast the file is being transferred. You know that you started 10 seconds ago and transferred 10 MB in those 10 seconds. Therefore the current speed is 1MB/s. If that’s too much, simply insert a pause in the process. Do nothing for a while, until the average speed falls down enough.

Such a decision can be easily made based on account type, time of the day, how many other people are downloading, etc.

You are viewing 1 out of 4 answers, click here to view all answers.