I\'am trying to perform as many as possible simultaneous http-downloads an IPad2 ( ios6.0 ). This is pure for testing what is possible on this device. Even not interested in
Just a bump to this in case anyone is still looking. I see it to be 4 simultaneous on my iPhone6S+. Here were my test steps:
The results are like clockwork. The first responses (4 of them) come back 12 seconds after the request (presumably 2 seconds to turn the radio on or whatever), but then each subsequent block of 4 responses come 10 seconds after the prior block of 4. All 4 at a time.
Hope that helps someone.
You can have maximum of 5 simultaneous connections to the same server. It's an iOS fixed limit and it's probably because of some http protocol constraints. You can read a bit more info here.
Is there in IOS a limit on how many concurrent downloads?
This is, by the way, a per server-based limit, not an iOS limit. If you try doing this from different servers at the same time, you will see that you can exceed your current limit.
Is there an other way to perform these concurrent downloads?
Obviously you could do something with GCD, too, manually managing concurrent requests, but I think NSOperationQueue
is an excellent solution and see no reason to look further than that. I certainly don't see any advantages to using threads, either.
You should benchmark the total elapsed time as the number of concurrent requests increases, but I'm sure you'll hit a point of diminishing returns. Just having more concurrent requests does not ensure better total performance.
After looking into this for a project I found something in Apple's documentation for NSURLSessionConfiguration.
From Apple's documentation --
This property determines the maximum number of simultaneous connections made to each host by tasks within sessions based on this configuration.
This limit is per session, so if you use multiple sessions, your app as a whole may exceed this limit. Additionally, depending on your connection to the Internet, a session may use a lower limit than the one you specify.
The default value is 6 in OS X, or 4 in iOS.