1

When I create and start 20 NSURLSessionUploadTasks only 3-4 will run at anyone time, even when HTTPMaximumConnectionsPerHost is set to 20!

I understand that I can limit the number of max uploads very easily with HTTPMaximumConnectionsPerHost. However, I want to increase the number of concurrent uploads. I have started 'resumed' 20 new tasks but only 3 or 4 will run concurrently. When one batch finishes, 3 or 4 more will start until all tasks have completed. This is NOT OK, because my server requires a substantial amount of time to process each upload, meaning that I'm not getting much out of the user's available bandwidth while my server is working to respond to the POST requests.

How can I make NSURLSession run up to HTTPMaximumConnectionsPerHost? HTTPMaximumConnectionsPerHost works fine to limit the number of concurrent uploads, but NSURLSession appears to throttle down to 3 or 4 by itself regardless of the value set for HTTPMaximumConnectionsPerHost. This means that HTTPMaximumConnectionsPerHost only allows you to choose between 1 and 4 concurrent uploads, instead of between 1 and YOUR_MAX concurrent uploads!!

To be clear, my question is, is there any way to run 5 or more concurrent uploads at the same time with NSURLSessionUploadTask?

Andrew Paul Simmons
  • 4,334
  • 3
  • 31
  • 39

1 Answers1

0

NSURLSessionUploadTask yes.

NSURLSession no.

Dustin
  • 1,030
  • 11
  • 15