Question

Comment puis-je empêcher un site ASP.Net d'être déchargé par IIS?

J'ai ce qui est peut-être le site Web le plus stupide du monde - une fois par heure, il se réveille et écrit un horodatage dans un fichier journal.Lorsque l'application démarre, elle le dit avec un horodatage dans le journal, et lorsqu'elle meurt, c'est la même chose.

Dans IIS, je suis allé dans son pool d'applications et j'ai défini le délai d'inactivité sur 0 et défini Générer l'entrée du journal des événements de recyclage> Intervalle de temps normal sur False.

Pourtant, le site se décharge toujours environ une fois par jour - je reçois l'entrée App Unloading ... dans le journal et il reste mort jusqu'à ce que je le visite la prochaine fois.

Comment puis-je l'empêcher de se décharger?

(Évidemment, ce site fera plus une fois que j'aurai résolu ce problème - pour l'instant, il est aussi simple que possible d'isoler le problème.)

Était-ce utile?

La solution

The application pool has another property that causes it to be automatically recycled every N minutes (defaults to 1740, or every 29 hours.) Make this zero to disable recycling. The property is (on IIS7) under the "Recycling" heading and is called "Regular Time Interval (minutes)"

Autres conseils

In addition to @jlew's recommendation, the guidance in this article is important if you're running a background task/timer continuously/periodically in ASP.Net without the install/configuration/maintenance burden of Windows Services and Scheduled Tasks:

http://haacked.com/archive/2011/10/16/the-dangers-of-implementing-recurring-background-tasks-in-asp-net.aspx

It includes a useful helper library, WebBackgrounder, which abstracts the advice in the article to handle graceful shutdown and some of the typical wants/needs of a background task.

It does not configure IIS for you - you'll need to modify the recycling settings yourself.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top