Breaking news from around the world
Get the Bing + MSN extension
Now Available in Community - MBAS 2019 Presentation Videos
Catch the most popular sessions on demand and learn how Dynamics 365, Power BI, PowerApps, Microsoft Flow, and Excel are powering major transformations around the globe. | View Gallery
2019 release wave 2 Discover the latest updates to Dynamics 365Release overview guides and videos Release Plan | Early Access Availability
Ace your Dynamics 365 deployment with packaged services delivered by expert consultants. | Explore service offerings
Connect with the ISV success team on the latest roadmap, developer tool for AppSource certification, and ISV community engagements | ISV self-service portal
The FastTrack program is designed to help you accelerate your Dynamics 365 deployment with confidence.
FastTrack Program | Finance TechTalks | Customer Engagement TechTalks | Talent TechTalks | Upcoming TechTalks
by Luke Simpson 01.15.09
When performing a data integration or migration into CRM, it is very common to create a .Net application that transforms the data, then pushes the records into CRM using the WebServices. At times, however, the load of data being pushed to IIS can be more than is acceptable to the default settings in an IIS implementation. At these high load times, the server might post an error stating "Only one usage of each socket address (protocol/network address/port) is normally permitted (typically under load)."
What is happening, is that connections are being repeatedly opened and closed on the webserver. When a connection is closed, the connection goes into a TIME_WAIT state for 240 seconds. This is the default setting. In this case, the IP being used is typically fixed, which means that the variable is the local port. By default ports 1024-5000 are available to be used, which means that using default setting you have approximately 4000 ports to be used during a 4 minute span (240 seconds). So if your code is making more than 16 webservice calls per second, you will exhaust all of the available ports!
To fix this problem, you can make 2 different registry changes on the CRM Application Server.
Increase the dynamic port range. As stated above, the default is 5000 but this can be raised up to 65534.
Using Regedit, navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPort (if this key does not exist, create it as DWORD value)
Set the value to 65534, or a value of your choice
Reduce the amount of time that the connection is in a TIME_WAIT state.
Using Regedit, navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters\TCPTimedWaitDelay (if this key does not exist, create it as DWORD value)
Set the value to 30
By performing the actions above, you are allowing the server to use a far larger number of available ports, and you also allow the server to recycle them faster. Problem solved!
Business Applications communities