From 004babd8c911e1987098da570c2eee11ad1e15ca Mon Sep 17 00:00:00 2001 From: David Castillo Date: Mon, 24 May 2021 11:24:36 -0500 Subject: [PATCH] rpk tune: Print warning when all tuners are disabled --- src/go/rpk/pkg/cli/cmd/redpanda/tune.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/go/rpk/pkg/cli/cmd/redpanda/tune.go b/src/go/rpk/pkg/cli/cmd/redpanda/tune.go index 9f6cd5fb9fd3..b63c1bf65dbc 100644 --- a/src/go/rpk/pkg/cli/cmd/redpanda/tune.go +++ b/src/go/rpk/pkg/cli/cmd/redpanda/tune.go @@ -214,8 +214,10 @@ func tune( results := []result{} includeErr := false + allDisabled := true for _, tunerName := range tunerNames { enabled := factory.IsTunerEnabled(tunerName, conf.Rpk) + allDisabled = allDisabled && !enabled tuner := tunersFactory.CreateTuner(tunerName, params) supported, reason := tuner.CheckIfSupported() if !enabled || !supported { @@ -234,6 +236,14 @@ func tune( results = append(results, result{tunerName, !res.IsFailed(), enabled, supported, errMsg}) } + if allDisabled { + log.Warn( + "All tuners were disabled, so none were applied. You may run " + + " `rpk mode prod` to enable the recommended set of tuners " + + " for non-containerized production use.", + ) + } + printTuneResult(results, includeErr) if rebootRequired {