Skip to content
Prev Previous commit
Next Next commit
feat(common.socket): no magic max parallel parsers
  • Loading branch information
LarsStegman committed Oct 7, 2024
commit 7041eecdf8bbaa17ae38df1cc052861ab625ff94
11 changes: 1 addition & 10 deletions plugins/common/socket/socket.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"bufio"
"crypto/tls"
"fmt"
"github.com/shirou/gopsutil/v3/cpu"
"io"
"net"
"net/url"
Expand Down Expand Up @@ -99,15 +98,7 @@ func (cfg *Config) NewSocket(address string, splitcfg *SplitConfig, logger teleg
}

func (s *Socket) Setup() error {
if s.MaxParallelParsers == 0 {
cpus, err := cpu.Counts(true)
if err != nil {
return err
}

s.MaxParallelParsers = max(cpus/2, 1)
}

s.MaxParallelParsers = max(s.MaxParallelParsers, 1)
switch s.url.Scheme {
case "tcp", "tcp4", "tcp6":
l := newStreamListener(
Expand Down