bridge: Only store instant_stats on device changes
authorJoe Stringer <joestringer@nicira.com>
Fri, 13 Dec 2013 03:33:49 +0000 (03:33 +0000)
committerEthan Jackson <ethan@nicira.com>
Thu, 12 Dec 2013 23:08:21 +0000 (15:08 -0800)
commit7f8f2757f3d6749f832f9fe2c0229d6587cfbad9
treefbb76b77112fb4bc98895b5e21e4a90346104cb8
parentf23d157c05649d369c5456e9a18bb47716306893
bridge: Only store instant_stats on device changes

Previously, we iterated through all interfaces in instant_stats_run(),
grabbing up-to-date information about device and port status. After
assembling all of this information for all interfaces, we would
determine whether anything changed and only send an update to
ovsdb-server if something changed.

This patch uses the new global connectivity_seq to determine whether
there have been any changes before polling all interfaces, which reduces
unnecessary processing in the average case. In a test environment of
5000 internal ports and 50 tunnel ports with bfd, this reduces average
CPU usage of the main thread from about 15% to about 5%. When ports
change status more often than every 100ms, CPU usage is expected to
increase to previous rates.

Signed-off-by: Joe Stringer <joestringer@nicira.com>
Signed-off-by: Ethan Jackson <ethan@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>
vswitchd/bridge.c