diff options
author | eivanov89 <eivanov89@ydb.tech> | 2023-08-29 13:07:16 +0300 |
---|---|---|
committer | eivanov89 <eivanov89@ydb.tech> | 2023-08-29 13:36:31 +0300 |
commit | baf6a87500751b9ab0cd6c83b83543cdc3931b17 (patch) | |
tree | ebdd5400c728fdd35ae8a900cb73c4c5c795f6a4 | |
parent | 7999a12359702225ce18a2e1746a52a9145a29a1 (diff) | |
download | ydb-baf6a87500751b9ab0cd6c83b83543cdc3931b17.tar.gz |
KIKIMR-19192: tiny-mode option to disable MemoryTracker and SelfPing
-rw-r--r-- | ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp | 8 | ||||
-rw-r--r-- | ydb/core/driver_lib/run/config.h | 10 | ||||
-rw-r--r-- | ydb/core/driver_lib/run/run.cpp | 6 |
3 files changed, 22 insertions, 2 deletions
diff --git a/ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp b/ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp index 4c95a5704f0..43ba4397c5d 100644 --- a/ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp +++ b/ydb/core/driver_lib/cli_utils/cli_cmds_server.cpp @@ -63,6 +63,7 @@ protected: bool FixedNodeID; bool IgnoreCmsConfigs; bool HierarchicalCfg; + bool TinyMode; TString NodeAddress; TString NodeHost; TString NodeResolveHost; @@ -244,6 +245,9 @@ protected: config.Opts->AddLongOption("http-proxy-file", "Http proxy config file").OptionalArgument("PATH"); config.Opts->AddLongOption("public-http-file", "Public HTTP config file").OptionalArgument("PATH"); + config.Opts->AddLongOption("tiny-mode", "Start in a tiny mode") + .NoArgument().SetFlag(&TinyMode); + config.Opts->AddHelpOption('h'); // add messagebus proxy options @@ -396,6 +400,10 @@ protected: ythrow yexception() << "wrong '--node-kind' value '" << NodeKind << "', only '" << NODE_KIND_YDB << "' or '" << NODE_KIND_YQ << "' is allowed"; } + if (TinyMode) { + RunConfig.ServicesMask.SetTinyMode(); + } + RunConfig.Labels["node_id"] = ToString(NodeId); RunConfig.Labels["node_host"] = FQDNHostName(); RunConfig.Labels["tenant"] = TenantName; diff --git a/ydb/core/driver_lib/run/config.h b/ydb/core/driver_lib/run/config.h index 1081f524793..b3a0d131eff 100644 --- a/ydb/core/driver_lib/run/config.h +++ b/ydb/core/driver_lib/run/config.h @@ -75,6 +75,9 @@ union TBasicKikimrServicesMask { bool EnableLocalPgWire:1; bool EnableKafkaProxy:1; bool EnableIcNodeCacheService:1; + bool EnableMemoryTracker:1; + + // next 64 flags }; ui64 Raw; @@ -102,6 +105,13 @@ union TBasicKikimrServicesMask { EnableProfiler = true; } + void SetTinyMode() { + EnableSelfPing = false; + EnableMemoryTracker = false; + + // TODO: set EnableStatsCollector to false as well + } + TBasicKikimrServicesMask() { EnableAll(); } diff --git a/ydb/core/driver_lib/run/run.cpp b/ydb/core/driver_lib/run/run.cpp index c6f54360be7..6d15bf15493 100644 --- a/ydb/core/driver_lib/run/run.cpp +++ b/ydb/core/driver_lib/run/run.cpp @@ -973,7 +973,7 @@ void TKikimrRunner::InitializeAllocator(const TKikimrRunConfig& runConfig) { void TKikimrRunner::InitializeAppData(const TKikimrRunConfig& runConfig) { const auto& cfg = runConfig.AppConfig; - + bool useAutoConfig = !cfg.HasActorSystemConfig() || (cfg.GetActorSystemConfig().HasUseAutoConfig() && cfg.GetActorSystemConfig().GetUseAutoConfig()); NAutoConfigInitializer::TASPools pools = NAutoConfigInitializer::GetASPools(cfg.GetActorSystemConfig(), useAutoConfig); TMap<TString, ui32> servicePools = NAutoConfigInitializer::GetServicePools(cfg.GetActorSystemConfig(), useAutoConfig); @@ -1479,7 +1479,9 @@ TIntrusivePtr<TServiceInitializersList> TKikimrRunner::CreateServiceInitializers sil->AddServiceInitializer(new TMemProfMonitorInitializer(runConfig, MemObserver)); #if defined(ENABLE_MEMORY_TRACKING) - sil->AddServiceInitializer(new TMemoryTrackerInitializer(runConfig)); + if (serviceMask.EnableMemoryTracker) { + sil->AddServiceInitializer(new TMemoryTrackerInitializer(runConfig)); + } #endif if (serviceMask.EnableKqp) { |