这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@cjoudrey
Copy link
Contributor

Fixes #693

The docs are based on #562 and @assaf's blog post.

Review

@josegonzalez @michaelshobbs
cc @travischoma

@josegonzalez
Copy link
Member

Actually, I think those docs are wrong. It seems as though we always wait at least 60 seconds before killing old containers. @michaelshobbs does that seem right ?

@josegonzalez
Copy link
Member

Ah sorry, I read your docs wrong :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I meant was false. We definitely wait at least 60 seconds - configurable - before killing old containers.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe my explanation wasn't clear. Although we keep the old container around, new traffic is sent to the new container right away.

This can lead to 502s if your app doesn't bind to the port right away, an easy way to repro this is using a setTimeout around the listen call in Heroku's sample node.js app.

Maybe this is an edge-case and not worth bringing up in the docs.

Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josegonzalez what are you saying is false?

The sentence regarding DOKKU_CHECKS_WAIT is true. We should also add a mention of DOKKU_WAIT_TO_RETIRE as that is was controls how long the old container has to fulfill in-flight requests before being killed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a short wait for the container to start, then the checks are run against it, before switching traffic. So if the new container is not able to handle request, traffic keeps flowing to the old one, new container gets destroyed.

The long timeout servers two purposes. First, some responses are just slow. Second long lasting connections (eg server sent events), helps to gradually migrate those over to new server.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@josegonzalez
Copy link
Member

Looks good other than my comment. Just remove that line and we should be good to merge :)

@michaelshobbs
Copy link
Member

Yup 60 is the default.

      WAIT="${DOKKU_WAIT_TO_RETIRE:-60}"

@cjoudrey
Copy link
Contributor Author

I removed the line about empty CHECKS file and added a line about DOKKU_WAIT_TO_RETIRE.


This got me testing DOKKU_WAIT_TO_RETIRE and it seems like it cannot be changed by app configs:

=== node-js-sample-app config vars ===
DOKKU_WAIT_TO_RETIRE: 30

Still waits 60 seconds:

-----> Creating non-ssl nginx.conf
-----> Running nginx-pre-reload
       Reloading nginx
-----> Shutting down old container in 60 seconds
-----> Deploy complete!

I'll open a separate issue for this.

josegonzalez added a commit that referenced this pull request Dec 24, 2014
@josegonzalez josegonzalez merged commit 92c18fa into dokku:master Dec 24, 2014
@cjoudrey cjoudrey deleted the checks-docs branch December 24, 2014 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hotswapping with dokku?

4 participants