mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-20 04:50:26 +08:00
再次提升节点默认读写线程数限制
This commit is contained in:
@@ -8,8 +8,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var maxThreads = runtime.NumCPU()
|
var maxThreads = runtime.NumCPU()
|
||||||
var WriterLimiter = NewLimiter(max(maxThreads*8, 16))
|
var WriterLimiter = NewLimiter(max(maxThreads*16, 32))
|
||||||
var ReaderLimiter = NewLimiter(max(maxThreads*8, 16))
|
var ReaderLimiter = NewLimiter(max(maxThreads*16, 32))
|
||||||
|
|
||||||
type Limiter struct {
|
type Limiter struct {
|
||||||
threads chan struct{}
|
threads chan struct{}
|
||||||
@@ -19,8 +19,8 @@ type Limiter struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewLimiter(threads int) *Limiter {
|
func NewLimiter(threads int) *Limiter {
|
||||||
if threads < 16 {
|
if threads < 32 {
|
||||||
threads = 16
|
threads = 32
|
||||||
}
|
}
|
||||||
if threads > 1024 {
|
if threads > 1024 {
|
||||||
threads = 1024
|
threads = 1024
|
||||||
|
|||||||
Reference in New Issue
Block a user