fastcgi_limit_rate
The 'fastcgi_limit_rate' directive limits the rate at which NGINX sends data to FastCGI servers.
Description
The 'fastcgi_limit_rate' directive is used to control the bandwidth that is allocated to FastCGI responses, providing a way to impose limits on the rate of data being sent from NGINX to the FastCGI backend. This can help manage server load and optimize resource allocation in scenarios where specific FastCGI applications might generate excessive traffic, particularly during periods of high demand. When this directive is set, it specifies the maximum number of bytes per second that can be sent to the FastCGI server. If this rate is exceeded, NGINX will temporarily pause sending headers and will only resume once the data rate falls below the specified threshold.
It is important to note that 'fastcgi_limit_rate' accepts a single argument which is typically specified in bytes per second and can also utilize suffixes such as 'k' for kilobytes or 'm' for megabytes, allowing for more accessible configuration of bandwidth limits. The directive can be placed within the 'http', 'server', or 'location' context, providing flexibility to apply different limits based on the scope of your application or site structure. Administrators can fine-tune how much bandwidth is allocated to FastCGI handling, enabling better performance management under varying conditions.
Config Example
location /fastcgi {
fastcgi_pass 127.0.0.1:9000;
fastcgi_limit_rate 100k;
}Ensure that 'fastcgi_limit_rate' is set within the appropriate context; if used incorrectly, it might not take effect as intended.
Be mindful of the value set to avoid unintentionally starving FastCGI backend processes.