Commit 4ce318b
committed
fix: parallelism CPU calculation inside k8s
The value of /sys/fs/cgroup/cpu/cpu.cfs_quota_us is not in milliseconds
and cannot be simply divided by 1000 to determine the CPU limit. As per
kernel documentation[^1], the cpu limit can be determined by dividing
that value by /sys/fs/cgroup/cpu/cpu.cfs_period_us.
[^1]: https://docs.kernel.org/scheduler/sched-bwc.html1 parent dfbde65 commit 4ce318b
1 file changed
+10
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
| 200 | + | |
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
205 | | - | |
| 206 | + | |
206 | 207 | | |
207 | | - | |
| 208 | + | |
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
| |||
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
236 | | - | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
237 | 244 | | |
238 | 245 | | |
239 | 246 | | |
| |||
0 commit comments