The request_terminate_timeout directive for FastCGI Process Manager (FPM) determines the maximum time a PHP script can run before the web server forcefully terminates it, regardless of whether the script has completed or not.

This is useful for preventing PHP scripts from running indefinitely, which can happen due to coding errors, infinite loops, or excessive processing times. By setting an appropriate request_terminate_timeout, you can prevent PHP processes from consuming excessive server resources and potentially affecting the overall performance and stability of the server.

To change the value of request_terminate_timeout:

  1. Create a file named fpm_custom.conf within the root directory of your repository and add the required value within it, for example (default unit is seconds):
  2. request_terminate_timeout = 120
  3. Push the changes to your Git repository.
  4. Within MyKinsta, select your Application > Processes > edit the Web process > update the Start command to include the fpm_custom.conf file, for example: heroku-php-apache2 -F fpm_custom.conf

Related Documentation