From e2f9fb73a98c027fbb1c62c949ea1753e5cb83c7 Mon Sep 17 00:00:00 2001 From: Derek Collison Date: Mon, 13 Feb 2023 18:44:25 +0200 Subject: [PATCH] Increase limit for internal blocking IO vs num cores. Will help in slow IO situations and lots of expire cache calls. Signed-off-by: Derek Collison --- server/filestore.go | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/server/filestore.go b/server/filestore.go index c4da271e..87b6a352 100644 --- a/server/filestore.go +++ b/server/filestore.go @@ -30,7 +30,6 @@ import ( "net" "os" "path/filepath" - "runtime" "sort" "strings" "sync" @@ -6449,12 +6448,8 @@ var dios chan struct{} // Used to setup our simplistic counting semaphore using buffered channels. // golang.org's semaphore seemed a bit heavy. func init() { - // Minimum for blocking disk IO calls. - const minNIO = 4 - nIO := runtime.GOMAXPROCS(0) - if nIO < minNIO { - nIO = minNIO - } + // Based on Go max threads of 10k, limit ourselves to a max of 1k blocking IO calls. + const nIO = 1024 dios = make(chan struct{}, nIO) // Fill it up to start. for i := 0; i < nIO; i++ {