web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Dynamics CRM Online connection getting forcibly closed by the server in the middle of migration

(1) ShareShare
ReportReport
Posted on by

Hi All,

While we are migrating records from SQL to CRM Online, in the middle of migration we see that the CRM Online Connection is getting forcibly closed by the server.

“System.ServiceModel.CommunicationException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server System.Net.WebException: The underlying connection was closed: A connection that was expected to be kept alive was closed by the server System.Net.Soc...ketsException: An existing connection was forcibly closed the remote host at System.Net.Sockets.NetworkStream……”

We figured out there is relationship between ExecuteMultipleRequest batch size & CRM Organization Service Proxy timeout. Earlier when I set Batch Size=100 & Timeout = 3600s we used to see that connection getting forcibly closed by the server, after we change the Batch Size=10 & Timeout=100s we didn’t see any connection issue but the performance has gone down drastically.

To figure out what are the optimal values other than trail & error methods, does anyone have any idea on how to determine these values keeping connection issue & performance in mind. Appreciate any responses.

Thanks,

Shaik

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Josh Thompson Profile Picture
    1,115 on at

    I've always gotten these errors sporadically when migrating data to CRM online. We just log the errors and reprocess those records. I don't know that there is a magic number for you to set unfortunately. I would make a point to log the source key of each row that failed and just rerun them, they usually go in without issue the second time around.

  • Verified answer
    Nina P. Profile Picture
    2,195 on at

    Hi Shaik,

    the recommended batch size and timeout values to use in such scenarios might depend from case to case. You can find information about the batch size limitations and parallel batch execution limits which apply for CRM Online from the following article: msdn.microsoft.com/.../jj863631.aspx

    Run-time Limitations

    There are several constraints related to the use of the ExecuteMultipleRequest as described in the following list.

    • No recursion is allowed - ExecuteMultipleRequest cannot invoke ExecuteMultipleRequest. An ExecuteMultipleRequest found in the request collection will generate a fault for that request item.

    • Maximum batch size – there is a limit to how many requests can be added to a request collection. If that limit is exceeded, a fault is thrown before the first request is ever executed. A limit of 1000 requests is typical though this maximum amount can be set for the Microsoft Dynamics CRM deployment and can be overridden at the organization level by a deployment administrator. For more information, see ExecuteMultipleMaxBatchSize in these topics: Organization Table Metadata (Advanced Settings), Deployment Table Metadata (Advanced Settings).

    • Throttling of concurrent calls – for Microsoft Dynamics CRM Online there is a limit of 2 concurrent ExecuteMultipleRequest executions per organization. If that limit is exceeded, a “Server Busy” fault is thrown before the first request is ever executed. For an on-premises deployment, throttling is not enabled by default. For more information, see ExecuteMultipleMaxConnectionsPerServer and ExecuteMultiplePerOrgMaxConnectionsPerServer in this topic: Deployment Table Metadata (Advanced Settings).

    In addition, I would recommend you to apply the below steps for working with any WFC client_

    • Apply KB support.microsoft.com/default.aspx “How do I configure Internet Explorer to download more than two files at one time?”

    • Apply support.microsoft.com/.../196271 (for MaxUserPort)

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters

    Name: MaxUserPort

    Type: DWORD

    Value: decimal 65534

    • Apply support.microsoft.com/.../314053 (for TCPTimedWaitDelay)

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters

    Name: TCPTimedWaitDelay

    Type: DWORD

    Value: decimal 30

    • Add the service endpoint under Local Intranet site zone or Trusted site zone of IE browser

    Please let us know if this helps.

    Thank you for using Dynamics CRM Community.

    Nina Peneva

    CRM Support Engineer

  • Shaik Profile Picture
    on at

    Thanks Nina for the reply.

    FYI: I am not executing any ExecuteMultipleRequests concurrently I am executing one ExecuteMultipleRequest. As I said earlier if I decrease the Batch Size from 100 to 10 everything works great without any code change

  • Verified answer
    Shaik Profile Picture
    on at

    We found the root cause of this issue, while migration of records to CRM Online some of the back end SQL queries are taking huge time and Timeouts are happening and that is the reason server is forcibly closing the connection.

    We resolved this issue by increasing the SQLCommandTimeout to 60 seconds for our CRM Online Organization. Hope it helps.

    Thanks,

    Shaik

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans