IIS7 中的最大并发 HttpRequest 数
我在 Asp.Net 中编写了执行大量 HttpRequest 的多线程应用程序,有时在我看来,如果很多线程同时执行 Http 请求,我会收到比平常更多的错误。我想知道是否有任何默认限制因为我在付费主机上托管此应用程序,所以一次连接数,并且还想知道是否有任何限制,尝试发送请求的其他线程是否由于超出限制而失败,或者是否有任何内部系统处理连接 IE。推迟它们直到连接可用。
提前致谢!
I wrote multithreaded application in Asp.Net that is doing alot of HttpRequests and sometimes it seems to me that if a lot of threads are doing Http requets at same time, I get more errors then usual.I was wondering if there is any default limit to number of connections at once since I am hosting this application at paid host, and also was wondering if there is any limit to this, are the other threads that are trying to send request failing because of limit being exceeded or is there any internal system that handle connction ie. puts them off until connection is available.
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过 web.config 中的地址配置
DefaultConnectionLimit
您还应该检查 Web 请求的超时。产生的异常是什么?
You can configure the
DefaultConnectionLimit
by address in the web.configYou also should check the timeout for the web requests. What is the exception generated?
AFAIK,HTTP 1.1 服务器仅限于两个连接,而 1.0 服务器仅限于四个连接。因此,您可以检查从 ASP.NET 应用程序发送到 HTTP/1.1/1.0 服务器的未完成/正在处理的请求数。
这可以通过 ServicePointManager.DefaultConnectionLimit 进行声明性更改 = 5; (例如:5个未完成的连接)
此外,您还提到它是付费主机。如果是这种情况,则值得向提供商检查您的请求限制(如果有)。
AFAIK, HTTP 1.1 server is limited to two connection wherein 1.0 server is limited to four connections. Therefore you can check how many outstanding/in process requests to an HTTP/1.1/1.0 server that you send from your asp.net app.
This can declaratively altered through
ServicePointManager.DefaultConnectionLimit
= 5; ( eg: 5 outstanding connections)In addition, you also mentioned it's a paid host. If that is the case, it’s worth checking your request limit (if any) with the provider.