From 6f20c4ec394d6a7e39bb7dd2219b09ef29e668e5 Mon Sep 17 00:00:00 2001 From: Johannes Truschnigg Date: Thu, 17 Mar 2022 19:30:53 +0100 Subject: [PATCH] Move consec_timeouts detection behind rate-limiting guard --- __lagdetect.awk | 11 ++++++----- lagdetect.sh | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/__lagdetect.awk b/__lagdetect.awk index 0367ca2..64f6491 100644 --- a/__lagdetect.awk +++ b/__lagdetect.awk @@ -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 diff --git a/lagdetect.sh b/lagdetect.sh index 840d40e..f53687f 100755 --- a/lagdetect.sh +++ b/lagdetect.sh @@ -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 -- 2.39.5