|
3 | 3 | #include <ydb/core/protos/config.pb.h>
|
4 | 4 |
|
5 | 5 | #include <ydb/library/actors/util/affinity.h>
|
| 6 | +#include <ydb/library/yverify_stream/yverify_stream.h> |
6 | 7 | #include <util/system/info.h>
|
7 | 8 |
|
8 | 9 | namespace {
|
@@ -50,27 +51,27 @@ namespace {
|
50 | 51 | { {2, 4}, {4, 8}, {1, 2}, {0, 0}, {1, 3} }, // 8
|
51 | 52 | { {2, 5}, {4, 9}, {2, 3}, {0, 0}, {1, 3} }, // 9
|
52 | 53 | { {2, 5}, {5, 10}, {2, 3}, {0, 0}, {1, 3} }, // 10
|
53 |
| - { {2, 6}, {6, 11}, {2, 3}, {0, 0}, {2, 4} }, // 11 |
54 |
| - { {2, 6}, {7, 12}, {2, 3}, {0, 0}, {2, 5} }, // 12 |
55 |
| - { {3, 7}, {7, 13}, {2, 3}, {0, 0}, {2, 5} }, // 13 |
56 |
| - { {3, 7}, {7, 14}, {2, 3}, {0, 0}, {3, 6} }, // 14 |
57 |
| - { {3, 8}, {8, 15}, {2, 4}, {0, 0}, {3, 6} }, // 15 |
58 |
| - { {3, 8}, {9, 16}, {2, 4}, {0, 0}, {3, 6} }, // 16 |
59 |
| - { {3, 9}, {10, 17}, {2, 4}, {0, 0}, {3, 7} }, // 17 |
60 |
| - { {3, 9}, {10, 18}, {3, 5}, {0, 0}, {3, 7} }, // 18 |
61 |
| - { {4, 10}, {10, 19}, {3, 5}, {0, 0}, {4, 8} }, // 19 |
62 |
| - { {4, 10}, {10, 20}, {3, 5}, {0, 0}, {4, 8} }, // 20 |
63 |
| - { {4, 11}, {11, 21}, {3, 5}, {0, 0}, {4, 8} }, // 21 |
64 |
| - { {4, 11}, {12, 22}, {3, 5}, {0, 0}, {4, 9} }, // 22 |
65 |
| - { {4, 12}, {13, 23}, {3, 6}, {0, 0}, {4, 9} }, // 23 |
66 |
| - { {4, 12}, {13, 24}, {3, 6}, {0, 0}, {5, 10} }, // 24 |
67 |
| - { {5, 13}, {13, 25}, {3, 6}, {0, 0}, {5, 10} }, // 25 |
68 |
| - { {5, 13}, {13, 26}, {4, 7}, {0, 0}, {5, 10} }, // 26 |
69 |
| - { {5, 14}, {14, 27}, {4, 7}, {0, 0}, {5, 11} }, // 27 |
| 54 | + { {2, 6}, {5, 11}, {2, 3}, {0, 0}, {2, 4} }, // 11 |
| 55 | + { {2, 6}, {6, 12}, {2, 3}, {0, 0}, {2, 5} }, // 12 |
| 56 | + { {3, 7}, {6, 13}, {2, 3}, {0, 0}, {2, 5} }, // 13 |
| 57 | + { {3, 7}, {6, 14}, {2, 3}, {0, 0}, {3, 6} }, // 14 |
| 58 | + { {3, 8}, {7, 15}, {2, 4}, {0, 0}, {3, 6} }, // 15 |
| 59 | + { {3, 8}, {8, 16}, {2, 4}, {0, 0}, {3, 6} }, // 16 |
| 60 | + { {3, 9}, {9, 17}, {2, 4}, {0, 0}, {3, 7} }, // 17 |
| 61 | + { {3, 9}, {9, 18}, {3, 5}, {0, 0}, {3, 7} }, // 18 |
| 62 | + { {3, 10}, {9, 19}, {3, 5}, {0, 0}, {4, 8} }, // 19 |
| 63 | + { {4, 10}, {9, 20}, {3, 5}, {0, 0}, {4, 8} }, // 20 |
| 64 | + { {4, 11}, {10, 21}, {3, 5}, {0, 0}, {4, 8} }, // 21 |
| 65 | + { {4, 11}, {11, 22}, {3, 5}, {0, 0}, {4, 9} }, // 22 |
| 66 | + { {4, 12}, {12, 23}, {3, 6}, {0, 0}, {4, 9} }, // 23 |
| 67 | + { {4, 12}, {12, 24}, {3, 6}, {0, 0}, {5, 10} }, // 24 |
| 68 | + { {5, 13}, {12, 25}, {3, 6}, {0, 0}, {5, 10} }, // 25 |
| 69 | + { {5, 13}, {12, 26}, {4, 7}, {0, 0}, {5, 10} }, // 26 |
| 70 | + { {5, 14}, {13, 27}, {4, 7}, {0, 0}, {5, 11} }, // 27 |
70 | 71 | { {5, 14}, {14, 28}, {4, 7}, {0, 0}, {5, 11} }, // 28
|
71 |
| - { {5, 15}, {15, 29}, {4, 8}, {0, 0}, {6, 12} }, // 29 |
72 |
| - { {5, 15}, {16, 30}, {4, 8}, {0, 0}, {6, 12} }, // 30 |
73 |
| - { {6, 18}, {16, 31}, {4, 8}, {0, 0}, {6, 12} }, // 31 |
| 72 | + { {5, 15}, {14, 29}, {4, 8}, {0, 0}, {6, 12} }, // 29 |
| 73 | + { {5, 15}, {15, 30}, {4, 8}, {0, 0}, {6, 12} }, // 30 |
| 74 | + { {6, 18}, {15, 31}, {4, 8}, {0, 0}, {6, 12} }, // 31 |
74 | 75 | };
|
75 | 76 |
|
76 | 77 | TShortPoolCfg HybridCpuTable[MaxPreparedCpuCount + 1][5] {
|
@@ -158,9 +159,11 @@ namespace {
|
158 | 159 | TShortPoolCfg result = cpuTable[MaxPreparedCpuCount][poolIdx];
|
159 | 160 | result.ThreadCount *= k;
|
160 | 161 | result.MaxThreadCount *= k;
|
161 |
| - TShortPoolCfg additional = cpuTable[mod][poolIdx]; |
162 |
| - result.ThreadCount += additional.ThreadCount; |
163 |
| - result.MaxThreadCount += additional.MaxThreadCount; |
| 162 | + if (mod) { |
| 163 | + TShortPoolCfg additional = cpuTable[mod][poolIdx]; |
| 164 | + result.ThreadCount += additional.ThreadCount; |
| 165 | + result.MaxThreadCount += additional.MaxThreadCount; |
| 166 | + } |
164 | 167 | return result;
|
165 | 168 | }
|
166 | 169 |
|
@@ -274,6 +277,13 @@ namespace NKikimr::NAutoConfigInitializer {
|
274 | 277 | config->GetNodeType() == NKikimrConfig::TActorSystemConfig::COMPUTE ? ComputeCpuTable :
|
275 | 278 | HybridCpuTable );
|
276 | 279 |
|
| 280 | + // check cpu table |
| 281 | + i16 cpuSum = 0; |
| 282 | + for (auto poolKind : {EPoolKind::System, EPoolKind::User, EPoolKind::Batch, EPoolKind::IC}) { |
| 283 | + TShortPoolCfg cfg = GetShortPoolChg(poolKind, cpuCount, cpuTable); |
| 284 | + cpuSum += cfg.ThreadCount; |
| 285 | + } |
| 286 | + Y_VERIFY_S(cpuSum == cpuCount, "cpuSum# " << cpuSum << " cpuCount# " << cpuCount); |
277 | 287 |
|
278 | 288 | for (ui32 poolIdx = 0; poolIdx < poolCount; ++poolIdx) {
|
279 | 289 | auto *executor = executors[poolIdx];
|
|
0 commit comments