Raise default limit to numCPU * 16, max 128
This commit is contained in:
parent
b951d638c0
commit
9b0e636aaa
|
@ -9,7 +9,6 @@ import (
|
||||||
"github.com/minio/sha256-simd"
|
"github.com/minio/sha256-simd"
|
||||||
"hash"
|
"hash"
|
||||||
"io"
|
"io"
|
||||||
"math"
|
|
||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
|
@ -53,7 +52,13 @@ func PrintHashFileResult(result *HashFileResult) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
taskLimit := flag.Int("tasklimit", int(math.Ceil(float64(runtime.NumCPU())*1.5)), "Maximum number of concurrent hashing tasks. Change to avoid fdlimit issues. Defaults to number of CPU cores * 1.5")
|
taskLimit := flag.Int("tasklimit", func() int {
|
||||||
|
result := runtime.NumCPU() * 16
|
||||||
|
if result > 128 {
|
||||||
|
return 128
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}(), "Maximum number of concurrent hashing tasks. Change to avoid fdlimit issues. Defaults to number of min(128, CPU cores * 16)")
|
||||||
|
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue