ASP.NET / IIS7 中可以进行多少个并发出站 HttpWebRequest 调用?
我正在编写一个 ASP.NET Web 应用程序,它将在 Windows Server 2008 (IIS7) 上运行。
每个页面的代码隐藏都需要使用 HttpWebRequest 和 GET 对外部服务器进行至少一次同步 Web 服务调用。
我的问题 - 我可以进行的出站 HttpWebRequest 调用数量是否有限制? (假设我调用的服务器没有限制)
是否有任何方法可以池化这些连接以使应用程序更好地扩展?网络花园配置有帮助吗?
I'm writing an ASP.NET web application which will run on Windows Server 2008 (IIS7).
Each page's codebehind will need to make at least one synchronous web service call to an external server using HttpWebRequest and GET.
My question - is there any limit to the number of outbound HttpWebRequest calls I can make? (assume that the server I'm calling has no limit)
Is there any means to pool these connections to make the app scale better? Would a web garden configuration help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
默认情况下,HTTP/1.1 服务器限制为两个连接,HTTP/1.0 服务器限制为四个连接。因此,如果您尝试向 HTTP/1.1 服务器发出两个以上未完成的请求(例如),您的 ASP.NEt 应用程序将出现严重的吞吐量问题。
您将需要增加每个服务器或全局的连接限制。
例如,在全球范围内:
希望这会有所帮助。
By default, an HTTP/1.1 server is limited to two connection, and a HTTP/1.0 server is limited to four connections. So, your ASP.NEt app will have serious throughput problems if you are trying to issue more than two outstanding requests to an HTTP/1.1 server, for eg.
You will need to increase the connection limit, either per server, or globally.
For eg, globally:
Hope this helps.
我认为你的问题应该针对网络配置。
我想说,如果每个页面都依赖于同步外部调用,那么您就是在自找麻烦。如果您收到 N 个挂在外部 Web 服务上的请求怎么办?那时你会遇到一些问题,但你对此无能为力。
您是否考虑过带有回调的异步调用?
编辑: ASP.NET 2.0 中的异步页面
I think your question should be geared toward network configurations.
I'd say you are asking for trouble if every page is dependent on a synchronous external call. What if you get N number of request that get hung on the external web service(s)? You will have some issues on your end then and you can do nothing about it.
Have you considered async calls with callbacks?
EDIT: Asynchronous Pages in ASP.NET 2.0
以下链接指向一篇关于优化 Asp.net 的非常精彩的文章。
http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx
希望有帮助;)
The following link points to a really great article for optimizing Asp.net.
http://www.codeproject.com/KB/aspnet/10ASPNetPerformance.aspx
Hope it helps ;)