“Unable to connect to remote server fail” in HttpWebRequest

前端 未结 4 764
-上瘾入骨i
-上瘾入骨i 2021-01-07 09:47

I am using VSTS 2008 + C# + .Net 3.5 to develop a console application and I send request to another server (IIS 7.0 on Windows Server 2008). I find when the # of request thr

4条回答
  •  Happy的楠姐
    2021-01-07 10:45

    I reckon you've maxed out the web site's application pool queue. The default is 1000 requests, you're flooding the server with 2000 requests more or less all at once. Increasing the timeout isn't going to solve this.

    Try increasing the Queue Length for the application pool the site resides in.

    You should try and capture the underlying HTTP status, that'll give you a clue as to what is really going on.

    Update:

    When I run your code and try and download a sizeable file (200MB) I get (503) Server Unavailable.. Increasing the size of the Application Pool's request queue solves this (I set mine to 10000).

    Only once did I see Unable to connect to remote server and sadly have been unable to replicate. This error sounds like there's something broken at the TCP/IP layer. Can you post the full exception?

提交回复
热议问题