[rush] Improve task scheduler to handle tasks that consume 100% CPU
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 30/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Cần làm rõ
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- node.js, typescript
- Lĩnh vực
- build-system, devtools
Hướng nghiên cứu
Start by tracing Rush's existing --parallelism and rush-project.json weight handling; the issue names no implementation file or test. Compare the two proposals: percentage weights should resolve against the parallelism limit, while a common/config rule should match package.json scripts and allow rush-project.json overrides.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
@LPegasus and I recently discussed a problem where certain Rush phase scripts are heavily multithreaded, designed to consume 100% CPU. Examples:
- ESBuild
- Rspack
- Jest
When Rush attempts to run several of these tasks in parallel, it overloads the machine. For ESBuild it was causing Golang deadlocks, perhaps due to an ESBuild bug that causes thread starvation. (?)
Details
This can be avoided by specifying weight=N in rush-project.json, where N is equal to the --parallelism limit. But if CI uses a value like --parallelism=100%, then N is machine dependent.
We can break this problem into two complementary design proposals:
Proposal 1: Allow % units for weight
The rush-project.json file should allow percentage values like "weight": "100%" similar to --parallelism=100%. For example if --parallelism=100% corresponds to a maximum of 8 parallel jobs, then "weight": "75%" would indicate a weight of 6.
Proposal 2: Allow weight to be specified using pattern matching
In order to use the "weight": "100%" feature, we would need to audit every operation script for every project in our monorepo, identify which ones are invoking ESBuild, and then add a corresponding rush-project.json or rig profile to adjust the weight.
However in practice, that work could be captured by a general rule like this:
Examine the package.json shell script: Does it match the RegExp
/\besbuild\b/? If yes, then use "100%" as the defaultweight, unless it is overridden by rush-project.json.
Such a rule could be configured centrally in a common/config file.
@dmichon-msft
- Ngôn ngữ chính
- TypeScript
- Star
- 6.5k
- Fork
- 708
- Merge trung bình
- 4 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 62
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/rushstack
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
Tất cả issue của microsoft/rushstack
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
receptron/mulmoterminal#2264 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
components-web-app/docs#96 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
simonsobs/tileviewer#114 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100