mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-02 22:10:25 +08:00
再次提升节点默认读写线程数限制
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user