Skip to content

Commit 05367f9

Browse files
authored
allow to configure min alloc size (#7951)
1 parent 131f219 commit 05367f9

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

ydb/core/kqp/compute_actor/kqp_compute_actor_factory.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ class TKqpCaFactory : public IKqpNodeComputeActorFactory {
8686
std::atomic<ui64> MkqlLightProgramMemoryLimit = 0;
8787
std::atomic<ui64> MkqlHeavyProgramMemoryLimit = 0;
8888
std::atomic<ui64> MinChannelBufferSize = 0;
89+
std::atomic<ui64> MinMemAllocSize = 8_MB;
90+
std::atomic<ui64> MinMemFreeSize = 32_MB;
8991

9092
public:
9193
TKqpCaFactory(const NKikimrConfig::TTableServiceConfig::TResourceManager& config,
@@ -104,13 +106,17 @@ class TKqpCaFactory : public IKqpNodeComputeActorFactory {
104106
MkqlLightProgramMemoryLimit.store(config.GetMkqlLightProgramMemoryLimit());
105107
MkqlHeavyProgramMemoryLimit.store(config.GetMkqlHeavyProgramMemoryLimit());
106108
MinChannelBufferSize.store(config.GetMinChannelBufferSize());
109+
MinMemAllocSize.store(config.GetMinMemAllocSize());
110+
MinMemFreeSize.store(config.GetMinMemFreeSize());
107111
}
108112

109113
TActorStartResult CreateKqpComputeActor(TCreateArgs&& args) override {
110114
NYql::NDq::TComputeMemoryLimits memoryLimits;
111115
memoryLimits.ChannelBufferSize = 0;
112116
memoryLimits.MkqlLightProgramMemoryLimit = MkqlLightProgramMemoryLimit.load();
113117
memoryLimits.MkqlHeavyProgramMemoryLimit = MkqlHeavyProgramMemoryLimit.load();
118+
memoryLimits.MinMemAllocSize = MinMemAllocSize.load();
119+
memoryLimits.MinMemFreeSize = MinMemFreeSize.load();
114120

115121
auto estimation = ResourceManager_->EstimateTaskResources(*args.Task, args.NumberOfTasks);
116122
NRm::TKqpResourcesRequest resourcesRequest;

ydb/core/kqp/node_service/kqp_node_service.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,8 @@ class TKqpNodeService : public TActorBootstrapped<TKqpNodeService> {
378378
FORCE_VALUE(PublishStatisticsIntervalSec);
379379
FORCE_VALUE(MaxTotalChannelBuffersSize);
380380
FORCE_VALUE(MinChannelBufferSize);
381+
FORCE_VALUE(MinMemAllocSize);
382+
FORCE_VALUE(MinMemFreeSize);
381383
#undef FORCE_VALUE
382384

383385
LOG_I("Updated table service config: " << Config.DebugString());

ydb/core/protos/table_service_config.proto

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ message TTableServiceConfig {
2323
optional uint32 ComputeActorsCount = 1 [default = 10000];
2424
optional uint64 ChannelBufferSize = 2 [default = 8388608]; // 8 MB
2525
reserved 3;
26-
optional uint64 MkqlLightProgramMemoryLimit = 4 [default = 524288]; // 512 KB
26+
optional uint64 MkqlLightProgramMemoryLimit = 4 [default = 1048576]; // 1 MiB
2727
optional uint64 MkqlHeavyProgramMemoryLimit = 5 [default = 31457280]; // 30 MB
2828
optional uint64 QueryMemoryLimit = 6 [default = 32212254720]; // 30 GB
2929
optional uint32 PublishStatisticsIntervalSec = 7 [default = 2];
@@ -43,6 +43,9 @@ message TTableServiceConfig {
4343
optional uint64 KqpPatternCachePatternAccessTimesBeforeTryToCompile = 20 [default = 5];
4444
optional uint64 KqpPatternCacheCompiledCapacityBytes = 21 [default = 104857600]; // 100 MiB
4545
optional double SpillingPercent = 22 [default = 80]; // 100 MiB
46+
47+
optional uint64 MinMemAllocSize = 23 [default = 8388608]; // 8 MiB
48+
optional uint64 MinMemFreeSize = 24 [default = 33554432]; // 32 MiB
4649
}
4750

4851
message TSpillingServiceConfig {

0 commit comments

Comments
 (0)