Skip to content
Snippets Groups Projects
Commit 9e005b50 authored by Kanzhe Jiang's avatar Kanzhe Jiang
Browse files

Adjust the max system load assumption for flow reconciliation

parent a4055b45
No related branches found
No related tags found
No related merge requests found
......@@ -60,7 +60,7 @@ public class FlowReconcileManager
String controllerPktInCounterName;
protected SimpleCounter lastPacketInCounter;
protected static int MAX_SYSTEM_LOAD_PER_SECOND = 500000;
protected static int MAX_SYSTEM_LOAD_PER_SECOND = 50000;
/** a minimum flow reconcile rate so that it won't stave */
protected static int MIN_FLOW_RECONCILE_PER_SECOND = 1000;
......@@ -364,13 +364,17 @@ public class FlowReconcileManager
// Update the last packetInCounter
lastPacketInCounter = (SimpleCounter)
SimpleCounter.createCounter(pktInCounter);
if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) >
int capacity = minFlows;
if ((pktInRate + MIN_FLOW_RECONCILE_PER_SECOND) <=
MAX_SYSTEM_LOAD_PER_SECOND) {
return minFlows;
} else {
return (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
capacity = (MAX_SYSTEM_LOAD_PER_SECOND - pktInRate)
* FLOW_RECONCILE_DELAY_MILLISEC / 1000;
}
if (logger.isTraceEnabled()) {
logger.trace("Capacity is {}", capacity);
}
return capacity;
}
protected int getPktInRate(ICounter newCnt, Date currentTime) {
......
......@@ -34,7 +34,7 @@ public class FlowReconcileMgrTest extends FloodlightTestCase {
OFStatisticsRequest ofStatsRequest;
protected int NUM_FLOWS_PER_THREAD = 1000;
protected int NUM_FLOWS_PER_THREAD = 100;
protected int NUM_THREADS = 100;
@Before
......@@ -329,7 +329,7 @@ public class FlowReconcileMgrTest extends FloodlightTestCase {
flowReconcileMgr.controllerPktInCounterName))
.andReturn(newCnt)
.times(1);
long initPktInCount = 100000;
long initPktInCount = 10000;
newCnt.increment(currentTime, initPktInCount);
replay(counterStore);
......@@ -345,7 +345,7 @@ public class FlowReconcileMgrTest extends FloodlightTestCase {
newCnt = (SimpleCounter)SimpleCounter.createCounter(
currentTime, CounterType.LONG);
currentTime = new Date(currentTime.getTime() + 200);
long nextPktInCount = 300000;
long nextPktInCount = 30000;
newCnt.increment(currentTime, nextPktInCount);
expect(counterStore.getCounter(
......@@ -390,7 +390,7 @@ public class FlowReconcileMgrTest extends FloodlightTestCase {
flowReconcileMgr.controllerPktInCounterName))
.andReturn(newCnt)
.anyTimes();
long initPktInCount = 100000;
long initPktInCount = 10000;
newCnt.increment(currentTime, initPktInCount);
IFlowReconcileListener r1 =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment