From 1a1250e5ea62ca95f1f05f21235a2df27f5c897b Mon Sep 17 00:00:00 2001 From: Reed Allman Date: Tue, 13 Feb 2018 17:45:11 -0800 Subject: [PATCH] disable fail whale logs (#768) we have been getting these from attach all this time and never needed these anyway. I ran cpu profiles of dockerd and this was 90% of docker cpu usage (json logs). woot. this will reduce i/o quite a bit, and we don't have to worry about them taking up any disk space either. from tests i get about 50% speedup with these off. the hunt continues... --- api/agent/drivers/docker/docker.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/api/agent/drivers/docker/docker.go b/api/agent/drivers/docker/docker.go index 677cfcbf7..b5ebe0da6 100644 --- a/api/agent/drivers/docker/docker.go +++ b/api/agent/drivers/docker/docker.go @@ -150,10 +150,7 @@ func (drv *DockerDriver) Prepare(ctx context.Context, task drivers.ContainerTask // turn off logs since we're collecting them from attach HostConfig: &docker.HostConfig{ LogConfig: docker.LogConfig{ - Type: "json-file", // o/w attach does not work - Config: map[string]string{ - "max-size": "1m", - }, + Type: "none", }, }, Context: ctx, @@ -351,7 +348,7 @@ func (drv *DockerDriver) run(ctx context.Context, container string, task drivers waiter, err := drv.docker.AttachToContainerNonBlocking(ctx, docker.AttachToContainerOptions{ Container: container, OutputStream: mwOut, ErrorStream: mwErr, - Stream: true, Logs: true, Stdout: true, Stderr: true, + Stream: true, Stdout: true, Stderr: true, Stdin: true, InputStream: task.Input()}) if err != nil && ctx.Err() == nil { // ignore if ctx has errored, rewrite status lay below