3

we are running nginx + php5-fpm and as part of our deployment process we use a symlink to point to the latest version of our PHP code. In order to avoid problems with changing files when deploying new versions, we use the following nginx-config, which uses $realpath_root to send the real file path to php-fpm:

location ~* ^/(app|app_dev|config)\.php(/|$) {
    fastcgi_pass php;
    fastcgi_split_path_info ^(.+\.php)(/.*)$;
    include fastcgi_params;
    fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
    fastcgi_param DOCUMENT_ROOT $realpath_root;
}

This setup worked well for the last year while we used AWS instances. Now we switched to Google Cloud and every time we deploy a new version, our servers response time increases by factor 2-3. After reloading PHP-fpm using kill -USR2 17 (where 17 is the process ID of the master process), response times recover to normal values.

Increased response time after deploy

Any suggestions how to solve this without restarting php-fpm worker processes after every release?

Best, Tobias

Tobias K.
  • 286
  • 1
  • 3
  • 11

0 Answers0