FastCgiEnvironmentElement Class
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
FastCgiEnvironmentElement
Requirements
Type | Description |
---|---|
Client | - IIS 7.0 on Windows Vista - IIS 7.5 on Windows 7 - IIS 8.0 on Windows 8 - IIS 10.0 on Windows 10 |
Server | - IIS 7.0 on Windows Server 2008 - IIS 7.5 on Windows Server 2008 R2 - IIS 8.0 on Windows Server 2012 - IIS 8.5 on Windows Server 2012 R2 - IIS 10.0 on Windows Server 2016 |
Product | - IIS 7.0, IIS 7.5, IIS 8.0, IIS 8.5, IIS 10.0 |
MOF file | WebAdministration.mof |
See Also
CollectionElement Class
FastCgiApplicationElement Class
FastCgiEnvironmentSettings Class
FastCgiSection Class