Share via


FastCgiEnvironmentElement Class [IIS 7 and higher]

Configures environment variables for the process executable program of an application pool.

Syntax

class FastCgiEnvironmentElement : CollectionElement

Methods

This class contains no methods.

Properties

The following table lists the properties exposed by the FastCgiEnvironmentElement class.

Name

Description

Name

A read/write string value that specifies the name of an environment variable. The key property.

Value

A read/write string that specifies a value for the Name property.

Subclasses

This class contains no subclasses.

Remarks

Instances of this class are contained in the EnvironmentVariables array property of the FastCgiEnvironmentSettings class.

You can use this class to control PHP process recycling behavior by specifying the PHP_FCGI_MAX_REQUESTS environment variable for the Name property and a value for the Value property.

The FastCGI process recycling behavior is controlled by the InstanceMaxRequests configuration property of the FastCgiApplicationElement class. The InstanceMaxRequests property specifies the maximum number of requests that a FastCGI process will handle before it recycles. Similarly, in PHP, the value of the PHP_FCGI_MAX_REQUESTS environment variable controls process recycling.

You can fine-tune the stability and performance of Web applications by configuring these properties. Shorter recycling periods can improve Web application stability, whereas longer recycling periods can improve Web application performance. If you use longer recycling periods, then fewer CPU cycles will be spent on starting and stopping php-cgi.exe processes. This improves performance, but at the risk of stability.

By setting InstanceMaxRequests to a value that is smaller or equal to that of PHP_FCGI_MAX_REQUESTS, you can ensure that the native PHP process recycling logic will never be activated. If you do not set these parameters, the default settings will be used.

Note

The default setting for InstanceMaxRequests is 200; the default setting on most PHP builds for PHP_FCGI_MAX_REQUESTS is 500. Although the default values are sufficient for development scenarios on a stand-alone computer, you should fine-tune these settings when you deploy FastCGI and PHP in a shared hosting environment.

Inheritance Hierarchy

CollectionElement

   FastCgiEnvironmentElement

Requirements

Type

Description

Client

Requires IIS 7 on Windows Vista.

Server

Requires IIS 7 on Windows Server 2008.

Product

IIS 7

MOF file

WebAdministration.mof

See Also

Reference

CollectionElement Class [IIS 7 and higher]

FastCgiApplicationElement Class [IIS 7 and higher]

FastCgiEnvironmentSettings Class [IIS 7 and higher]

FastCgiSection Class [IIS 7 and higher]