Skip to content

Commit 2184fbb

Browse files
committed
comment
1 parent 3c6c786 commit 2184fbb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pkg/dxf/framework/proto/node.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ func getLimitedDXFCPU(totalCPU int, limit int) int {
6464
if totalCPU <= 0 || limit >= 100 {
6565
return totalCPU
6666
}
67+
// use CEIL might cause the real limit to be higher than the given limit.
68+
// as DXF use slots or CPU cores as the unit of resource, that's acceptable.
6769
usableCPU := int(math.Ceil(float64(totalCPU) * float64(limit) / 100))
6870
if usableCPU < 1 {
6971
return 1

0 commit comments

Comments
 (0)