This article is a mirror article of machine translation, please click here to jump to the original article.

View: 12623|Reply: 0

[Web] IIS 7 Application Pool Automatic Recycling Solution for Shutdown

[Copy link]
Posted on 6/16/2017 10:51:12 AM | | |

If you're doing ASP.NET, you'll definitely use IIS

If you want to add a scheduled task to your ASP.net application, you must use a thread to do the scheduled calculations non-stop

Then let's say we add Quartz.NET framework to our ASP.Net application, and the configuration and so on are OK.

This site has very few visits, and now only a few people use it when they are at work, but the next day I came over and saw that the threads and calculation tasks of the background scheduling were stopped, and if you grab Application_End event, you will find that this event was actually called.


Then there must be something wrong with IIS's application pool recycling mechanism. Because the default setting of IIS is that if the application pool of a site is not accessed or requested for a period of time, IIS will automatically reclaim the program pool and kill the process. The threads in that process will definitely not survive.


However, we can set the application pool parameters so that they are not simply automatically recycled (some situations are unavoidable, such as hot-deployed sites, excessive number of errors, etc.)


Find the program pool used by this site in IIS and click "Advanced settings..."

Change the following settings in the list that opens:

Recovery - Fixed time interval (minutes) changed to 0

        - Virtual/dedicated memory limit (KB) changed to 0

Process model - Idle timeout (minutes) is changed to 0


In this way, the program pool will not be automatically recycled, and some simple computing threads in the background will work normally




Previous:AutoMapper Conversion Tutorial Between Objects [Source Code]
Next:.NET MySQL database connection string
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com