Re: Running out of Sockets

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



If you're bumping into these limits, you're going to need multiple IP
Addresses.Recycling of ports is something that can happen, but in boundry
cases - where it may take several minutes for the O/S to close a TCP
connection - you could still exhaust things.

We we did our big scalability tests, we had 4 network cards, each with 10 IP
Addresses bound to them. For incoming connections, we relied on basic
client-side DNS randomization. That is, we assigned 10 IP Addresses to
"host1", 10 to "host2' , 10 to "host3", etc. When the client picks an IP for
"host1", it's supposed to randomize which of the 10 addresses it uses. All
the standard DNS lookup tools will take care of this.

Now, for LDAP queries using .Net API's, if you're opening and closing
sockets that frequently, you've got bigger problems. You really should build
some sort of LDAP Connection Pool, which allows you to re-use LDAP
connections. You don't want to setup and tear-down an LDAP connection for
each query. Given the load this introduces, it's a big scalability hit.

--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins

"Salim" <Salim@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:050B3C04-591E-4596-B5ED-B772D2CF5838@xxxxxxxxxxxxxxxx
I am working on a .Net Web Service which will be used by thousands of users
at a time. It does lot of file operations (Creating, deleting,
enumerating,
reading attributes etc) and Ldap queries to AD using .Net APIs. Under
stress
test, service machine runs out of Sockets and we start seeing weird
errors. I
created MaxUserPort entry in registry on service machine toa llow 65,500
max
no. of sockets to be created. It runs fine now. It could be a problem
later
during more stress in production. Is there a way in .Net to minimize
socket
usage during file and ldap AD operations? Is there a way i can force the
machine to recycle the sockets so it never runs out of socket.

Thanks,
Salim Ansari


.



Relevant Pages

  • Re: Socket communication on multihomed box
    ... LAN route before USB ... The thing is that connection MUST always stay open. ... as for sockets, I'm using native syscalls, not MFC. ... Another thing is that is should work both under Linux and Windows. ...
    (microsoft.public.win32.programmer.networks)
  • Socket communication on multihomed box
    ... I'm building a kind of server which is supposed to handle ... The thing is that connection MUST always stay open. ... as for sockets, I'm using native syscalls, not MFC. ... Another thing is that is should work both under Linux and Windows. ...
    (microsoft.public.win32.programmer.networks)
  • Socket communication on multihomed box
    ... I'm building a kind of server which is supposed to handle ... The thing is that connection MUST always stay open. ... as for sockets, I'm using native syscalls, not MFC. ... Another thing is that is should work both under Linux and Windows. ...
    (comp.programming)
  • Re: "C - like: THIS" pointer to a task type inside a task function
    ... clients through N sockets, using the SAME PORT. ... Each connection has a socket. ... reader queueing them and delivering each request per time to the ... Selectreturns list of sockets available to read without blocking. ...
    (comp.lang.ada)
  • Re: Socket leak
    ... MS> Its almost like there are stale sockets. ... it appeared that problem was caused by proftpd. ... connection in passive mode and then exited. ... connection in our system reported by netstat in ESTABLISHED state. ...
    (freebsd-hackers)