HighTechTalks DotNet Forums  

TCP/IP port exhaustion - Unable to connect to the remote server

ASP.net Web Services microsoft.public.dotnet.framework.aspnet.webservices


Discuss TCP/IP port exhaustion - Unable to connect to the remote server in the ASP.net Web Services forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Gaetan
 
Posts: n/a

Default TCP/IP port exhaustion - Unable to connect to the remote server - 08-16-2007 , 02:01 PM






I have a web service client application that works fine when the requests rate is moderate. But when
I crank up the request rate, I eventually receive an "Unable to connect to the remote server"
exception.

Running the "netstat -n" command at that point, I determined that all the TCP/IP ports in the range
of 1025-5000 were in a TIME-WAIT state. Although this article refers to BizTalk
(http://msdn2.microsoft.com/en-us/library/aa560610.aspx) I experience the exact same results.

Is there a way to have the client side of a WebService request to re-use the same TCP/IP connection
for every request sent to a given remote host?


Reply With Quote
  #2  
Old   
Michael D. Ober
 
Posts: n/a

Default Re: TCP/IP port exhaustion - Unable to connect to the remote server - 08-17-2007 , 09:04 AM






What you are experiencing is a Denial of Service situation. The MSDN
article you referenced tells you exactly what needs to be done to alleviate
this issue. IP ports are numbered from 1 to 65534 and port numbers below
1000 are usually reserved for server applications for the initial
connection. Windows, by default, only uses ports 1000 to 5000 to satisfy
connection requests. This leaves 60534 ports "available" but never used by
Windows for this purpose.

Assuming your client isn't initiating and then ignoring the response from
the server, thus generating what's known as a SYN attack, and also properly
closing the socket when done (Article Fix Option 1), you need to increase
the number of ports on the server (Article Fix Option 2). I would also
consider reducing the socket timeout as described in Article Fix Option 3
if, and only if, you increase the ports to the maximum and are still having
this error.

For more information on this, please post in a Windows Server NG as this
issue is not really a .NET issue.

Mike Ober.

"Gaetan" <me (AT) somewhere (DOT) com> wrote

Quote:
I have a web service client application that works fine when the requests
rate is moderate. But when
I crank up the request rate, I eventually receive an "Unable to connect to
the remote server"
exception.

Running the "netstat -n" command at that point, I determined that all the
TCP/IP ports in the range
of 1025-5000 were in a TIME-WAIT state. Although this article refers to
BizTalk
(http://msdn2.microsoft.com/en-us/library/aa560610.aspx) I experience the
exact same results.

Is there a way to have the client side of a WebService request to re-use
the same TCP/IP connection
for every request sent to a given remote host?




Reply With Quote
  #3  
Old   
Gaetan
 
Posts: n/a

Default Re: TCP/IP port exhaustion - Unable to connect to the remote server - 08-17-2007 , 10:34 AM



Thank you Michael for taking the time to reply. I read the article many times and I am aware of the
ways to improve the situation.

I took over someone else client side code written in C# and I'm afraid, .Net Web Services is not my
forte. The code reads a file containing about 200,000 requests to be sent to a web application. For
testing right now, the client code and the web application is on the same server.

I think this forum is the right one, As the last statement of my original post indicates, I want to
know whether it is possible with .Net Web Service to reuse the same connection (port) for every
request.

Reply With Quote
  #4  
Old   
=?Utf-8?B?QWRyaWFuIEg=?=
 
Posts: n/a

Default Re: TCP/IP port exhaustion - Unable to connect to the remote serve - 08-22-2007 , 11:00 PM



Your connections are probably eaten by NTLM authentication and not the HTTP
requests. If your web service executes each of the requests using the same
Windows credentials then you can probably turn on
UnsafeAuthenticatedConnectionSharing which will prevent your application from
authenticating for all subsequent requests. This will save you one socket per
each request.

"Gaetan" wrote:

Quote:
Thank you Michael for taking the time to reply. I read the article many times and I am aware of the
ways to improve the situation.

I took over someone else client side code written in C# and I'm afraid, .Net Web Services is not my
forte. The code reads a file containing about 200,000 requests to be sent to a web application. For
testing right now, the client code and the web application is on the same server.

I think this forum is the right one, As the last statement of my original post indicates, I want to
know whether it is possible with .Net Web Service to reuse the same connection (port) for every
request.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.