title: HttpClient does not use ServicePointManager service points
body: <p>By default HttpClient only uses 2 concurrent connections per host. According to <a href="https://docs.microsoft.com/en-us/dotnet/api/system.net.servicepointmanager.defaultconnectionlimit?redirectedfrom=MSDN&amp;view=netframework-4.7.2#System_Net_ServicePointManager_DefaultConnectionLimit" rel="nofollow noreferrer">docs</a> I can change that. I don't want to change it on a global level, I just want to change it for the service I'm using. Therefore I wrote the following code:</p>
  
  <pre><code>// Increase connection limit in order to have more concurrent requests to MyService
  ServicePointManager.FindServicePoint(myServiceUrl, null).ConnectionLimit = 20;
  </code></pre>
  
  <p>Unfortunately, this doesn't work. The service (called via HttpClient) still uses only 2 concurrent connections. If I change the code to:</p>
  
  <pre><code>ServicePointManager.DefaultConnectionLimit = 20;
  </code></pre>
  
  <p>At the same code location, it works. However, I don't want to globally change this setting. How to change it locally only?</p>
  
  <p>Edit: I realized that something is setting the connection limit back to 2. Is there any operation (e.g., instantiating a new WebRequestHandler, instantiating a new HttpClient, ...?) which resets the connection limit?</p>