Turns out one OS thread isn't enough
This commit is contained in:
1 parent
2649796369
commit
971f6a63fd
1 file changed
+7
-1
+7
-1
@@ -46,7 +46,13 @@ func main() {
|
|||||||
log.SetPrefix(weave.Protocol + " ")
|
log.SetPrefix(weave.Protocol + " ")
|
||||||
log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds)
|
log.SetFlags(log.Ldate | log.Ltime | log.Lmicroseconds)
|
||||||
|
|
||||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
procs := runtime.NumCPU()
|
||||||
|
// packet sniffing can block an OS thread, so we need one thread
|
||||||
|
// for that plus at least one more.
|
||||||
|
if procs < 2 {
|
||||||
|
procs = 2
|
||||||
|
}
|
||||||
|
runtime.GOMAXPROCS(procs)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
ifaceName string
|
ifaceName string
|
||||||
|
|||||||
Reference in new issue
Block a user