Saturday, January 31, 2009

Improving the Outlook Client User Experience

Sometimes a Microsoft Dynamics CRM 3.0 Laptop Client for Outlook (hereafter referred to as the CRM Outlook Laptop Client) user can experience a hang or bad performance when using the tracking functionality. In this case just setting 'Regarding' field information for an email to be tracked in CRM or viewing regarding information for an email that is tracked in CRM causes the Server to not respond. If you've run into this problem read on.

What is the Cassini Hoster Process? 
The Cassini Hoster process is a substitute for IIS on the CRM Outlook Laptop Client that handles all the Web page processing on the client.

Why does this happen? To keep the ASP.Net running, which improves performance, the Cassini Hoster Process sends heartbeat pings based on the time set in registry key CassiniPollingPeriod.

The ApplicationHost.CreateApplicationHost is used to create an application domain to host ASP.Net. Every time the Cassin Polling period (milliseconds) expires we re-issue a heartbeat ping to the homepage.aspx to keep the ASP.NET running. This heartbeat ping is issued using the BeginGetResponse asynchronously. The problem is, we do not call “EndGetResponse” for the response got from the Server in the Response callback function. This causes, Cassini Server thread to just be held up in a wait state waiting for the client to invoke “EndGetResponse”.

As time passes, the heartbeat pings are accumulated and can depending on the machine configuration and settings exhaust all the worker threads. The server uses up all the threads and reaches a state where it no longer has any more threads to process genuine client requests coming from the CRM Outlook Laptop client. The user can then experience a hang or maybe reduced performance.

Okay, how do I fix this? 
The hunt to identify the locking up of threads waiting on client’s invocation of “EndGetResponse” was the most difficult part of figuring this out. Once this was identified, the fix was very simple. This is where KB 938574 comes into picture and this hotfix resolves the problem by calling the EndGetResponse in the Response callback function.

You can download the fix to resolve the Cassini hang issue from the link below:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;938547

Thank and enjoy.

No comments: