From 02493251d598a899e4a3ee2fd469fc3b8ef0caf0 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 1 Sep 2015 10:05:06 +0200 Subject: [PATCH] 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 --- lib/model/model.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/model/model.go b/lib/model/model.go index 53512e8f6..367bd5db7 100644 --- a/lib/model/model.go +++ b/lib/model/model.go @@ -1465,8 +1465,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 }