Skip to content

Commit 57dc600

Browse files
committed
Autodetect tiny mode in AS #27893 (#28291)
1 parent 8d53857 commit 57dc600

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ydb/core/driver_lib/run/auto_config_initializer.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ namespace {
3939
constexpr i16 GRpcHandlersPerCompletionQueueInMaxPreparedCpuCase = 1000;
4040
constexpr i16 GRpcHandlersPerCompletionQueuePerCpu = GRpcHandlersPerCompletionQueueInMaxPreparedCpuCase / MaxPreparedCpuCount;
4141

42+
constexpr i16 SchedulerTinyCoresThreshold = 4;
43+
44+
constexpr ::arc_ui64 SchedulerDefaultResolution = 64;
45+
constexpr ::arc_ui64 SchedulerTinyResolution = 1024;
46+
4247
TShortPoolCfg ComputeCpuTable[MaxPreparedCpuCount + 1][5] {
4348
{ {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0} }, // 0
4449
{ {1, 1}, {0, 1}, {0, 1}, {0, 0}, {0, 0} }, // 1
@@ -239,7 +244,10 @@ namespace NKikimr::NAutoConfigInitializer {
239244

240245
if (!config->HasScheduler()) {
241246
auto *scheduler = config->MutableScheduler();
242-
scheduler->SetResolution(tinyMode ? 1024 : 64);
247+
248+
bool useTiny = tinyMode || (cpuCount >= 1 && cpuCount <= SchedulerTinyCoresThreshold);
249+
scheduler->SetResolution(useTiny ? SchedulerTinyResolution : SchedulerDefaultResolution);
250+
243251
scheduler->SetSpinThreshold(0);
244252
scheduler->SetProgressThreshold(10'000);
245253
}

0 commit comments

Comments
 (0)