2

I have web ASP.NET application deployed on IIS 8.5 in windows server 2012. Our web is developed to stored some data in RAM. The problem is IIS recycles the web application's pool every 30 mins or sometime 15 mins, etc. It causes the application works wrongly once all data in RAM cleared. I have unchecked all options in Recycling Conditions of the pool in IIS but nothing resolved. I hope somebody can help.

Thanks and regards,

Bruce Vo
  • 45
  • 1
  • 8
  • 2
    Try to enable logEventOnRecycle attribute in config to better understand why your app recycles every 30 minutes. http://www.iis.net/configreference/system.applicationhost/applicationpools/add/recycling – Fabrizio Accatino Mar 10 '15 at 09:01
  • 1
    You can **never** totally prevent recycling. You app **must** work correctly in the presence of recycling. Think of reboots, crashes, deployments, ... – usr Mar 10 '15 at 09:06
  • "the application works wrongly once all data in RAM cleared" - then the application is broken. As @usr says, you cannot *avoid* recycles entirely, so if the application has been built on that assumption, that's a bug. – Damien_The_Unbeliever Mar 10 '15 at 09:25
  • What is the nature of the data you're storing in RAM? In most circumstances storing that data somewhere else, such as a database or a cache, will insulate your app from problems when it recycles. If the data is related to the user's session, storing it externally to the web application will also help to allow you to scale the app - for example using load balancing. – Alan Low Mar 10 '15 at 09:30
  • 1
    I repeat Alan's question: What is the nature of the data you're storing in RAM? Depending on that, [Preserving ASP.NET Application State Across Restarts](http://stackoverflow.com/q/1279561/1115360) may be what you need. – Andrew Morton Mar 10 '15 at 18:34

1 Answers1

0

As a general practice, your application architecture should be able to handle a recycle, reboot, deployment, etc. However, if you need to keep the thing alive, as a stop-gap, you can set up a Windows Scheduled Task to hit any url on that app at the interval that you need.

Alex
  • 855
  • 7
  • 11