Skip to content

Conversation

@GrigoriyPA
Copy link
Collaborator

Changelog entry

Added CPU limit per process in CS for integration with Workload Manager

Changelog category

  • Improvement

Description for reviewers

@GrigoriyPA GrigoriyPA requested review from a team as code owners April 28, 2025 09:29
@github-actions
Copy link

🟢 2025-04-28 09:31:44 UTC The validation of the Pull Request description is successful.

@github-actions
Copy link

github-actions bot commented Apr 28, 2025

2025-04-28 09:38:34 UTC Pre-commit check linux-x86_64-release-asan for 3b03381 has started.
2025-04-28 09:38:49 UTC Artifacts will be uploaded here
2025-04-28 09:42:07 UTC ya make is running...
🟡 2025-04-28 11:59:33 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14707 14425 0 208 47 27

2025-04-28 12:00:50 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-04-28 12:44:01 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1203 (only retried tests) 1093 0 49 35 26

2025-04-28 12:44:17 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-04-28 13:10:56 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
795 (only retried tests) 689 0 45 36 25

🟢 2025-04-28 13:11:09 UTC Build successful.
🟡 2025-04-28 13:11:44 UTC ydbd size 3.8 GiB changed* by +232.5 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 33bb0a9 merge: 3b03381 diff diff %
ydbd size 4 120 493 536 Bytes 4 120 731 616 Bytes +232.5 KiB +0.006%
ydbd stripped size 1 428 581 976 Bytes 1 428 659 320 Bytes +75.5 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Apr 28, 2025

2025-04-28 09:40:50 UTC Pre-commit check linux-x86_64-relwithdebinfo for 3b03381 has started.
2025-04-28 09:41:07 UTC Artifacts will be uploaded here
2025-04-28 09:44:15 UTC ya make is running...
🟡 2025-04-28 11:52:59 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
29498 26813 0 5 2636 44

2025-04-28 11:55:25 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-04-28 12:20:19 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
709 (only retried tests) 659 0 1 14 35

2025-04-28 12:20:31 UTC ya make is running... (failed tests rerun, try 3)
🟢 2025-04-28 12:45:15 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
551 (only retried tests) 513 0 0 4 34

🟢 2025-04-28 12:45:26 UTC Build successful.
🟡 2025-04-28 12:45:51 UTC ydbd size 2.2 GiB changed* by +121.0 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 33bb0a9 merge: 3b03381 diff diff %
ydbd size 2 342 243 864 Bytes 2 342 367 728 Bytes +121.0 KiB +0.005%
ydbd stripped size 492 613 728 Bytes 492 637 120 Bytes +22.8 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@GrigoriyPA GrigoriyPA force-pushed the YQ-4253-v2-support-cpu-scheduler-in-CS branch from 9986d96 to ede33e0 Compare April 30, 2025 05:05
@GrigoriyPA GrigoriyPA requested a review from gridnevvvit April 30, 2025 05:06
@github-actions
Copy link

github-actions bot commented Apr 30, 2025

2025-04-30 05:10:31 UTC Pre-commit check linux-x86_64-release-asan for 47161db has started.
2025-04-30 05:11:04 UTC Artifacts will be uploaded here
2025-04-30 05:14:52 UTC ya make is running...
2025-04-30 05:24:58 UTC Check cancelled

@github-actions
Copy link

github-actions bot commented Apr 30, 2025

2025-04-30 05:30:18 UTC Pre-commit check linux-x86_64-release-asan for 7c13c2a has started.
2025-04-30 05:30:21 UTC Artifacts will be uploaded here
2025-04-30 05:33:26 UTC ya make is running...
🟡 2025-04-30 07:38:52 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14864 14737 0 61 40 26

2025-04-30 07:40:11 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-04-30 08:18:39 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
795 (only retried tests) 695 0 44 32 24

2025-04-30 08:18:51 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-04-30 08:54:53 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
715 (only retried tests) 624 0 43 25 23

🟢 2025-04-30 08:55:05 UTC Build successful.
🟡 2025-04-30 08:55:37 UTC ydbd size 3.8 GiB changed* by +225.1 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: e02f5d6 merge: 7c13c2a diff diff %
ydbd size 4 122 034 096 Bytes 4 122 264 552 Bytes +225.1 KiB +0.006%
ydbd stripped size 1 428 848 600 Bytes 1 428 921 432 Bytes +71.1 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented Apr 30, 2025

2025-04-30 06:27:56 UTC Pre-commit check linux-x86_64-relwithdebinfo for 7c13c2a has started.
2025-04-30 06:28:02 UTC Artifacts will be uploaded here
2025-04-30 06:31:15 UTC ya make is running...
🟡 2025-04-30 08:21:19 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
29656 26972 0 2 2642 40

2025-04-30 08:23:50 UTC ya make is running... (failed tests rerun, try 2)
🟢 2025-04-30 08:53:12 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
356 (only retried tests) 320 0 0 2 34

🟢 2025-04-30 08:53:22 UTC Build successful.
🟡 2025-04-30 08:53:41 UTC ydbd size 2.2 GiB changed* by +115.4 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: e02f5d6 merge: 7c13c2a diff diff %
ydbd size 2 343 152 640 Bytes 2 343 270 784 Bytes +115.4 KiB +0.005%
ydbd stripped size 492 687 552 Bytes 492 708 992 Bytes +20.9 KiB +0.004%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@GrigoriyPA GrigoriyPA force-pushed the YQ-4253-v2-support-cpu-scheduler-in-CS branch from a1bba59 to fe84592 Compare May 3, 2025 04:22
@github-actions
Copy link

github-actions bot commented May 3, 2025

2025-05-03 04:42:13 UTC Pre-commit check linux-x86_64-release-asan for 1499920 has started.
2025-05-03 04:42:50 UTC Artifacts will be uploaded here
2025-05-03 04:46:36 UTC ya make is running...
🟡 2025-05-03 06:51:03 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14878 14719 0 87 48 24

2025-05-03 06:52:17 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-05-03 07:23:17 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
988 (only retried tests) 893 0 51 21 23

2025-05-03 07:23:29 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-05-03 07:48:58 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
789 (only retried tests) 684 0 48 35 22

🟢 2025-05-03 07:49:08 UTC Build successful.
🟡 2025-05-03 07:49:40 UTC ydbd size 3.8 GiB changed* by +225.2 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 726e4fe merge: 1499920 diff diff %
ydbd size 4 122 527 288 Bytes 4 122 757 848 Bytes +225.2 KiB +0.006%
ydbd stripped size 1 429 008 088 Bytes 1 429 080 920 Bytes +71.1 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented May 3, 2025

2025-05-03 04:43:32 UTC Pre-commit check linux-x86_64-relwithdebinfo for 1499920 has started.
2025-05-03 04:43:46 UTC Artifacts will be uploaded here
2025-05-03 04:47:13 UTC ya make is running...
🟡 2025-05-03 06:35:47 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
29696 27020 0 6 2631 39

2025-05-03 06:38:19 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-05-03 07:03:30 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
255 (only retried tests) 221 0 2 0 32

2025-05-03 07:03:38 UTC ya make is running... (failed tests rerun, try 3)
🔴 2025-05-03 07:16:32 UTC Some tests failed, follow the links below.

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
92 (only retried tests) 58 0 1 2 31

🟢 2025-05-03 07:16:38 UTC Build successful.
🟡 2025-05-03 07:16:59 UTC ydbd size 2.2 GiB changed* by +115.8 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 726e4fe merge: 1499920 diff diff %
ydbd size 2 343 427 480 Bytes 2 343 546 072 Bytes +115.8 KiB +0.005%
ydbd stripped size 492 746 560 Bytes 492 768 032 Bytes +21.0 KiB +0.004%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

}

TCPULimits::TCPULimits(const NKikimrKqp::TEvStartKqpTasksRequest& config) {
if (const auto share = config.GetPoolMaxCpuShare(); share > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

давай проверку share > 0 вынесем в VERIFY (потому что ожидания пользователя в этом ключе будут не очень понятны...)
и не пиши два оператора в одной строке - пропустить можно, пока читаешь...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

и еще - я, обычно, предпочитаю отдельно создать класс, а потом - вызвать DeserializeFromProto, чтобы можно было TConclusionStatus вернуть с пояснениями

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Share <= 0 сейчас означает, что лимит отключён (перенёс эту проверку в kqp_node_service.cpp)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

рекомендую более явно включать/выключать... никто, читая код, не сможет догадаться, что share=0 специальное значение.. но не настаиваю

ActiveWorkersCount = 0;
ActiveWorkerThreads = numberThreads;
ActiveWorkersIdx.clear();
for (const auto& worker : Workers) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

я бы тут выделил случай numberThreads >= MaxWorkerThreads
и отдельно второй - тогда во втором после цикла numberThreads должен был быть 0
и вычитать из него тогда worker.GetWorker()->GetCPUSoftLimit()

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Заменил вычитание на numberThreads -= worker.GetWorker()->GetCPUSoftLimit(); и добавил проверку:

AFL_VERIFY(std::abs(numberThreads) < Eps); 

Её можно в обоих случаях делать, так как numberThreads = std::min(MaxWorkerThreads, AmountCPULimit); (пока не понял зачем разделять случаи)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

разделять желательно, поскольку в самом частом случае, как мне кажется, мы не будем по циклу ходить

@GrigoriyPA GrigoriyPA force-pushed the YQ-4253-v2-support-cpu-scheduler-in-CS branch from fe84592 to 3d1616b Compare May 6, 2025 07:06
@GrigoriyPA GrigoriyPA requested a review from ivanmorozov333 May 6, 2025 07:07
@github-actions
Copy link

github-actions bot commented May 6, 2025

2025-05-06 07:10:16 UTC Pre-commit check linux-x86_64-relwithdebinfo for 8a4ee2a has started.
2025-05-06 07:10:27 UTC Artifacts will be uploaded here
2025-05-06 07:13:39 UTC ya make is running...

@github-actions
Copy link

github-actions bot commented May 6, 2025

2025-05-06 07:10:33 UTC Pre-commit check linux-x86_64-release-asan for 8a4ee2a has started.
2025-05-06 07:10:45 UTC Artifacts will be uploaded here
2025-05-06 07:13:57 UTC ya make is running...
🔴 2025-05-06 09:30:33 UTC Too many tests failed, NOT going to retry
🟡 2025-05-06 09:39:25 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14871 9932 0 4838 68 33

🟢 2025-05-06 09:41:10 UTC Build successful.
🟡 2025-05-06 09:41:57 UTC ydbd size 3.8 GiB changed* by +335.4 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 369528a merge: 8a4ee2a diff diff %
ydbd size 4 126 808 192 Bytes 4 127 151 656 Bytes +335.4 KiB +0.008%
ydbd stripped size 1 433 310 744 Bytes 1 433 410 680 Bytes +97.6 KiB +0.007%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented May 6, 2025

2025-05-06 11:52:12 UTC Pre-commit check linux-x86_64-relwithdebinfo for 199099e has started.
2025-05-06 11:52:34 UTC Artifacts will be uploaded here
2025-05-06 11:56:11 UTC ya make is running...
🟡 2025-05-06 13:37:47 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
29720 27031 0 10 2642 37

2025-05-06 13:40:12 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-05-06 14:04:27 UTC Some tests failed, follow the links below. Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
167 (only retried tests) 137 0 1 0 29

2025-05-06 14:04:36 UTC ya make is running... (failed tests rerun, try 3)
🟢 2025-05-06 14:29:34 UTC Tests successful.

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
106 (only retried tests) 78 0 0 0 28

🟢 2025-05-06 14:29:41 UTC Build successful.
🟡 2025-05-06 14:30:03 UTC ydbd size 2.2 GiB changed* by +131.2 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 97ed61a merge: 199099e diff diff %
ydbd size 2 344 087 568 Bytes 2 344 221 888 Bytes +131.2 KiB +0.006%
ydbd stripped size 493 122 176 Bytes 493 148 704 Bytes +25.9 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@github-actions
Copy link

github-actions bot commented May 6, 2025

2025-05-06 11:57:42 UTC Pre-commit check linux-x86_64-release-asan for 199099e has started.
2025-05-06 11:57:53 UTC Artifacts will be uploaded here
2025-05-06 12:01:10 UTC ya make is running...
🟡 2025-05-06 14:11:39 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
14885 14683 0 92 84 26

2025-05-06 14:12:55 UTC ya make is running... (failed tests rerun, try 2)
🟡 2025-05-06 14:43:26 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet Going to retry failed tests...

Test history | Ya make output | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
1231 (only retried tests) 1121 0 54 30 26

2025-05-06 14:43:41 UTC ya make is running... (failed tests rerun, try 3)
🟡 2025-05-06 15:09:33 UTC Some tests failed, follow the links below. This fail is not in blocking policy yet

Test history | Ya make output | Test bloat | Test bloat | Test bloat

TESTS PASSED ERRORS FAILED SKIPPED MUTED?
776 (only retried tests) 673 0 53 26 24

🟢 2025-05-06 15:09:44 UTC Build successful.
🟡 2025-05-06 15:10:20 UTC ydbd size 3.8 GiB changed* by +239.3 KiB, which is >= 100.0 KiB vs main: Warning

ydbd size dash main: 97ed61a merge: 199099e diff diff %
ydbd size 4 127 606 216 Bytes 4 127 851 248 Bytes +239.3 KiB +0.006%
ydbd stripped size 1 433 427 832 Bytes 1 433 497 176 Bytes +67.7 KiB +0.005%

*please be aware that the difference is based on comparing your commit and the last completed build from the post-commit, check comparation

@GrigoriyPA GrigoriyPA requested a review from ssmike May 7, 2025 08:23
@GrigoriyPA GrigoriyPA merged commit da5cb37 into ydb-platform:main May 12, 2025
13 checks passed
@GrigoriyPA GrigoriyPA deleted the YQ-4253-v2-support-cpu-scheduler-in-CS branch May 12, 2025 09:07
GrigoriyPA added a commit to GrigoriyPA/ydb that referenced this pull request May 12, 2025
dorooleg pushed a commit to dorooleg/ydb that referenced this pull request May 19, 2025
nshestakov pushed a commit to nshestakov/ydb that referenced this pull request May 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants