Samuel Loft
When using zero-downtime deployments a lot of issues can arise.
If using Horizon, if you terminate it in the deploy script it happens before the new code is live missing changes.
restarting PHP-FPM happens before the site goes live
These are two examples of things that should happen AFTER zero downtime has been completed.
So I suggest a "Post deploy" like the current deployment, but it runs after the deployment has finished.
Zero downtime is currently not useable without it (unless we manually restart things after each deployment)
René Sinnbeck
Could this perhaps be pointed out in the docs? I am sure a lot of people does not know this and it can lead to some bad problems as Samuel said (I have run into these myself before I knew I had to reload php-fpm manually)
René Sinnbeck
Any updates on this? Personally I feel this is quite a big problem that can lead to a lot of problems if people arent aware or forget to restart fpm after a deployment.
Samuel Loft
Item authorI have given up hope, zero downtime is disabled on most of our projects now as it is unusable in it's current state.
René Sinnbeck
This now all seems to be working for new sites. I don't even need to restart fpm anymore.
The nginx config has been changed
//before
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
//after
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
I am currently going over old sites, and making this change
Dennis
So basically pre, main and post deploy scripts have been added for a while now. Basically this should solve the problems you're experiencing.
Also note that reloading FPM isn't needed in these deploy scripts.
Nathan
Thanks Dennis.
Out of interest is restarting FPM handled sutomatically without having to manage this manually in a script already?
Dennis
You don't need to reload PHP FPM, if you do that, you'd still get 502 bad gateways for about a second and that would not be zero downtime deployment.
The reload isn't needed because the zero downtime feature creates a new folder based on time which tells opcache "these files are new" automatically, so no reload is needed.
Post deployment commands
-
Dennis moved item to board Live
1 week ago -
Dennis moved item to board Planned
2 years ago -
Samuel Loft moved item to project Server Level Requests
2 years ago -
Samuel Loft created the item
2 years ago