diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2019-01-25 14:15:58 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2019-01-25 14:15:58 +0200 |
commit | 5505a178a0e8b839f67d489121bd57ee8e01bf52 (patch) | |
tree | f336d65ca85a272b218944e41dbdc4354fbbf4a0 | |
parent | 56117d5e053f1fdf2577dc89d7f4aa37faf0d5e3 (diff) |
Increase network queue sizes for better reliability under high load
-rw-r--r-- | bbot/agent/machine.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/bbot/agent/machine.cxx b/bbot/agent/machine.cxx index db51e0b..14b4e21 100644 --- a/bbot/agent/machine.cxx +++ b/bbot/agent/machine.cxx @@ -96,6 +96,13 @@ namespace bbot run_exit (trace, "sudo", "ip", "tuntap", "delete", t, "mode", "tap"); run (trace, "sudo", "ip", "tuntap", "add", t, "mode", "tap", "user", uid); + + // Increase the transmission queue from default 1000 to prevent dropping + // packets under high load. See also rx/tx_queue_size in the QEMU + // networking setup (it's fuzzy how this is all related to each other). + // + run (trace, "sudo", "ip", "link", "set", t, "txqueuelen", "10000"); + run (trace, "sudo", "ip", "link", "set", t, "up"); run (trace, "sudo", "ip", "link", "set", t, "master", br); @@ -289,8 +296,14 @@ namespace bbot // Network. // + // The rx/tx queue size is between 256 (default) and 1024 and must be a + // power of 2. Also, maximum (1024) requires some extra support from the + // guest driver so we start with 512. + // add ("-netdev", "tap,id=net0,script=no,ifname=" + net.iface); - add ("-device", "virtio-net-pci,netdev=net0,mac=" + mac); + add ("-device", ("virtio-net-pci,netdev=net0,mac=" + mac + + ",tx_queue_size=512" + + ",rx_queue_size=512")); // Disk. // |