]> johannes.truschnigg.info Git - sqm_lagthrottle/commitdiff
Move consec_timeouts detection behind rate-limiting guard
authorJohannes Truschnigg <johannes@truschnigg.info>
Thu, 17 Mar 2022 18:30:53 +0000 (19:30 +0100)
committerJohannes Truschnigg <johannes@truschnigg.info>
Thu, 17 Mar 2022 18:30:53 +0000 (19:30 +0100)
__lagdetect.awk
lagdetect.sh

index 0367ca27cfdc4f7cf9cbe6460311592c503d7e1d..64f64916e107295017d9bb269a8db7d7fb72cbbb 100644 (file)
@@ -175,6 +175,12 @@ function process_record(pn, bytes, lat) {
 function adjust_sqm(peername, latency) {
   adjust_ts_delta = (ts - adjust_old)
 
+  # do not try to set bw more than once a second
+  if (adjust_ts_delta < 1.0) {
+    # print "# " ts " looping too fast, skipping SQM update adjust_ts_delta=" adjust_ts_delta
+    return
+  }
+
   # Assume links are clogged, so we short-circuit a bandwidth collapse
   if (consec_timeouts > ((1.5 * peer_count) + 2)) {
     print "# " ts " --- TIMEOUT-caused bw collapse triggered"
@@ -185,11 +191,6 @@ function adjust_sqm(peername, latency) {
     return
   }
 
-  # do not try to set bw more than once a second
-  if (adjust_ts_delta < 1.0) {
-    # print "# " ts " looping too fast, skipping SQM update adjust_ts_delta=" adjust_ts_delta
-    return
-  }
 
   # XXX TODO - this needs to get MUCH better!
   # 1.) FUDGE needs to be properly accounted in BW increase path
index 840d40ea1ec348fc1e28a8937422ca6646805560..f53687f65dc7cae8009a456a10431a46afb460f4 100755 (executable)
@@ -11,7 +11,7 @@ PING_GW_IPV6=no # do not use - broken
 PING_SLOTS_PER_PEER=5 # number of samples per PING_PEER to collet averages over
 PING_INTERVAL=300 # interval in msec to emit ICMP ECHO towards each PING_PEER
 STATS_RX='/sys/class/net/eth1/statistics/rx_bytes' # downstream bandwidth accounting file for your SQM'd interface
-IFACE_RX='eth1' # interface to apply downstream SQM to
+IFACE_RX='ifb4eth1' # interface to apply downstream SQM to
 STATS_TX='/sys/class/net/eth1/statistics/tx_bytes' # upstream bandwidth accounting file for your SQM'd interface (presently not used)
 IFACE_TX='eth1' # interface to apply downstream SQM to (presently not used)
 BW_MIN_RX=10000 # your min. acceptable downstream bandwidth to shape to in Kbps