netlink-socket: Increase Netlink socket receive buffer size.
authorBen Pfaff <blp@nicira.com>
Fri, 16 Mar 2012 04:15:38 +0000 (21:15 -0700)
committerBen Pfaff <blp@nicira.com>
Fri, 16 Mar 2012 04:46:29 +0000 (21:46 -0700)
commitd195b2f49b0ddfec8a65aa1a7b7336e8c6938d64
tree768470aa4f05be33e7b03fcd926841d3b326455c
parent581e574abec39c43409aa4612afcc917843fe2f4
netlink-socket: Increase Netlink socket receive buffer size.

Open vSwitch userspace can set up flows at a high rate, but it is somewhat
"bursty" in opportunities to set up flows, by which I mean that OVS sets up
a batch of flows, then goes off and does some other work for a while, then
sets up another batch of flows, and so on.  The result is that, if a large
number of packets that need flow setups come in all at once, then some of
them can overflow the relatively small kernel-to-user buffers.

This commit increases the kernel-to-user buffers from the default of
approximately 120 kB each to 1 MB each.  In one somewhat synthetic test
case that I ran based on an "hping3" that generated a load of about 20,000
new flows per second (including both requests and replies), this reduced
the packets dropped at the kernel-to-user interface from about 30% to none.
I expect that it will similarly improve packet loss in workloads where
flow arrival is not easily predictable.

(This has little effect on workloads generated by "ovs-benchmark rate"
because that benchmark is effectively "self-clocking", that is, a new flow
is triggered only by a reply to a request made earlier, which means that
the number of buffered packets at any given has a known, constant upper
limit.)

Bug #10210.
Signed-off-by: Ben Pfaff <blp@nicira.com>
include/sparse/sys/socket.h
lib/netlink-socket.c