From 8627153288373b9560adaf5998e715d58fd9bd80 Mon Sep 17 00:00:00 2001 From: Michael Mayer Date: Sat, 9 Jan 2021 04:44:36 +0100 Subject: [PATCH] Config: Reduce workers default CPUs with with hyper-threading can't properly manage the load otherwise. --- internal/config/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/config/config.go b/internal/config/config.go index 7f4cc99a4..a797766fb 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -331,7 +331,7 @@ func (c *Config) Workers() int { numCPU := runtime.NumCPU() // 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 } @@ -340,7 +340,7 @@ func (c *Config) Workers() int { } if numCPU > 1 { - return numCPU - 1 + return numCPU / 2 } return 1