Why is the download speed slow in the early seconds?

14

1

When you download a big enough file, you can see that in the early seconds, the download speed increases to finally reach its mean value. Why?

seriousdev

Posted 2011-07-10T21:58:21.607

Reputation: 1 320

2Can you share some names of applications you use where you see this behavior? There may be different answers depending on different software. – DuckMaestro – 2011-07-11T03:02:43.603

Answers

19

Two things:

  1. There's some overhead in negotiating and setting up the transfer, especially with protocols like FTP. FTP actually sets up a second TCP channel exclusively for data transfer, so a second 3-way handshake has to take place, etc etc.

  2. Most TCP connections are set for "slow startup". The TCP code is kind of feeling its way up to the maximum segment size that will work for the route between two hosts.

Bruce Ediger

Posted 2011-07-10T21:58:21.607

Reputation: 533

1I don't think item #1 is a sufficient explanation, at least not with FTP, because most clients I've seen only calculate speed on the data channel, not the control channel. We also don't know if the questioner is referring specifically to FTP. – DuckMaestro – 2011-07-11T03:00:59.707

17

The method for calculating download speed varies from software to software. The first thing to keep in mind is that speed is always calculated in the context of a certain time duration. Some software may display download speed for the entire time you've been downloading (could be hours), while other software may display download speed for only the most recent x number of seconds. The shorter the time duration for the speed calculation, the more real-time the value is.

Further, when a download first begins, there is a choice to be made whether the software assumes an initial speed of 0, or whether the software assumes (and displays) no initial speed whatsoever until it has more data to make an estimate with.

In the situation you've described, it is possible that the software is such as the former above, and so it takes a few moments for the calculated value to average up (from 0) to a more accurate value.

DuckMaestro

Posted 2011-07-10T21:58:21.607

Reputation: 1 597

1Bingo - "there is a lack of data to derive a measurement from at the beginning" sounds most correct. I think most downloaders are smart enough to delay taking metrics until the file is actually being downloaded (as opposed to @Bruce). – new123456 – 2011-07-10T22:09:03.477

13

It's called tcp windowing, on successful transmition of a packet the window the amount of data gets increased this will keep happening till an error in transmition happens it depends on the speed and reliabilty of the connection, the applications just calculates how long the transfer will take at the current rate the tcp window will allow

squareborg

Posted 2011-07-10T21:58:21.607

Reputation: 2 105