mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 18:18:55 +00:00
There is another channel which we didn't yet increase in size, the one between the allocation and the main task loop. Increasing to 1000 means each allocation can potentially buffer 65MB of data. With the biggest port range (16383 allocations), that would be a theoretical memory consumption of ~ 1TB. But, this would imply that we have 16383 connected clients that all send data at max speed, saturating our downlink and our uplink is somehow ridiculously small. As long as up and downlink are roughly within the same ballpark figure, it should be impossible to actually fill up these buffers. I suspect that the current packet drops of the iperf test are happening because on localhost, sending 10 UDP packets is so quick that a tokio is unable to wake up the task in time to empty the queue. In addition to the increased channel size, I've also added a check for the other channels to avoid writing to them in case they are not ready for some reason. --------- Co-authored-by: Jamil <jamilbk@users.noreply.github.com>