From cf6ebe0911528f099685b4a3be17507258857c55 Mon Sep 17 00:00:00 2001 From: emeric Date: Sun, 8 Nov 2020 14:28:38 +0100 Subject: [PATCH] Reserve at least two threads on mono core systems (on autodetect) --- src/lms/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lms/main.cpp b/src/lms/main.cpp index c75b9cc1..202b71d7 100644 --- a/src/lms/main.cpp +++ b/src/lms/main.cpp @@ -77,7 +77,8 @@ generateWtConfig(std::string execPath) args.push_back("--accesslog=" + wtAccessLogFilePath.string()); { - const unsigned long httpServerThreadCount {configHttpServerThreadCount ? configHttpServerThreadCount : std::max(1, std::thread::hardware_concurrency())}; + // Reserve at least 2 threads since we still have some blocking IO (for example when reading from ffmpeg) + const unsigned long httpServerThreadCount {configHttpServerThreadCount ? configHttpServerThreadCount : std::max(2, std::thread::hardware_concurrency())}; args.push_back("--threads=" + std::to_string(httpServerThreadCount)); }