Choosing a deployment strategy
Maestro supports two deployment strategies:
Deploying in serial involves removing each server from your load balancer, deploying to it, and re-adding it to the load balancer.
When you deploy in parallel, all the deployment tasks for the servers in your application will run in parallel as opposed to running in serial. In other words, the tasks will run against each server simultaneously instead of running on one server at a time. For large applications, this can have significant time benefits. When you deploy in parallel, your servers won’t be removed from the load balancer, because you could end up with no servers serving the load balancer if this were the case.
To run database migrations during deployment, it is advisable to deploy in serial.
Although database migrations only occur on one server, depending on the changes, they could stop deployments on other servers from succeeding. Refer to our page on controlling your database migrations for more information.
Configure parallel deployment
To activate parallel deployments, access your Application settings via Toolbelt and set
$ cx settings set -s my_app_name deploy.parallel true
Once set, any future deployments will be done in parallel. Should you wish to do a one-off deployment in serial, you can do so by clicking Deploy -> Deploy with options and selecting Deploy in serial. Similarly, if you have your application set to deploy in serial, you can perform a one-off deploying in parallel through this menu.
Coping with load balancer configuration lag
Load balancers - particularly native cloud load balancers - can be prone to configuration lags. In other words, they can sometimes report that they have removed a server whereas, in reality, some traffic is still being routed to that server for a few seconds or minutes.
This can also work in the opposite direction - the load balancer may report that it has added a server but it does not actually begin routing traffic to a server for a short period.
For many lag-tolerant applications this short delay does not matter, but some applications are more sensitive and can suffer adverse affects from this configuration lag.
If your application is “lag-sensitive” we recommend adding short delays to your load balancer configurations. You can do this using the
wait_after_removing_servers options under the load balancers section of your application’s manifest file.
Bear in mind that adding these delays can slow down the deployment process significantly. For serial deployments the additional delay will be:
(wait time per server)x(number of servers) = (extra deployment time).
If you use this option in your manifest, subsequent deployments will use the value set. To remove this delay, set the value to 0 in your manifest, and then redeploy. Simply deleting this value from your manifest will not result in removing the setting once it has been applied.