Managing Concurrent Network Requests

Hello,

Our app makes a lot of requests and we are starting to wrangle them into a priority queue style structure for ordered execution. As we get further into that work, is there guidance on how many requests URLSession will queue and does that change based on connectivity or network quality?

Thank you!

Answered by Frameworks Engineer in 891761022

URLSession does not queue requests and sends them out as quickly as possible. We recommend no more than 100 concurrent tasks for the default URLSession and no more than 10 concurrent tasks for the background URLSession.

Accepted Answer

URLSession does not queue requests and sends them out as quickly as possible. We recommend no more than 100 concurrent tasks for the default URLSession and no more than 10 concurrent tasks for the background URLSession.

HTTP/1 concurrency is limited by the maximum connection per host configuration, while HTTP/2 and HTTP/3 can generally perform more requests concurrently.

Managing Concurrent Network Requests
 
 
Q