Traefik docker - requestAcceptGraceTimeout
Has anyone had any experience using the ping endpoint and setting the requestAcceptGraceTimeout value? I have this in my toml:
[lifeCycle]
requestAcceptGraceTimeout = "30s"
However, when I instruct traefik to shutdown it only serves 503's for what appears to be around the default period of time (10s):
$ time docker stop traefik
traefik
real    0m12.416s
I’ve tried setting the value in many different ways 30, 30s, 60s, 1m, 1h but the period of time is always around the 10-12 seconds mark.
Has anyone successfully managed to set requestAcceptGraceTimeout and have have Traefik honour the value, please?
docker traefik
add a comment |
Has anyone had any experience using the ping endpoint and setting the requestAcceptGraceTimeout value? I have this in my toml:
[lifeCycle]
requestAcceptGraceTimeout = "30s"
However, when I instruct traefik to shutdown it only serves 503's for what appears to be around the default period of time (10s):
$ time docker stop traefik
traefik
real    0m12.416s
I’ve tried setting the value in many different ways 30, 30s, 60s, 1m, 1h but the period of time is always around the 10-12 seconds mark.
Has anyone successfully managed to set requestAcceptGraceTimeout and have have Traefik honour the value, please?
docker traefik
add a comment |
Has anyone had any experience using the ping endpoint and setting the requestAcceptGraceTimeout value? I have this in my toml:
[lifeCycle]
requestAcceptGraceTimeout = "30s"
However, when I instruct traefik to shutdown it only serves 503's for what appears to be around the default period of time (10s):
$ time docker stop traefik
traefik
real    0m12.416s
I’ve tried setting the value in many different ways 30, 30s, 60s, 1m, 1h but the period of time is always around the 10-12 seconds mark.
Has anyone successfully managed to set requestAcceptGraceTimeout and have have Traefik honour the value, please?
docker traefik
Has anyone had any experience using the ping endpoint and setting the requestAcceptGraceTimeout value? I have this in my toml:
[lifeCycle]
requestAcceptGraceTimeout = "30s"
However, when I instruct traefik to shutdown it only serves 503's for what appears to be around the default period of time (10s):
$ time docker stop traefik
traefik
real    0m12.416s
I’ve tried setting the value in many different ways 30, 30s, 60s, 1m, 1h but the period of time is always around the 10-12 seconds mark.
Has anyone successfully managed to set requestAcceptGraceTimeout and have have Traefik honour the value, please?
docker traefik
docker traefik
edited Nov 23 '18 at 12:15
Siyu
2,5141724
2,5141724
asked Nov 23 '18 at 8:46
mtt_gmtt_g
508
508
add a comment |
add a comment |
                                1 Answer
                            1
                        
active
oldest
votes
What you see is the default timeout for docker stop which is 10s. Ref: https://docs.docker.com/engine/reference/commandline/stop/
One way to test your requestAcceptGraceTimeout is to run traefik attached 
docker run -v /traefik.toml:/etc/traefik/traefik.toml -v /var/run/docker.sock:/var/run/docker.sock --name tt -i traefik --debug, and then ctrl+c, you can see in the log something like, (I also have a 2s graceTimeOut)
time="2018-11-23T10:01:38Z" level=info msg="Waiting 30s for incoming requests to cease"
time="2018-11-23T10:01:53Z" level=info msg="Stopping server gracefully"
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint traefik..."
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint https..."
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint http..."
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint https closed"
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint http closed"
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint traefik closed"
time="2018-11-23T10:01:53Z" level=info msg="Server stopped"
time="2018-11-23T10:01:53Z" level=info msg="Shutting down"
So for the actual configuration, if you use docker run to launch traefik, then use docker stop -t to stop it, or if you use service inside a compose or stack, add stop_grace_period: 30s to the service.
`
PS The default value for requestAcceptGraceTimeout is 0s.
Hi @Siyu. If I understand correctly, therequestAcceptGraceTimeoutisn't honoured if you execute adocker stopcommand against the Traefik container?
– mtt_g
Nov 23 '18 at 10:52
It is honoured but docker killed it before it handles the stop signal. If you usedocker stop -t {time} traefikit works. ({time}>requestAcceptGraceTimeout+graceTimeOut)
– Siyu
Nov 23 '18 at 10:56
updated my answer, I don't know what I was writing :)
– Siyu
Nov 23 '18 at 10:59
Hi @Siyu, thanks for the answer and updates, all makes sense now :)
– mtt_g
Nov 23 '18 at 11:02
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53443263%2ftraefik-docker-requestacceptgracetimeout%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
                                1 Answer
                            1
                        
active
oldest
votes
                                1 Answer
                            1
                        
active
oldest
votes
active
oldest
votes
active
oldest
votes
What you see is the default timeout for docker stop which is 10s. Ref: https://docs.docker.com/engine/reference/commandline/stop/
One way to test your requestAcceptGraceTimeout is to run traefik attached 
docker run -v /traefik.toml:/etc/traefik/traefik.toml -v /var/run/docker.sock:/var/run/docker.sock --name tt -i traefik --debug, and then ctrl+c, you can see in the log something like, (I also have a 2s graceTimeOut)
time="2018-11-23T10:01:38Z" level=info msg="Waiting 30s for incoming requests to cease"
time="2018-11-23T10:01:53Z" level=info msg="Stopping server gracefully"
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint traefik..."
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint https..."
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint http..."
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint https closed"
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint http closed"
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint traefik closed"
time="2018-11-23T10:01:53Z" level=info msg="Server stopped"
time="2018-11-23T10:01:53Z" level=info msg="Shutting down"
So for the actual configuration, if you use docker run to launch traefik, then use docker stop -t to stop it, or if you use service inside a compose or stack, add stop_grace_period: 30s to the service.
`
PS The default value for requestAcceptGraceTimeout is 0s.
Hi @Siyu. If I understand correctly, therequestAcceptGraceTimeoutisn't honoured if you execute adocker stopcommand against the Traefik container?
– mtt_g
Nov 23 '18 at 10:52
It is honoured but docker killed it before it handles the stop signal. If you usedocker stop -t {time} traefikit works. ({time}>requestAcceptGraceTimeout+graceTimeOut)
– Siyu
Nov 23 '18 at 10:56
updated my answer, I don't know what I was writing :)
– Siyu
Nov 23 '18 at 10:59
Hi @Siyu, thanks for the answer and updates, all makes sense now :)
– mtt_g
Nov 23 '18 at 11:02
add a comment |
What you see is the default timeout for docker stop which is 10s. Ref: https://docs.docker.com/engine/reference/commandline/stop/
One way to test your requestAcceptGraceTimeout is to run traefik attached 
docker run -v /traefik.toml:/etc/traefik/traefik.toml -v /var/run/docker.sock:/var/run/docker.sock --name tt -i traefik --debug, and then ctrl+c, you can see in the log something like, (I also have a 2s graceTimeOut)
time="2018-11-23T10:01:38Z" level=info msg="Waiting 30s for incoming requests to cease"
time="2018-11-23T10:01:53Z" level=info msg="Stopping server gracefully"
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint traefik..."
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint https..."
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint http..."
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint https closed"
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint http closed"
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint traefik closed"
time="2018-11-23T10:01:53Z" level=info msg="Server stopped"
time="2018-11-23T10:01:53Z" level=info msg="Shutting down"
So for the actual configuration, if you use docker run to launch traefik, then use docker stop -t to stop it, or if you use service inside a compose or stack, add stop_grace_period: 30s to the service.
`
PS The default value for requestAcceptGraceTimeout is 0s.
Hi @Siyu. If I understand correctly, therequestAcceptGraceTimeoutisn't honoured if you execute adocker stopcommand against the Traefik container?
– mtt_g
Nov 23 '18 at 10:52
It is honoured but docker killed it before it handles the stop signal. If you usedocker stop -t {time} traefikit works. ({time}>requestAcceptGraceTimeout+graceTimeOut)
– Siyu
Nov 23 '18 at 10:56
updated my answer, I don't know what I was writing :)
– Siyu
Nov 23 '18 at 10:59
Hi @Siyu, thanks for the answer and updates, all makes sense now :)
– mtt_g
Nov 23 '18 at 11:02
add a comment |
What you see is the default timeout for docker stop which is 10s. Ref: https://docs.docker.com/engine/reference/commandline/stop/
One way to test your requestAcceptGraceTimeout is to run traefik attached 
docker run -v /traefik.toml:/etc/traefik/traefik.toml -v /var/run/docker.sock:/var/run/docker.sock --name tt -i traefik --debug, and then ctrl+c, you can see in the log something like, (I also have a 2s graceTimeOut)
time="2018-11-23T10:01:38Z" level=info msg="Waiting 30s for incoming requests to cease"
time="2018-11-23T10:01:53Z" level=info msg="Stopping server gracefully"
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint traefik..."
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint https..."
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint http..."
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint https closed"
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint http closed"
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint traefik closed"
time="2018-11-23T10:01:53Z" level=info msg="Server stopped"
time="2018-11-23T10:01:53Z" level=info msg="Shutting down"
So for the actual configuration, if you use docker run to launch traefik, then use docker stop -t to stop it, or if you use service inside a compose or stack, add stop_grace_period: 30s to the service.
`
PS The default value for requestAcceptGraceTimeout is 0s.
What you see is the default timeout for docker stop which is 10s. Ref: https://docs.docker.com/engine/reference/commandline/stop/
One way to test your requestAcceptGraceTimeout is to run traefik attached 
docker run -v /traefik.toml:/etc/traefik/traefik.toml -v /var/run/docker.sock:/var/run/docker.sock --name tt -i traefik --debug, and then ctrl+c, you can see in the log something like, (I also have a 2s graceTimeOut)
time="2018-11-23T10:01:38Z" level=info msg="Waiting 30s for incoming requests to cease"
time="2018-11-23T10:01:53Z" level=info msg="Stopping server gracefully"
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint traefik..."
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint https..."
time="2018-11-23T10:01:53Z" level=debug msg="Waiting 2s seconds before killing connections on entrypoint http..."
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint https closed"
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint http closed"
time="2018-11-23T10:01:53Z" level=debug msg="Entrypoint traefik closed"
time="2018-11-23T10:01:53Z" level=info msg="Server stopped"
time="2018-11-23T10:01:53Z" level=info msg="Shutting down"
So for the actual configuration, if you use docker run to launch traefik, then use docker stop -t to stop it, or if you use service inside a compose or stack, add stop_grace_period: 30s to the service.
`
PS The default value for requestAcceptGraceTimeout is 0s.
edited Nov 23 '18 at 10:58
answered Nov 23 '18 at 10:10
SiyuSiyu
2,5141724
2,5141724
Hi @Siyu. If I understand correctly, therequestAcceptGraceTimeoutisn't honoured if you execute adocker stopcommand against the Traefik container?
– mtt_g
Nov 23 '18 at 10:52
It is honoured but docker killed it before it handles the stop signal. If you usedocker stop -t {time} traefikit works. ({time}>requestAcceptGraceTimeout+graceTimeOut)
– Siyu
Nov 23 '18 at 10:56
updated my answer, I don't know what I was writing :)
– Siyu
Nov 23 '18 at 10:59
Hi @Siyu, thanks for the answer and updates, all makes sense now :)
– mtt_g
Nov 23 '18 at 11:02
add a comment |
Hi @Siyu. If I understand correctly, therequestAcceptGraceTimeoutisn't honoured if you execute adocker stopcommand against the Traefik container?
– mtt_g
Nov 23 '18 at 10:52
It is honoured but docker killed it before it handles the stop signal. If you usedocker stop -t {time} traefikit works. ({time}>requestAcceptGraceTimeout+graceTimeOut)
– Siyu
Nov 23 '18 at 10:56
updated my answer, I don't know what I was writing :)
– Siyu
Nov 23 '18 at 10:59
Hi @Siyu, thanks for the answer and updates, all makes sense now :)
– mtt_g
Nov 23 '18 at 11:02
Hi @Siyu. If I understand correctly, the
requestAcceptGraceTimeout isn't honoured if you execute a docker stop command against the Traefik container?– mtt_g
Nov 23 '18 at 10:52
Hi @Siyu. If I understand correctly, the
requestAcceptGraceTimeout isn't honoured if you execute a docker stop command against the Traefik container?– mtt_g
Nov 23 '18 at 10:52
It is honoured but docker killed it before it handles the stop signal. If you use
docker stop -t {time} traefik it works. ({time}>requestAcceptGraceTimeout+graceTimeOut)– Siyu
Nov 23 '18 at 10:56
It is honoured but docker killed it before it handles the stop signal. If you use
docker stop -t {time} traefik it works. ({time}>requestAcceptGraceTimeout+graceTimeOut)– Siyu
Nov 23 '18 at 10:56
updated my answer, I don't know what I was writing :)
– Siyu
Nov 23 '18 at 10:59
updated my answer, I don't know what I was writing :)
– Siyu
Nov 23 '18 at 10:59
Hi @Siyu, thanks for the answer and updates, all makes sense now :)
– mtt_g
Nov 23 '18 at 11:02
Hi @Siyu, thanks for the answer and updates, all makes sense now :)
– mtt_g
Nov 23 '18 at 11:02
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
 
But avoid …
- Asking for help, clarification, or responding to other answers.
 - Making statements based on opinion; back them up with references or personal experience.
 
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
 
But avoid …
- Asking for help, clarification, or responding to other answers.
 - Making statements based on opinion; back them up with references or personal experience.
 
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53443263%2ftraefik-docker-requestacceptgracetimeout%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown