问题
I know about the HTTPMaximumConnectionsPerHost
option on NSURLSessionConfiguration
... but how many connections can iOS handle irrespective of host?
I assume this depends on some combination of... the # of cores.. the network interface.. and how busy the OS is in general + with downloads for other applications.
Can't find any hints about this.
Regardless I assume it's ridiculous to expect more than 2 or 3 at once..
Edit
Assuming the ability to have as many hosts and NSURLSession instances as wanted
回答1:
You can set more than 1000. As you know, Apples's document doesn't specify upper limit.
To download about 2000 small files in background, I set httpMaximumConnectionsPerHost to 2000, and tested w/ iPhone7+/iOs10.3.1 under WiFi. It worked w/o any issue. Then, I tested download time by changing httpMaximumConnectionsPerHost, and realized that increasing the number doesn't necessarily buy download time. So, for now, I'm leaving it to default value (=4). I think you need to examine with your apps (number of files, size, etc.).
来源:https://stackoverflow.com/questions/45092786/maximum-simultaneous-downloads-with-nsurlsession-regardless-of-host