Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple Calls to the same Web Service Blocking?

We have a page that makes a request to a 3'rd party web service. When under heavy load this response time extends significantly, however the 3'rd party reports back that there times for processing remains constant. There timings show that from the time they receive a request to the time they send it back is always around 1.5-2.0 seconds. Now we are experiencing wait times of over 20 seconds. My understanding of ASP.NET is that each request will run on a IIS thread pool thread and make the request to the 3'rd party service return and process. So I don't really understand what could be blocking on our end. Is there something I am missing?? Is there a threshold limit beyond IIS that is blocking?

If I am missing something a physical book recommendation that covers this subject would also be a very welcome addition to any answer.

like image 213
jquery auth Avatar asked Nov 18 '10 12:11

jquery auth


2 Answers

.NET limits enforces a limit of 2 concurrent web requests to a single host as suggested by the HTTP specification. So in your case it's not the web service that needs more time to execute, but your application delaying the requests to stay inside this constraint.

You can raise the limit for the web service by adding this key to your config file:

  <system.net>
    <connectionManagement>
      <!-- specific servers... -->
      <add address="http://example.org" maxconnection="20" />

      <!-- ...or any server -->
      <add address="*" maxconnection="8" />
    </connectionManagement>
  </system.net>
like image 151
realMarkusSchmidt Avatar answered Oct 18 '22 15:10

realMarkusSchmidt


You might want to read these for more information:

Contention, poor performance, and deadlocks when you make Web service requests from ASP.NET applications Performance Considerations for Making Web Service Calls from ASPX Pages

like image 33
PRR Avatar answered Oct 18 '22 16:10

PRR