Skip to content

Commit 4a7f723

Browse files
authored
allow to configure min alloc size (#7951) (#7996)
1 parent 6b90a45 commit 4a7f723

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

ydb/core/kqp/compute_actor/kqp_compute_actor_factory.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ class TKqpCaFactory : public IKqpNodeComputeActorFactory {
8989
std::atomic<ui64> MkqlHeavyProgramMemoryLimit = 0;
9090
std::atomic<ui64> MinChannelBufferSize = 0;
9191
std::atomic<ui64> ReasonableSpillingTreshold = 0;
92+
std::atomic<ui64> MinMemAllocSize = 8_MB;
93+
std::atomic<ui64> MinMemFreeSize = 32_MB;
9294

9395
public:
9496
TKqpCaFactory(const NKikimrConfig::TTableServiceConfig::TResourceManager& config,
@@ -108,13 +110,17 @@ class TKqpCaFactory : public IKqpNodeComputeActorFactory {
108110
MkqlHeavyProgramMemoryLimit.store(config.GetMkqlHeavyProgramMemoryLimit());
109111
MinChannelBufferSize.store(config.GetMinChannelBufferSize());
110112
ReasonableSpillingTreshold.store(config.GetReasonableSpillingTreshold());
113+
MinMemAllocSize.store(config.GetMinMemAllocSize());
114+
MinMemFreeSize.store(config.GetMinMemFreeSize());
111115
}
112116

113117
TActorStartResult CreateKqpComputeActor(TCreateArgs&& args) {
114118
NYql::NDq::TComputeMemoryLimits memoryLimits;
115119
memoryLimits.ChannelBufferSize = 0;
116120
memoryLimits.MkqlLightProgramMemoryLimit = MkqlLightProgramMemoryLimit.load();
117121
memoryLimits.MkqlHeavyProgramMemoryLimit = MkqlHeavyProgramMemoryLimit.load();
122+
memoryLimits.MinMemAllocSize = MinMemAllocSize.load();
123+
memoryLimits.MinMemFreeSize = MinMemFreeSize.load();
118124

119125
auto estimation = ResourceManager_->EstimateTaskResources(*args.Task, args.NumberOfTasks);
120126
NRm::TKqpResourcesRequest resourcesRequest;
@@ -232,4 +238,4 @@ std::shared_ptr<IKqpNodeComputeActorFactory> MakeKqpCaFactory(const NKikimrConfi
232238
return std::make_shared<TKqpCaFactory>(config, resourceManager, asyncIoFactory, federatedQuerySetup);
233239
}
234240

235-
}
241+
}

ydb/core/kqp/node_service/kqp_node_service.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ class TKqpNodeService : public TActorBootstrapped<TKqpNodeService> {
329329
FORCE_VALUE(EnableInstantMkqlMemoryAlloc);
330330
FORCE_VALUE(MaxTotalChannelBuffersSize);
331331
FORCE_VALUE(MinChannelBufferSize);
332+
FORCE_VALUE(MinMemAllocSize);
333+
FORCE_VALUE(MinMemFreeSize);
332334
#undef FORCE_VALUE
333335

334336
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 uint64 ReasonableSpillingTreshold = 22 [default = 104857600]; // 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)