> On Nov 22, 2016, at 18:58 , Shawn Erickson <shaw...@gmail.com> wrote:
> 
> Does your server speak http/2 ?

No, I don't think so.

> What type of http tasks as you creating?

let req = URLRequest(...)
session.downloadTask(with: req)

> How are throttling the number of active tasks in session(s), you say to four.

I have a list of all the URLs I need to download. I start a download by popping 
one off the list, and setting up a downloadTask. I repeat that when a task 
completes successfully (in certain error cases, I put it back on in the list) 
and pop another and start it.

To get four simultaneously, I just start four.

> What does your thread count and queues look like when things go south on you?

I have 30 - 50 threads, the vast majority are just 3 frames deep, stopped in 
__workq_kernreturn. Main thread is quite deep, with eight or so "Enqueued 
from…" entries. Three or four more "Queue" threads, an NSURLConnectionLoader 
thread, and a uikit eventfetch thread.

> 
> -Shawn
> 
> 
> On Tue, Nov 22, 2016 at 4:51 PM Rick Mann <rm...@latencyzero.com> wrote:
> 
> > On Nov 22, 2016, at 16:47 , Shawn Erickson <shaw...@gmail.com> wrote:
> >
> > 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.
> 
> Again, I hit the problem with only 4 (or with the default settings), and 5 - 
> 11 simultaneous URLSessions. And again, I don't have this problem at all on 
> iOS 9.
> 
> I might be able to build a test case that hits our servers, but it does 
> require downloading thousands (perhaps hundreds) of files per session.
> 
> >
> > -Shawn
> >
> >
> > On Tue, Nov 22, 2016 at 1:29 PM Rick Mann <rm...@latencyzero.com> wrote:
> >
> > > On Nov 22, 2016, at 03:23 , Quinn The Eskimo! <eski...@apple.com> wrote:
> > >
> > >
> > > On 22 Nov 2016, at 11:17, Rick Mann <rm...@latencyzero.com> 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
> > rm...@latencyzero.com
> >
> >
> >
> >  _______________________________________________
> > Do not post admin requests to the list. They will be ignored.
> > Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
> > Help/Unsubscribe/Update your Subscription:
> > https://lists.apple.com/mailman/options/macnetworkprog/shawnce%40gmail.com
> >
> > This email sent to shaw...@gmail.com
> 
> 
> --
> Rick Mann
> rm...@latencyzero.com
> 
> 


-- 
Rick Mann
rm...@latencyzero.com



 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (Macnetworkprog@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/macnetworkprog/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to