Re: URLSession on iOS 10
Re: URLSession on iOS 10
- Subject: Re: URLSession on iOS 10
- From: Shawn Erickson <email@hidden>
- Date: Wed, 23 Nov 2016 00:47:48 +0000
I am kinda curious if you can put together some example code for the problem.
I am hitting a single URL session with 10 concurrent requests driving thru hundreds in a minute for small requests against the same backend. I throttle things using an operation queue set to 10 current operations and have a simple asynchronous friendly operation starting up the request and finishing it self when the operation competes.
I have run up the concurrency as a test and not seen what you are reporting.
As others note it really isn't a good idea to attempt that many concurrent requests in the same URL session or different session especially if hitting the same server. Unless the server is returning data very very slowly with no bandwidth limits between you and it you likely shouldn't have more then a handful active at once.
-Shawn
On Tue, Nov 22, 2016 at 1:29 PM Rick Mann <
email@hidden> wrote:
> On Nov 22, 2016, at 03:23 , Quinn The Eskimo! <email@hidden> wrote:
>
>
> On 22 Nov 2016, at 11:17, Rick Mann <email@hidden> wrote:
>
>> I tried setting it to 4, but I still get the problem.
>
> What happens if you don’t modify it at all?
Still get the problem.
FWIW, I'm also setting .httpShouldUsePipelining to true and .timeoutIntervalForRequest to 3600 (necessary because the timeout isn't reset for each request, but rather for the whole session). I commented out all my adjustments and tried just the default URLSessionConfiguration, still the same behavior.
• Aside: I was getting the default URLSessionConfiguration and setting these properties. Should I be getting a copy of the default instead?
• I'm also worried about the frequent "A server with the specified hostname could not be found" errors I get. Could that be the result of attempts at DNS resolution failing because of too many open files, and being changed into a not-found error? I also get "The Internet connection appears to be offline".
In fact, all three errors are often found interspersed throughout.
• I don't understand why so many connections are opening, since I am currently limiting it to 4 tasks per session. It seems they're not closing after each use, but not getting re-used?
Thanks,
--
Rick Mann
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden