CRM 4.0, Data Import and TCP Socket Outage...

When doing bulk data import on CRM 4.0 using self-made application that utilizes CRM SDK to communicate with web server, if the application is running parallel that simultaneously accessing the server, sometimes you may get this kind of error and the import will fail:

"Only one usage of each socket address (protocol/network address/port) is normally permitted (typically under load)."

or error message in Japanese:

"リモート サーバーに接続できません。 通常、各ソケット アドレスに対してプロトコル、ネットワーク アドレス、またはポートのどれか 1 つのみを使用できます。 10.1.1.1:80"

when encounter this, mostly it's likely that the client side is running out the available TCP connection sockets due to that Windows had the default free available socket amount set to 5000 and fast parallel web requests and 240 seconds default TCP TIME_WAIT settings that just occupied all the available sockets in a short interval of time. refer to this and this for detals.

the solution is to increase the available TCP sockets and decrease the TCP TIME_WAIT interval, at client application machine, via the registry settings.

Increase TCP sockets: add or modify the DWORD key to 65534 (the default is 5000)

HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\MaxUserPort

Decrease the TCP TIME_WAIT time: add or modify the DWORD key to 30 (default is 240 in seconds)

HKLM\System\CurrentControlSet\Services\Tcpip\Parameters\TCPTimedWaitDelay

remember to restart the client machine to let the settings take effect.

by setting this successfully avoid the error and the data import was done smoothly in a fast powerful production CRM server-farm during our testing. from here we are considering to increase the importing-application parallel rank in order to minimize the initial bulk import time for next step...

the other thing to mention is that, actually the same error also occurred when calling CRM services in Plugins. for this, the CRM Web Server are not only acts as the server, but also a client at consuming itself, and thus for the CRM Web Server that has plugins using CRM web services, it maybe a good idea to also do this workaround to prevent socket outage.

FYI.

Technorati Tags: microsoft,dynamics,crm,bulk,import,tcp,ip,socket,web,service,networking