Filed in: Diagnostics Tags: Diagnostics Recycle Restart
How-To: Use Recycle diagnostics to measure and optimize application restarts
LeanSentry's Recycle diagnostics help you track and optimize the impact of application pool recycling and application restarts in your environment.
Applications on the Microsoft web platform are stateful - they maintain state between requests in order to provide functionality (session state) and improve performance (output cache, application caches, etc). As a result, when an application restarts, it's functionality and performance can be affected in a number of ways:
- Application startup can block incoming requests until initialization is complete.
- The contents of in-memory output cache, and custom application caches are lost, and must be rebuilt. This can cause poor performance until the caches are filled up.
- In some applications, in-memory session state and other in-memory state may be lost resulting in logouts and lost user sessions.
TIP: Use LeanSentry's Recycle diagnostics to get specific recommendations for optimizing recycling and application restarts.
Recycling can and does happen (sometimes very often)
Recycling is a reality for all applications. Here are just some of the reasons that cause applications to restart:
- Application pool(s) recycle. The worker process hosting your applications can recycle due to a configuration change, time limit, idle timeout, excessive memory usage, and many other reasons.
- Application restart(s). This can happen due to configuration changes, publishing changes to key application directories, idle timeout, and so on.
Measuring the overhead of recycling
LeanSentry automatically tracks the overhead due to application restarts and application pool recycles.
We automatically determine when your application(s) start up, and measure the number of requests blocked in application startup/how long they were delayed.
Second, we determine the relative change in application performance and error rates AFTER a recycle/restart takes place, so we can measure the "intangible" impact that a recycle has on your application's performance.
Email insights: We'll automatically notify you whenever a website experiences poor performance as a result of recycling.
Identifying recycling problems
LeanSentry's automatic insights will notify you whenever we detect a recycling problem, or an opportunity to improve recycling in your environment.
- Inefficient recycling: recycling or restarting during periods of high activity.
- Excessive, or increasing recycles: an unexpected spike in recycles/application restarts, or restarting more often than recommended.
- Unexpected, or avoidable recycling: whenever we detect specific types of recycling/restarting that should be avoided, or can be reduced.
Each email will identify the specific causes of recycling, and provide specific details associated with that cause. For example, we'll tell you:
- What the current recycling schedule is for scheduled recycles.
- What the memory limits were for private memory limit recycles.
- The initialization error causing application shutdowns.
- and so forth.
We'll continuously monitor changes in your recycling/restart, and the impact they have on performance, so we can notify you whenever there is a problem. Simply continue to follow the recommendations in the insight email(s) to optimize your recycling strategy.
Have a question or feedback on CPU diagnostics? Email us at firstname.lastname@example.org.
Want to learn the best techniques for managing your IIS web server? Join our how-to newsletter.
Want to get the best tool for troubleshooting and tuning your web apps? Try LeanSentry free for 14 days.