change the bw reading interval back to 1 sec, and dynamic rate limiter...

change the bw reading interval back to 1 sec, and dynamic rate limiter configured to increment 5% of the bw
parent 6bb02611
......@@ -121,7 +121,7 @@ def monitor_devs_ifstat(fname="rate.csv"):
def monitor_devs_ng(fname="txrate.csv" , interval_sec=0.01):
"""Uses bwm-ng tool to collect iface tx rate stats. Very reliable."""
cmd = ("sleep 5; bwm-ng -t %s -o csv "
cmd = ("sleep 1; bwm-ng -t %s -o csv "
"-u bytes -T rate -C ',' > %s" %
(interval_sec * 1000, fname))
Popen(cmd, shell=True).wait()
......
......@@ -68,7 +68,7 @@ class dynamicRateLimiter(simple_switch_13.SimpleSwitch13):
self.logger.info('usedbw: %d', usedbw)
max_rate_limit = (bandwidth / 2) #max limit = 50%
increment = (bandwidth *(0.1)) # 10% increment [bandwidth is in KBps]
increment = (bandwidth *(0.05)) # 0% increment [bandwidth is in KBps]
meterdbEntry= {
'dpid':tap.get('dpid'),
......@@ -82,7 +82,7 @@ class dynamicRateLimiter(simple_switch_13.SimpleSwitch13):
self.logger.info("Reduce the rate limiting rapidly by dividing it by 2")
new_limit = round(ratelimit/2 )
new_limitKbps = new_limit * 8 #KBps -> Kbps
self.logger.info("meterid[%d] Increase the rate[%d] for tunnel traffic",
self.logger.info("meterid[%d] Decrease the rate[%d] for tunnel traffic",
meterid, new_limit)
of = datapath.ofproto
ofp = datapath.ofproto_parser
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment