title: .Net5 HttpClient concurrency - performance
body: <p>Created a HttpClient using IHttpClientFactory and send 1000 GET call in parallel to WebApi and observed the delay of about 3-5mins for each request.. once this is completed after this again send 1000 GET requests in parallel, this time there was no delay.</p>
  <p>Now I increased the parallel request to 2000, for the first batch, each request delay was about 9-11min. And for the second 2000 parallel requests, for each request delay was ~5min(which in case of 1000 requests there was no delay.)</p>
  <pre><code>var client = _clientFactory.CreateClient();
              client.BaseAddress = new Uri(&quot;http://localhost:5000&quot;);
              client.Timeout = TimeSpan.FromMinutes(20);
  
  
  
              List&lt;Task&gt; _task = new List&lt;Task&gt;();
              for (int i = 1; i &lt;= 4000; i++)
              {
                  _task.Add(ExecuteRequest(client, i));
                  if (i % 2000 == 0)
                  {
                      await Task.WhenAll(_task);
                      _task.Clear();
                  }
              }
  
  private async Task ExecuteRequest(HttpClient client, int requestId)
      {
  
          var result = await client.GetAsync($&quot;Performance/{requestId}&quot;);
  
          var response = await result.Content.ReadAsStringAsync();
  
          var data = JsonConvert.DeserializeObject&lt;Response&gt;(response);
  
      }
  </code></pre>
  <p>Trying to understand,</p>
  <ul>
  <li>how many parallel request does HttpClient supports without delay.</li>
  <li>How to improve performance of HttpClient for 2000 or more parallel requests..</li>
  </ul>