Maximum concurrent requests for WebClient, HttpWebRequest and HttpClient

Is there a limit on the number of concurrent / concurrent requests that you can send using the WebClient, HttpWebRequest and HttpClient classes in .NET 4.5? Or can you send unlimited concurrent requests if there are no restrictions on the web API or server? Sorry if the question is too broad, please correct me so that I can narrow it down.

+4
source share
1 answer

Yes, there is a limit. The default connection limit is 2 simultaneous connections to a remote host. This can be overridden. For example, I believe that ASP.NET overrides the default value of 10 connections to the remote host by default.

From https://msdn.microsoft.com/en-us/library/7af54za5.aspx :

The number of connections between the client and server can have a significant impact on the throughput of the application. By default, an application using the HttpWebRequest class uses a maximum of two permanent connections to a specific server, but you can set the maximum number of connections for each application.

, ServicePointManager.DefaultConnectionLimit. , HTTP- . , , HTTP- , ServicePoint .

, , HTTP-. , , , , RAM, , - . , , .net -. , .

, , , HTTP - , , HTTP- HTTP- . . . http://www.stevesouders.com/blog/2008/03/20/roundup-on-parallel-connections/ , - !

+15

Source: https://habr.com/ru/post/1654728/


All Articles