Skip to content

Commit

Permalink
change default num of io eventloop to NumCPU()/4 or 1
Browse files Browse the repository at this point in the history
  • Loading branch information
lesismal committed Feb 17, 2024
1 parent d3b0b40 commit e18162a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nbhttp/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,10 @@ func NewEngine(conf Config) *Engine {
conf.MaxLoad = DefaultMaxLoad
}
if conf.NPoller <= 0 {
conf.NPoller = 1
conf.NPoller = runtime.NumCPU() / 4
if conf.NPoller == 0 {
conf.NPoller = 1
}
}
if conf.ReadLimit <= 0 {
conf.ReadLimit = DefaultHTTPReadLimit
Expand Down

0 comments on commit e18162a

Please sign in to comment.