FastCGI Rapid Failure Protection

FastCGI Rapid Failure Protection

There are a lot of similarities between FastCGI's Rapid Failure Protection feature and w3svc/WAS', read here for more information.

FastCGIs performance (vs CGI) is derived from amortizing process creation and startup costs across multiple requests. When a process exits unexpectedly during a FastCGI request, FastCGI needs to spawn another one (expensive). When a process AVs (Access Violation), Windows Error Reporting generates a summary log of the issue (expensive).

It is not uncommon for a request that fails once to fail every time. If every time a request is made the expensive process creation, process startup and Windows Error Reporting must run, then the failing request is consuming relatively massive amounts of machine resources. (vs a successful request). Meaning most of the machine's resources are going towards doing something that will have no value.

FastCGI remembers whenever a process exits unexpectedly or misbehaves. If too many of these events occur in too short a period Rapid Failure Protection is enabled. When enabled, all requests to the fastCgi/application will result in HTTP 500s, with the error message: "The FastCGI process has failed frequently recently. Try the request again in a while". After a short period (less than 1 minute), Rapid Failure Protection will be disabled and process creation will start again. If failures start to happen again, then Rapid Failure Protection kicks in again.

No Comments