Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sequential restart when using docker-compose up with scale #5124

Closed
corradio opened this issue Aug 22, 2017 · 7 comments
Closed

Sequential restart when using docker-compose up with scale #5124

corradio opened this issue Aug 22, 2017 · 7 comments

Comments

@corradio
Copy link

Hello,

It seems to me that when scale is > 1, and a new image is being pulled, using docker-compose up restarts all containers in parallel rather than sequentially.
Doing a cascading restart would ensure zero downtime.

Am I correct in my analysis?

Thank you,

Olivier

@shin-
Copy link

shin- commented Aug 22, 2017

Both are valid strategies depending on your use-case, but you're right that we don't currently offer an automated way to do zero-downtime deployments. In the meantime, you may want to take a look at #1786 (comment) which outlines how to do so manually.

@corradio
Copy link
Author

Hi @shin- ,
Unfortunately your method won't work as I have more than 1 container in production.
With previous versions of docker/docker-compose, it seems like containers were restarted sequentially. Did anything change?
It would be nice to be able to control the start strategy in docker-compose (sequential vs parallel)

@shin-
Copy link

shin- commented Aug 24, 2017

With previous versions of docker/docker-compose, it seems like containers were restarted sequentially. Did anything change?

Unless you're looking at versions from 2 years ago, that wasn't the case.

@corradio
Copy link
Author

I was indeed working with a very old version (due to CI constraints).
Any idea if it's possible to add the feature I'm requesting? I'm up for contributing if needed.

@domq
Copy link

domq commented Nov 15, 2019

Replying to the original question, it is still not possible to do sequential restarts. However, you can prevent docker-compose up --scale from restarting existing containers using the --no-recreate flag. This is enough to do zero-downtime restarts if you use only run one serving instance (by momentarily scaling to two, then deleting the oldest container).

@stale
Copy link

stale bot commented Apr 17, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 17, 2022
@stale
Copy link

stale bot commented Apr 25, 2022

This issue has been automatically closed because it had not recent activity during the stale period.

@stale stale bot closed this as completed Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants