Unified Service Desk Best Practices (Part 3) – Improve Internet Explorer process management


Background

With hosted controls running on IE Process hosting mode, under heavy load, Unified Service Desk might get slower and start showing “Max Browser” messages. Launching any other application under this may result in a blank page or an exception. At times, restarting Unified Service Desk may not help and you might have to restart the computer to resolve the issue.

Reviewing the the Task Manager will show numerous IE processes: few hanging on with few MBs of memory and few peeked with a GB or more. It would appear that the IE processes are not getting cleared/closed and are getting stacked up, causing depletion of system resources eventually causing a degradation in performance and resulting browser exceptions.

Few scenarios that you may have experienced –

Scenario 1:

Internet Explorer processes does not get cleaned up or terminated on closing Unified Service Desk application tabs and you might see the something similar to the below image in your Task Manager.

ie_taskmanager

Eventually Unified Service Desk may turn slow and even throw the “Max Browser” message as shown below.

max_browsers

Scenario 2:

At times, you only find few IE processes in the Task Manager, but some of these processes are piling up memory in GBs as shown below. It appears that IE stops load balancing and routes new requests to the same IE process thus bloating its memory and causing Unified Service Desk to get into an unstable state running in performance issues and throw similar “Max Browser” exceptions

ie_taskmanager2

 

Why does Unified Service Desk not clean IE processes?

Unified Service Desk leverages ShDocVw API of Internet Explorer to manage the child processes it creates. When a new hosted control is created and being navigated to, Unified Service Desk requests a new child/tab process to be created. Internet Explorer then uses its own process creation algorithm to decide if the new process should be a child/tab process or if the request should be overridden and create a new parent process. Unified Service Desk does not interfere in this decision making process.

When the hosted control is being closed within Unified Service Desk, it again leverages the APIs provided in ShDocVw to specify the exact window that Internet Explorer should terminate. Internet Explorer employs sophisticated algorithms to decide if the request should be immediately fulfilled or if it wants to delay that process in the anticipation of a new create request, in which case it will recycle that process. This is one of the many optimizations that Internet Explorer performs during the life cycle of all its processes.

When Internet Explorer decides to employ the optimizations mentioned above, Unified Service Desk might end up reusing the processes and termination of processes might get delayed.

The situation is amplified in Unified Service Desk vs. normal browsing experience due to the fact that Unified Service Desk requests for process creation and termination at a rapid pace due to session creation and destruction.

When Unified Service Desk is terminated, it instructs Internet Explorer to terminate all the processes created on its behalf. If at this stage, Internet Explorer parent is busy or hung, this call for termination gets lost and you end with zombie processes.

If the machine is not restarted before the next Unified Service Desk session, this situation gets amplified until Internet Explorer exhausts the system resources or its ability to spin up more tab processes resulting in the errors mentioned in the above scenarios.

What can we do to control these IE thresholds?

Although Internet Explorer does many optimizations, it also provides levers that educated users can control to redefine the thresholds. These levers are provided in the form of registry keys that need to be updated to provide the desired behavior, which in this case is to request Internet Explorer to avoid employing delay optimizations and to balance its load appropriately.

CAUTION: As with any registry change, take backups, read the below instructions very carefully ,and ensure to thoroughly test it in multiple environments before rolling it into production.

TabShutdownDelay

Registry Key: HKCU\Software\Microsoft\Internet Explorer\Main\TabShutdownDelay
Setting this DWORD value key to 0 (ZERO) will force Internet Explorer to terminate the tab processes to be destroyed as soon as Internet Explorer receives terminate request. The value is in milliseconds.  Please note that if you want any other value as in, 10 seconds, you need to put in 10000 as a decimal value.

registry1

 

Note: If all of the Internet Explorer windows are closed then all the iexplore.exe processes will exit immediately.

You can find more details here.

TabProcGrowth

Registry Key: HKCU\Software\Microsoft\Internet Explorer\Main\TabProcGrowth
This registry key controls the rate at which Internet Explorer creates new tab processes. Set this value based on the number of applications (IE hosted controls) Unified Service Desk is configured to launch per workflow. If the usage is high then setting this key to “large” will be helpful. Similarly if the number of IE hosted controls is low then  setting this key to “low” will suffice.

Note: If this value is set to a low value or zero, Internet Explorer stops creating child processes and will only use one process, which can degrade your experience.

You can find more details here.


Shoeb Bhaldar and Sid Gundavarapu contributed to this blog post.

Shoeb Bhaldar is a Software Engineer in the Dynamics CRM product group, working primarily on the Unified Service Desk product. He works on the core Unified Service Desk framework.

Sid Gundavarapu is the product owner for Unified Service Desk. He drives the strategy and roadmap of Unified Service Desk


Comments (3)

  1. Srikanth says:

    Nice post Jayme & team, Does it impact in anyway for my regular Non-USD users? are they going to loose any “features” that IE already giving them or any performance impacts ?

  2. USD Team says:

    These changes are IE specific, so all IE processes will be impacted.
    -Sid

  3. Bhautik says:

    I have noticed 1st scenario couple of time. we have deployed USD to 100sof agent’s computer that means to applying the change to registry may be big challenge for IT team. I was also thinking to keep some of the hosted control on WPF mode (Hosting type= WPF)

Skip to main content