Skip to content

Commit

Permalink
add back configurable channel buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Feb 17, 2024
1 parent a38d41a commit 4bac2a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions fog.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion pkg/fog/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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)
}

Expand Down

0 comments on commit 4bac2a1

Please sign in to comment.