I'm using scp to transfer files from one host to another over the Internet. Assuming that the transfer speed is 2Mb/s, it takes around 1.5 seconds to send 3Mb size between 2 hosts. However, if the file's size is 1Mb, it takes 0.75 second instead of 0.5, i.e. the transfer speed is lower.

Why does this happen? Moreover, is there a way to calculate or predict the time to transfer small file?

  • If it's between the same two hosts, that shouldn't be the case, so there's probably some other factor you neglected to mention. Is this behavior consistently repeatable? And are you talking about a single file in both cases? – jjlin Jul 2 '14 at 21:47
  • if you can't calculate or predict the times to transfer the files then how are you doing it there? you wrote 2Mb/s I don't know off hand. But wireshark may help a bit. It may enable you to see the time it started and the time it finished and what went on in between and how long for the packets to be sent and received – barlop Jul 2 '14 at 23:25
  • @barlop I can get the transfer speed for large file (i.e 2Mb/s), but for small file, whose size is less than 2Mb, I cannot find a kind of formular or equation so that given the size I can have an approximate time to transfer it. – Long Thai Jul 3 '14 at 11:54

Overhead for starting and finish the transfer take extra time. You can see this locally when transferring files too, it takes less time to transfer 1 100MB file than 100 1MB files.

| improve this answer | |
  • Hi, thank you for your answer. But can you explain more about this overhead, what is it exactly? – Long Thai Jul 2 '14 at 22:19
  • 1
    @Ramhound It's entirely reasonable to ask for an elaboration from somebdoy that answered. Aboba could put any elaboration in his answer. And it's entirely reasonable to ask for an elaboration on what the overhead is - if the question had asked why does it take longer then it doesn't answer that much to say that there is an overhead - the obvious question is what does that entail. Lung's comment was very sensible And by the way, the question asked about a bigger file vs a smaller file, and this answer doesn't explain that, this answer mentions multiple smaller files vs one big file. – barlop Jul 2 '14 at 23:20
  • @barlop - I don't agree. I believe this answer to be helpful. – Ramhound Jul 3 '14 at 0:29
  • 1
    Sure @LongThai overhead would be the parts of the process that actually locate and open the file for streaming. You could equate this to something like opening 1 big 100 litre tub of soup to pour it into a pot vs opening 100 1 liter cans. You then also have to rinse out and dispose of the containers. – Aboba Jul 3 '14 at 14:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.