Re: Running out of Sockets
- From: "Chris Mullins [MVP]" <cmullins@xxxxxxxxx>
- Date: Thu, 12 Jul 2007 10:11:25 -0700
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
.
- Prev by Date: Re: Maintain list of attached event handlers (.Net 1.1)
- Next by Date: Re: Blocking on NetworkStream.Read()
- Previous by thread: Re: Running out of Sockets
- Next by thread: Trap mouse messages for the drop-down list of a ComboBox
- Index(es):
Relevant Pages
|