Skip to main content

Posts

Showing posts from June, 2014

IIS 7 Rapid Fail Protection - 5 failures within 5 minutes

IIS 7 Rapid Fail Protection Thursday, January 12, 2012   by   Mat Agrest IIS 7 Rapid Fail Protection If you do not already know, Rapid Fail Protection is feature within IIS7 that is on by default.  It basically is there to check for a specified number of hard failures in a given time period, again the default is 5 failures within 5 minutes.  If a hard failure that occurs meets this default setting, then the Application Pool will crash and does  not   automatically restart.  The only way to get it going again is to manually start it.  If this does happen for you, in IIS Manager you would see a little stop symbol next to the name and it would also say stopped under Status (depicted below). When this sort of problem occurs an entry is written to the Event Logs (usually under System), which IIS 7 does a little better of a job properly reporting errors.  You will most likely also get a 503.2 - Service unavailable error when trying to access the Application Pool.  Personally I

IIS 7 Tip # 5 Run a command when Rapid Fail Protection is triggered

Rapid-Fail Protection disables application pools if they crash multiple times within in a specified time period. This prevents the failing application pool from getting into a continuous loop of crashing and restarting. This protects other application pools running on the server as repeated failures can consume lot of system resources. When rapid-fail protection kicks in it stops the application pool that is repeatedly crashing and your clients will start getting a 503 – Service Unavailable error. An administrator will have to manually enable the application pool again. You also have to option to configure an executable to run when ever rapid-fail protection is triggered. For example below I have configured the application pool to restart the IIS service using iisreset.exe … the /rebootonerror will reboot the whole server if iisreset.exe for some reason fails to restart the services. Refer http://blogs.msdn.com/b/vijaysk/archive/2009/03/13/iis-7-tip-5-run-a-command-when-rapid-f

What is a Crash (technically)... in ASP.NET - CRASH, HANG, HIGH CPU, HIGH MEMORY, DEADLOCK and OUT OF MEMORY

What is a Crash (technically)... in ASP.NET and what to do if it happens? Many times while troubleshooting performance related issues in ASP.NET/IIS we find that customers come in saying that the ASP.NET process crashes n number of times a day, two or more. Now, the question arises, that is it really a crash, or some Yellow color error message (or a plain "Page cannot be displayed" error) which is shown on the client's browser? Well, as they say, everything that glitters is not gold. On similar grounds, every error thrown on the browser is not a crash. We need to keep multiple things in mind depending on what exactly could have caused the error, and before we decide to call it a crash, we should know what *exactly* is a crash! In the forthcoming series under "Performance" category of my blog, I will discuss basics of CRASH, HANG, HIGH CPU, HIGH MEMORY, DEADLOCK and OUT OF MEMORY issues.

IIS Manager - applocation pool restart C# code

using System; using System.Collections.Generic; using System.Text; using System.DirectoryServices; namespace RecycleApplicationPool { class Program { static void Main( string [] args) { string appPoolName = "DefaultAppPool" ; string machineName = "LOCALHOST" ; if (args.Length > 0) appPoolName = args[0]; if (args.Length > 1) machineName = args[1]; string error = null ; DirectoryEntry root = null ; try { Console .WriteLine( "Restarting Application Pool " + appPoolName + " on " + machineName + "..." ); root = new DirectoryEntry ( "IIS://" + machineName + "/W3SVC/AppPools/" +appPoolName); Console .WriteLine(root.InvokeGet( "Name" )); root.Invoke( "Recycle" );

IIS : Virtual Memory

About Virtual Memory Virtual Memory is not the same as memory stored on disk in the page file. Virtual Memory is a concept of indirection introduced in memory addressing whereby application see a contiguous "virtual memory" address space, but the OS transparently fulfills that memory address space with EITHER physical memory (i.e. RAM) or something else like disk memory (i.e. pagefile). From the application's perspective, it is simply using "memory". However, the OS knows whether that "memory" is real physical memory or has to be swapped in from the pagefile on disk into real memory. It is this swapping operation which makes virtual memory that is in the page file slow. If you want more information on the subject, I suggest reading books like " Inside Windows 2000 " or " Microsoft Windows Internals " by Solomon and Russinovich, or classic books like " Computer Architectures: A Quantitative Approach ". I know that