From: Chi-Vien Ly Date: Fri, 19 Jul 2013 17:34:58 +0000 (-0700) Subject: Make statistic queue size configurable via config.ini X-Git-Tag: releasepom-0.1.0~272^2 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=7003730382163cfce52d89b0bd08491097a389dc Make statistic queue size configurable via config.ini Currently the queue size is fixed at 64. For large network support, this can't accommodate large network support. This enhancement is to make this size configurable through config.ini. A new system parameter is created "of.statsQueueSize" and is default to 64 (same as today). Change-Id: I0f9c02ee3228a51ba3ec8ad2047dfff8ddae50a1 Signed-off-by: Chi-Vien Ly --- diff --git a/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini b/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini index 6bf09bb368..b99b4bfdca 100644 --- a/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini +++ b/opendaylight/distribution/opendaylight/src/main/resources/configuration/config.ini @@ -50,6 +50,8 @@ org.eclipse.gemini.web.tomcat.config.path=configuration/tomcat-server.xml # of.messageResponseTimer=2000 # The switch liveness timeout value (default 60500 msec) # of.switchLivenessTimeout=60500 +# The size of the queue holding pending statistics requests (default 64). For large networks of n switches, it is recommended to set the queue size to n +# of.statsQueueSize = 64 # The flow statistics polling interval in second (default 10 sec) # of.flowStatsPollInterval=10 # The port statistics polling interval in second (default 5 sec) diff --git a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java index 3c02c17628..bae49d511a 100644 --- a/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java +++ b/opendaylight/protocol_plugins/openflow/src/main/java/org/opendaylight/controller/protocol_plugin/openflow/internal/OFStatisticsManager.java @@ -155,6 +155,20 @@ IInventoryShimExternalListener, CommandProvider { } } + private short getStatsQueueSize() { + String statsQueueSizeStr = System.getProperty("of.statsQueueSize"); + short statsQueueSize = INITIAL_SIZE; + if (statsQueueSizeStr != null) { + try { + statsQueueSize = Short.parseShort(statsQueueSizeStr); + if (statsQueueSize <= 0) { + statsQueueSize = INITIAL_SIZE; + } + } catch (Exception e) { + } + } + return statsQueueSize; + } /** * Function called by the dependency manager when all the required * dependencies are satisfied @@ -166,8 +180,8 @@ IInventoryShimExternalListener, CommandProvider { portStatistics = new ConcurrentHashMap>(); tableStatistics = new ConcurrentHashMap>(); dummyList = new ArrayList(1); + pendingStatsRequests = new LinkedBlockingQueue(getStatsQueueSize()); statisticsTimerTicks = new ConcurrentHashMap(INITIAL_SIZE); - pendingStatsRequests = new LinkedBlockingQueue(INITIAL_SIZE); switchPortStatsUpdated = new LinkedBlockingQueue(INITIAL_SIZE); switchSupportsVendorExtStats = new ConcurrentHashMap(INITIAL_SIZE); txRates = new HashMap>(INITIAL_SIZE);