more ram -> more speed

This commit is contained in:
JackDoan
2026-07-13 18:56:07 -05:00
parent 7896f2093b
commit 1c9d8bcceb
4 changed files with 22 additions and 5 deletions
+8
View File
@@ -435,6 +435,14 @@ func (f *Interface) listenIn(reader tio.Queue, i int) {
for _, pkt := range pkts {
f.consumeInsidePacket(pkt, fwPacket, nb, sb, rejectBuf, i, conntrackCache.Get())
// Flush incrementally once a full sendmmsg batch has
// accumulated so the first packets of a deep read drain
// hit the wire while the rest are still being encrypted.
if sb.Len() >= batch.SendBatchCap {
if err := sb.Flush(); err != nil {
f.l.Error("Failed to write outgoing batch", "error", err, "writer", i)
}
}
}
if err := sb.Flush(); err != nil {
f.l.Error("Failed to write outgoing batch", "error", err, "writer", i)