title: REST Api Server Hangs On Large Volume of Requests (using c# HttpClient)
body: <p>We recently upgraded to EMC AppXtender REST Services 8.1. When we installed this on a server, it created a Virtual Directory (AppXtenderRest). </p>
  
  <p>We developed our web application by calling the REST Services available on this server.</p>
  
  <p>When we were under development REST server never hanged. 
  But once when we moved to production it started hanging. We are now re-setting IIS on this Server every 2-3 hours. </p>
  
  <p>After some research we took following steps in our code.</p>
  
  <ol>
  <li>Converted all our code to <code>async</code> / <code>await</code></li>
  <li>Set HttpClient Timeout to 30 mins</li>
  <li>On the REST Server increased no.of worker process from 1 to 4</li>
  </ol>
  
  <p>Nothing is working. </p>
  
  <p>Tried to check if any particular request is making server hang, but doesn't look like that. All requests return JSON except for one that returns <code>Stream</code> (Tiff/Pdf).</p>
  
  <p>Here is a sample of our REST Sevice call:</p>
  
  <pre><code>using (var client = CreateHttpClient())
  {
      using (var response = await client.DeleteAsync(string.Format(RestUrls.deletedoc, DataSource, AppId, docId), GetCancelToken()))
      {
          if (response.IsSuccessStatusCode)
          {
              result = await response.Content.ReadAsStringAsync();
          }
          else
          {
              result = await response.Content.ReadAsStringAsync();
              throw new Exception(result);
          }
      }
  }
  </code></pre>
  
  <p>Also attaching the worker process requests queue screenshot on the server that shows requests hanging after certain period of time (after 2-3 hours)</p>
  
  <p><a href="https://i.stack.imgur.com/wbp43.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wbp43.png" alt="enter image description here"></a></p>
  
  <p>Also attaching the debug analysis report from the server taken just after it hanged.</p>
  
  <p><a href="https://drive.google.com/open?id=0Bx6jnZk4gj2Ycmw2M1RKM3RiTzg" rel="nofollow noreferrer">https://drive.google.com/open?id=0Bx6jnZk4gj2Ycmw2M1RKM3RiTzg</a></p>
  
  <p>As we are in production now, cannot afford frequent IIS resets. </p>