Skip to content

Commit

Permalink
Merge 323c6a8 into e7ccd59
Browse files Browse the repository at this point in the history
  • Loading branch information
gridnevvvit authored Aug 19, 2024
2 parents e7ccd59 + 323c6a8 commit 5d09c23
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion ydb/core/kqp/compute_actor/kqp_compute_actor_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ class TKqpCaFactory : public IKqpNodeComputeActorFactory {
std::atomic<ui64> MkqlHeavyProgramMemoryLimit = 0;
std::atomic<ui64> MinChannelBufferSize = 0;
std::atomic<ui64> ReasonableSpillingTreshold = 0;
std::atomic<ui64> MinMemAllocSize = 8_MB;
std::atomic<ui64> MinMemFreeSize = 32_MB;

public:
TKqpCaFactory(const NKikimrConfig::TTableServiceConfig::TResourceManager& config,
Expand All @@ -108,13 +110,17 @@ class TKqpCaFactory : public IKqpNodeComputeActorFactory {
MkqlHeavyProgramMemoryLimit.store(config.GetMkqlHeavyProgramMemoryLimit());
MinChannelBufferSize.store(config.GetMinChannelBufferSize());
ReasonableSpillingTreshold.store(config.GetReasonableSpillingTreshold());
MinMemAllocSize.store(config.GetMinMemAllocSize());
MinMemFreeSize.store(config.GetMinMemFreeSize());
}

TActorStartResult CreateKqpComputeActor(TCreateArgs&& args) {
NYql::NDq::TComputeMemoryLimits memoryLimits;
memoryLimits.ChannelBufferSize = 0;
memoryLimits.MkqlLightProgramMemoryLimit = MkqlLightProgramMemoryLimit.load();
memoryLimits.MkqlHeavyProgramMemoryLimit = MkqlHeavyProgramMemoryLimit.load();
memoryLimits.MinMemAllocSize = MinMemAllocSize.load();
memoryLimits.MinMemFreeSize = MinMemFreeSize.load();

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

}
}
2 changes: 2 additions & 0 deletions ydb/core/kqp/node_service/kqp_node_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,8 @@ class TKqpNodeService : public TActorBootstrapped<TKqpNodeService> {
FORCE_VALUE(EnableInstantMkqlMemoryAlloc);
FORCE_VALUE(MaxTotalChannelBuffersSize);
FORCE_VALUE(MinChannelBufferSize);
FORCE_VALUE(MinMemAllocSize);
FORCE_VALUE(MinMemFreeSize);
#undef FORCE_VALUE

LOG_I("Updated table service config: " << Config.DebugString());
Expand Down
5 changes: 4 additions & 1 deletion ydb/core/protos/table_service_config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ message TTableServiceConfig {
optional uint32 ComputeActorsCount = 1 [default = 10000];
optional uint64 ChannelBufferSize = 2 [default = 8388608]; // 8 MB
reserved 3;
optional uint64 MkqlLightProgramMemoryLimit = 4 [default = 524288]; // 512 KB
optional uint64 MkqlLightProgramMemoryLimit = 4 [default = 1048576]; // 1 MiB
optional uint64 MkqlHeavyProgramMemoryLimit = 5 [default = 31457280]; // 30 MB
optional uint64 QueryMemoryLimit = 6 [default = 32212254720]; // 30 GB
optional uint32 PublishStatisticsIntervalSec = 7 [default = 2];
Expand All @@ -43,6 +43,9 @@ message TTableServiceConfig {
optional uint64 KqpPatternCachePatternAccessTimesBeforeTryToCompile = 20 [default = 5];
optional uint64 KqpPatternCacheCompiledCapacityBytes = 21 [default = 104857600]; // 100 MiB
optional uint64 ReasonableSpillingTreshold = 22 [default = 104857600]; // 100 MiB

optional uint64 MinMemAllocSize = 23 [default = 8388608]; // 8 MiB
optional uint64 MinMemFreeSize = 24 [default = 33554432]; // 32 MiB
}

message TSpillingServiceConfig {
Expand Down

0 comments on commit 5d09c23

Please sign in to comment.