2

What is optimal number of parallel URLSessionDownloadTask in URLSession? I am trying to download multiple files (bigger files 10+MB) from different servers.

I tested downloading 10 files on 40Mbps connection. When I run single download task, speed is on average 21 Mbps. When I run 5 tasks in parallel, task speed is on average 6 Mbps. 10 tasks in parallel average speed 3 Mbps. So 5 is faster then 1 but 5 and 10 are same.

Is there optimal parallel tasks count? Or is URLSession managing URLSessionDownloadTask and determines how many are executed based on network speed?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Martin Vandzura
  • 3,047
  • 1
  • 31
  • 63
  • Good question. See [this](https://stackoverflow.com/questions/45092786/maximum-simultaneous-downloads-with-nsurlsession-regardless-of-host/45092893#45092893) answer. I examined w/ number of parallel tasks and ended up w/ default. You may find different results w/ you specific data size, etc. – beshio Aug 17 '18 at 14:21

0 Answers0