My website recently experienced an issue where one of the servers was throwing some random error. On investigating, I found the below message in the information of event viewer of that server.
IIS, by default, sets application pool to recycle after an interval of 29 hours ( 1740 minutes ). This can cause issues when using in-memory sessions.
Resolution
To resolve this issue, either remove the automatic recycle or change it to a specific time such as 12 AM, depending on your requirement.
- Open IIS.
- Go to Application Pool and select the required application pool. Then, click on Recycling on the right sidebar.
- Select your required setting and save.
-------------------------------------------------------------------------------------------------------------------------------------------------------
Important point to note is that Website sessions should be designed to not be dependent on IIS restarts or IIS app pool recycles.
--------------------------------------------------------------------------------------------------------------------------------------------------------
More Information - https://technet.microsoft.com/en-us/library/cc735298(v=ws.10).aspx