@@ -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
@@ -227,7 +232,7 @@ namespace NKikimr::NAutoConfigInitializer {
227232 return servicePools;
228233 }
229234
230- void ApplyAutoConfig (NKikimrConfig::TActorSystemConfig *config, bool isDynamicNode) {
235+ void ApplyAutoConfig (NKikimrConfig::TActorSystemConfig *config, bool isDynamicNode, bool tinyMode ) {
231236 config->SetUseAutoConfig (true );
232237 config->ClearExecutor ();
233238
@@ -239,7 +244,10 @@ namespace NKikimr::NAutoConfigInitializer {
239244
240245 if (!config->HasScheduler ()) {
241246 auto *scheduler = config->MutableScheduler ();
242- scheduler->SetResolution (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