再次提升节点默认读写线程数限制

This commit is contained in:
GoEdgeLab
2024-05-05 22:12:28 +08:00
parent ff823d326d
commit 8a81a4ef68

View File

@@ -8,8 +8,8 @@ import (
)
var maxThreads = runtime.NumCPU()
var WriterLimiter = NewLimiter(max(maxThreads*8, 16))
var ReaderLimiter = NewLimiter(max(maxThreads*8, 16))
var WriterLimiter = NewLimiter(max(maxThreads*16, 32))
var ReaderLimiter = NewLimiter(max(maxThreads*16, 32))
type Limiter struct {
threads chan struct{}
@@ -19,8 +19,8 @@ type Limiter struct {
}
func NewLimiter(threads int) *Limiter {
if threads < 16 {
threads = 16
if threads < 32 {
threads = 32
}
if threads > 1024 {
threads = 1024