diff --git a/Makefile.common b/Makefile.common index 10854fc682e10edfda61008f443e0513c8c105b6..6e412cada2c26dec7a37ab4ec172e482827148a5 100644 --- a/Makefile.common +++ b/Makefile.common @@ -11,7 +11,6 @@ GOCOVERAGE_FILE := tests/coverage.out GOCOVERAGE_REPORT := tests/coverage-report GOTEST := OB_AGENT_CONFIG_PATH=$(PWD) $(GO) test -tags test -covermode=count -coverprofile=$(GOCOVERAGE_FILE) -p $(PROCESSOR) -GO_RACE_FLAG =-race LDFLAGS += -X "github.com/oceanbase/obagent/config.AgentVersion=${VERSION}" #LDFLAGS += -X "github.com/oceanbase/obagent/config.ReleaseVersion=$(shell git describe --tags --dirty --always)" LDFLAGS += -X "github.com/oceanbase/obagent/config.BuildTimestamp=$(shell date -u '+%Y-%m-%d %H:%M:%S')" diff --git a/cmd/monagent/main.go b/cmd/monagent/main.go index 9a078d4982fbb2d8e25bd63fa4798261121faac4..0f79d479fdb292ca07378387687de7b03a9ec897 100644 --- a/cmd/monagent/main.go +++ b/cmd/monagent/main.go @@ -17,6 +17,8 @@ import ( "os" "time" + "runtime/debug" + "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -48,6 +50,8 @@ var ( ) func init() { + debug.SetGCPercent(config.GCPercent) + // monagent server config file monagentCommand.PersistentFlags().StringP("config", "c", "conf/monagent.yaml", "config file") // plugins config use dir, all yaml files in the dir will be used as plugin config file diff --git a/config/config_common.go b/config/config_common.go index 9293660350e47f665393e698db28cb0558cefe72..6313ffda66727cb0f74d36899ced2831b899cb24 100644 --- a/config/config_common.go +++ b/config/config_common.go @@ -28,6 +28,7 @@ type Process = string const ( ProcessMonitorAgent Process = "monagent" + GCPercent int = 500 ) type InstallConfig struct {