We reload php5-fpm to guarantee that it and Nginx are pointing to the newest/correct “release path”. Since our deployment system works on symlinks, php-fpm seems to have resolve the symlink and caches the result for a period of time. So we reload php-fpm to force it to resolve the symlink path again to ensure it’s correct.
Example:
before deploy: /srv/www/example.com/current -> /srv/www/example.com/releases/201505221035
next deploy: /srv/www/example.com/current -> /srv/www/example.com/releases/2015052410543
Without the reload php-fpm might still be using code /srv/www/example.com/releases/201505221035 for a short period of time instead of the new one.
If you don’t want it, or want to customize the command, you can just override the project_post_finalize_commands variable
I use PHP 5.4. How can I find out if symlinks are cached? I found directive about realpath_cache_size and realpath_cache_ttl in the .ini. Is that realpath resolving symlink?