I am working on an app which uses iOS NSURLSession background session to upload the data to the S3 server. From iOS 15.x
, We have observed that transfer speed has become too slow (~10 kbps).
Following is the configuration, I am using
- Create the
NSURLSessionConfiguration
using backgroundSessionConfigurationWithIdentifier - Set HTTPMaximumConnectionsPerHost to
8
- Set timeoutIntervalForRequest to
60s
- Set timeoutIntervalForResource to
86400s
(1 Day) - Set discretionary to
false
- Set TLSMinimumSupportedProtocolVersion to
tls_protocol_version_TLSv12
- Create the
NSURLSession
using sessionWithConfiguration - send request using uploadTaskWithRequest
When I tested with iPadOs 14.8.1
, there is no degradation in performance, but with iPadOs 15.3.1
and 15.5
, I can see the performance degradation (uploads getting 6x slow).
When I create the session using ephemeralSessionConfiguration upload is very fast and there is no degradation (working as before).
For all the tests, I am keeping the app in foreground only.
I have few queries:
- Is there any changes in background session configuration for iOS
15.x
and greater ? - We are currently using backgroundSessionConfigurationWithIdentifier to create background sessions. Should we consider moving to background tasks introduced in iOS 13 ?
- Is it upto the OS (in this case
iOS
) to schedule the requests and we (clients) has no or very little control over the transfer speeds ?
PS: The degradation is happening with iOS simulators also. In case of simulators, somehow it is dependent on macOs versions (as seen from my tests).
On macOs 12.4
, in xCode 13.2
, iOS 12.x
, 13.x
, 14.x
, 15.x
simulators are showing the performance degradation.
When the same app is compiled from macOs 11.4
, xCode 12.4
, iOS 12.x
, 13.x
, 14.x
are not showing any performance degradation.
Any inputs would be highly appreciated.