Adjust defaults for number of hashers based on OS

https://forum.syncthing.net/t/syncthing-is-such-a-massive-resource-hog/5494/19?u=calmh
This commit is contained in:
Jakob Borg
2015-09-03 08:22:34 +02:00
parent 2eece95ed2
commit 4a6e9c189c
+9 -1
View File
@@ -1424,8 +1424,16 @@ func (m *Model) numHashers(folder string) int {
return folderCfg.Hashers
}
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
// Interactive operating systems; don't load the system too heavily by
// default.
return 1
}
// For other operating systems and architectures, lets try to get some
// work done... Divide the available CPU cores among the configured
// folders.
if perFolder := runtime.GOMAXPROCS(-1) / numFolders; perFolder > 0 {
// We have CPUs to spare, divide them per folder.
return perFolder
}