From 404d2d4c98f1df930be1ae9852fe6e6ae8c1517e Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Tue, 17 Sep 2019 23:55:07 -0400 Subject: [PATCH] =?UTF-8?q?reduce=20memory=20required=20for=20logmon,=20do?= =?UTF-8?q?cker=5Flogger=20and=20executor=20p=E2=80=A6=20(#6341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * reduce memory required for logmon, docker_logger and executor processes * comment early importing --- main.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 9637c774202f..cbf27e6d1965 100644 --- a/main.go +++ b/main.go @@ -9,8 +9,15 @@ import ( "strings" "text/tabwriter" + // These packages have init() funcs which check os.Args and drop directly + // into their command logic. This is because they are run as seperate + // processes along side of a task. By early importing them we can avoid + // additional code being imported and thus reserving memory + _ "github.com/hashicorp/nomad/client/logmon" + _ "github.com/hashicorp/nomad/drivers/docker/docklog" + _ "github.com/hashicorp/nomad/drivers/shared/executor" + "github.com/hashicorp/nomad/command" - "github.com/hashicorp/nomad/drivers/docker/docklog" "github.com/hashicorp/nomad/version" "github.com/mattn/go-colorable" "github.com/mitchellh/cli" @@ -38,7 +45,7 @@ var ( "server-join", "server-members", "syslog", - docklog.PluginName, + "docker_logger", } // aliases is the list of aliases we want users to be aware of. We hide