From 0514a558d648956bfd6527f96dabf89a12e3bfce Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Tue, 17 Sep 2019 13:48:48 -0400 Subject: [PATCH 1/2] reduce memory required for logmon, docker_logger and executor processes --- main.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 9637c774202f..00e3e2fc1df8 100644 --- a/main.go +++ b/main.go @@ -9,8 +9,11 @@ import ( "strings" "text/tabwriter" + _ "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 +41,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 From 69b8e63a053cd635762d5381bc489b2c6774c4ca Mon Sep 17 00:00:00 2001 From: Nick Ethier Date: Tue, 17 Sep 2019 15:51:32 -0400 Subject: [PATCH 2/2] comment early importing --- main.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.go b/main.go index 00e3e2fc1df8..cbf27e6d1965 100644 --- a/main.go +++ b/main.go @@ -9,6 +9,10 @@ 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"