From d21b30bd64fdf4e7358037aa2d6f0cea02c49b6e Mon Sep 17 00:00:00 2001 From: Jesper Dangaard Brouer Date: Sun, 27 Apr 2014 18:09:38 +0200 Subject: trafgen: performance regression at 10G due to smaller ring buffer size commit c10621e ("trafgen: keep a small initial ring buffer size to reduce cache-misses") reduced default ring buffer size to 196KiB, but on my big machines with 10Gbit/s this size is too small. Increase default ring-size to 512 KiB, yield the best results, without increasing ring buffer size too much, this fixes #120. Single CPU results from my E5-2630 CPU with intel ixgbe/82599. (Cmd: trafgen --cpp --dev eth8 --conf udp_example01.trafgen --cpu 1) * 769,440 pkts/sec -- default ring-size 196 KiB * 1,417,908 pkts/sec -- ring-size 500 KiB Going above CPUs L3 cache size which is (15Mb) * 1,236,580 pkts/sec -- ring-size 20000KiB The mmap'ed ring buffer is now faster than using sendto(). For comparison, not using the ring-buffer, by using option "-t0": * 1,381,364 (with qdisc bypass) And using the qdisc code path in the kernel (enable via parameter "--qdisc-path") * 1,227,772 pkts/sec (with --qdisc-path) Signed-off-by: Jesper Dangaard Brouer --- trafgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trafgen.c b/trafgen.c index af15ef2..66be7d6 100644 --- a/trafgen.c +++ b/trafgen.c @@ -875,7 +875,7 @@ int main(int argc, char **argv) ctx.qdisc_path = false; /* Keep an initial small default size to reduce cache-misses. */ - ctx.reserve_size = 196 * (1 << 10); + ctx.reserve_size = 512 * (1 << 10); while ((c = getopt_long(argc, argv, short_options, long_options, &opt_index)) != EOF) { -- cgit v1.2.3-54-g00ecf