Dynamics 365 CE - IIS Application Pool Recycling

If you didn't change the configuration of IIS / CRM App Pool, it's very probable it is configured to execute in a regular time interval of 1,740 minutes (29 hours) - default IIS App Pool set. Let's suppose your recycle ran for the last time at 5 AM, that seems to be ok and outside business hours. But in this scenario the recycling will occur again at 10 AM next day, during business hours and the users can experience errors due the recycle because their session states will be lost.

In this case it will be better to set the recycling to occur at specific time(s) outside business hours according your organization rules. It is important specially if your applications need to store session states. And, if you are thinking about disable IIS App Pool recycling, don't do it: Worker process isolation mode offers process recycling, in which IIS automatically refreshes Web applications by restarting their worker processes. Process recycling keeps problematic applications running smoothly, and is an especially effective solution in cases where it is not possible to modify the application code.

It applies to any app pool, not only Dynamics 365-related.

Considerations When Recycling Applications

When applications are recycled, it is possible for session state to be lost. During an overlapped recycle, the occurrence of multi-instancing is also a possibility.

Loss of session state: Many IIS applications depend on the ability to store state. IIS can cause state to be lost if it automatically shuts down a worker process that has timed out due to idle processing, or if it restarts a worker process during recycling.

Occurrence of multi-instancing: In multi-instancing, two or more instances of a process run simultaneously. Depending on how the application pool is configured, it is possible for multiple instances of a worker process to run, each possibly loading and running the same application code. The occurrence of an overlapped recycle is an example of multi-instancing, as is a Web garden in which two or more processes serve the application pool regardless of the recycling settings.

If your application cannot run in a multi-instance environment, you must configure only one worker process for an application pool (which is the default value), and disable the overlapped recycling feature if application pool recycling is being used.

More information about IIS Process Recycling can be found here.


Senior Customer Engineer - Dynamics 365 - Microsoft - Brazil