Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow to configure min alloc size #7951

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions ydb/core/kqp/compute_actor/kqp_compute_actor_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ class TKqpCaFactory : public IKqpNodeComputeActorFactory {
std::atomic<ui64> MkqlLightProgramMemoryLimit = 0;
std::atomic<ui64> MkqlHeavyProgramMemoryLimit = 0;
std::atomic<ui64> MinChannelBufferSize = 0;
std::atomic<ui64> MinMemAllocSize = 8_MB;
std::atomic<ui64> MinMemFreeSize = 32_MB;

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

TActorStartResult CreateKqpComputeActor(TCreateArgs&& args) override {
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
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 @@ -378,6 +378,8 @@ class TKqpNodeService : public TActorBootstrapped<TKqpNodeService> {
FORCE_VALUE(PublishStatisticsIntervalSec);
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 double SpillingPercent = 22 [default = 80]; // 100 MiB

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

message TSpillingServiceConfig {
Expand Down
Loading