diff --git a/fog.conf b/fog.conf index b67bcef..66efd15 100644 --- a/fog.conf +++ b/fog.conf @@ -16,6 +16,8 @@ log_files = 0 buffer_udp = 1048576 # FW_BUFFER_PACKET: This is the size of the read buffer per packet. buffer_packet = 102400 +# FW_BUFFER_CHANNEL: This is the channel buffer between the listeners and processors. +buffer_channel = 1024 # FW_LISTENERS: How many UDP socket listener threads to start. listeners = 1 # FW_PROCESSORS: How many packet processor threads to start. diff --git a/pkg/fog/start.go b/pkg/fog/start.go index dc9330c..f63930c 100644 --- a/pkg/fog/start.go +++ b/pkg/fog/start.go @@ -29,6 +29,7 @@ type Config struct { LogFiles uint `toml:"log_files" xml:"log_files"` BufferUDP uint `toml:"buffer_udp" xml:"buffer_udp"` BufferPacket uint `toml:"buffer_packet" xml:"buffer_packet"` + BufferChan uint `toml:"buffer_chan" xml:"buffer_chan"` Listeners uint `toml:"listeners" xml:"listeners"` Processors uint `toml:"processors" xml:"processors"` Debug bool `toml:"debug" xml:"debug"` @@ -101,7 +102,7 @@ func (c *Config) setup() { c.Listeners = 1 } - c.packets = make(chan *packet, 1) + c.packets = make(chan *packet, c.BufferChan) c.willow = willow.NeWillow(c.Config) }