Config: Reduce workers default

CPUs with with hyper-threading can't properly manage the load otherwise.
This commit is contained in:
Michael Mayer 2021-01-09 04:44:36 +01:00
parent d215f782e6
commit 8627153288

View file

@ -331,7 +331,7 @@ func (c *Config) Workers() int {
numCPU := runtime.NumCPU() numCPU := runtime.NumCPU()
// Limit number of workers when using SQLite to avoid database locking issues. // Limit number of workers when using SQLite to avoid database locking issues.
if c.DatabaseDriver() == SQLite && numCPU > 4 && c.options.Workers <= 0 { if c.DatabaseDriver() == SQLite && numCPU >= 8 && c.options.Workers <= 0 {
return 4 return 4
} }
@ -340,7 +340,7 @@ func (c *Config) Workers() int {
} }
if numCPU > 1 { if numCPU > 1 {
return numCPU - 1 return numCPU / 2
} }
return 1 return 1