Skip to content

Commit

Permalink
ddl: set reorgCnt by judging the GOMAXPROCS (#36392)
Browse files Browse the repository at this point in the history
ref #32031
  • Loading branch information
hawkingrei committed Jul 21, 2022
1 parent 5f3252c commit 2a93509
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ func (d *ddl) prepareWorkers4ConcurrencyDDL() {
}
}
// reorg worker count at least 1 at most 10.
reorgCnt := mathutil.Min(mathutil.Max(runtime.NumCPU()/4, 1), reorgWorkerCnt)
reorgCnt := mathutil.Min(mathutil.Max(runtime.GOMAXPROCS(0)/4, 1), reorgWorkerCnt)
d.reorgWorkerPool = newDDLWorkerPool(pools.NewResourcePool(workerFactory(addIdxWorker), reorgCnt, reorgCnt, 0), reorg)
d.generalDDLWorkerPool = newDDLWorkerPool(pools.NewResourcePool(workerFactory(generalWorker), generalWorkerCnt, generalWorkerCnt, 0), general)
failpoint.Inject("NoDDLDispatchLoop", func(val failpoint.Value) {
Expand Down

0 comments on commit 2a93509

Please sign in to comment.