多次调用同一个 Web 服务阻塞? [英] Multiple Calls to the same Web Service Blocking?

查看:38
本文介绍了多次调用同一个 Web 服务阻塞?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个向第 3 方网络服务发出请求的页面.当在重负载下时,此响应时间显着延长,但是第 3 方报告说处理时间保持不变.时间显示,从他们收到请求到他们发回请求的时间总是在 1.5-2.0 秒左右.现在我们正在经历超过 20 秒的等待时间.我对 ASP.NET 的理解是,每个请求都会在一个 IIS 线程池线程上运行,并将请求返回给 3'rd 方服务并处理.所以我真的不明白什么可能阻碍我们.有什么我想念的吗?是否有超出 IIS 的阈值限制阻止?

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.

推荐答案

.NET 限制强制执行 HTTP 规范建议的对单个主机的 2 个并发 Web 请求的限制.因此,在您的情况下,需要更多时间执行的不是 Web 服务,而是您的应用程序延迟请求以保持在此约束范围内.

.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.

您可以通过将此密钥添加到配置文件来提高 Web 服务的限制:

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>

这篇关于多次调用同一个 Web 服务阻塞?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆