1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Update sqm-autorate

This commit is contained in:
Ycarus (Yannick Chabanois) 2023-08-22 12:46:35 +02:00
parent 765a1307fb
commit 8eabafb541
4 changed files with 127 additions and 60 deletions

View file

@ -1,11 +1,17 @@
#!/bin/bash
# cake-autorate automatically adjusts bandwidth for CAKE in dependence on detected load and RTT
# cake-autorate_config.sh is a script that sets up defaults for cake-autorate
# Author: @Lynx (OpenWrt forum)
# Inspiration taken from: @moeller0 (OpenWrt forum)
# defaults.sh -- default configuration values for cake-autorate.sh
#
# This file is part of cake-autorate.
#
# CAKE-AUTORATE IS HIGHLY CONFIGURABLE AND THIS FILE MAY BE
# CONSULTED IN RESPECT OF OVERRIDING VARIABLES IN A CONFIG FILE.
#
# DO NOT MODIFY THIS FILE. ANY CHANGES NEED TO BE MADE TO
# THE CONFIG FILE FOR A GIVEN INSTANCE OF CAKE-AUTORATE.
# MODIFYING THIS FILE WILL RESULT IN THE LOSS OF ANY CHANGES
# DURING AN UPDATE OR UNEXPECTED BEHAVIOR AFTER AN UPDATE
# IF THE OLD DEFAULT FILE WAS IN USE.
INTERFACE=""
@ -14,15 +20,16 @@ INTERFACE=""
output_processing_stats=1 # enable (1) or disable (0) output monitoring lines showing processing stats
output_load_stats=1 # enable (1) or disable (0) output monitoring lines showing achieved loads
output_reflector_stats=1 # enable (1) or disable (0) output monitoring lines showing reflector stats
output_summary_stats=1 # enable (1) or disable (0) output monitoring lines showing summary stats
output_cake_changes=0 # enable (1) or disable (0) output monitoring lines showing cake bandwidth changes
debug=1 # enable (1) or disable (0) out of debug lines
# This can generate a LOT of records so be careful:
log_DEBUG_messages_to_syslog=0 # enable (1) or disable (0) logging of all DEBUG records into the system log.
log_DEBUG_messages_to_syslog=0 # enable (1) or disable (0) logging of all DEBUG records into the system log.
# ** Take care with these settings to ensure you won't run into OOM issues on your router ***
# every write the cumulative write time and bytes associated with each log line are checked
# and if either exceeds the configured values below, the log log file is rotated
# and if either exceeds the configured values below, the log file is rotated
log_to_file=1 # enable (1) or disable (0) output logging to file (/tmp/cake-autorate.log)
log_file_max_time_mins=10 # maximum time between log file rotations
log_file_max_size_KB=2000 # maximum KB (i.e. bytes/1024) worth of log lines between log file rotations
@ -33,21 +40,21 @@ log_file_path_override=""
# *** STANDARD CONFIGURATION OPTIONS ***
### For multihomed setups, it is the responsibility of the user to ensure that the probes
### For multihomed setups, it is the responsibility of the user to ensure that the probes
### sent by this instance of cake-autorate actually travel through these interfaces.
### See ping_extra_args and ping_prefix_string
dl_if=ifb-wan # download interface
ul_if=wan # upload interface
# pinger selection can be any of:
# pinger binary selection can be any of:
# fping - round robin pinging (rtts)
# tsping - round robin pinging using ICMP type 13 (owds)
# ping - (iputils-ping) individual pinging (rtts)
# hping3 - individidual pinging (owds)
pinger_binary=fping
# list of reflectors to use and number of pingers to initiate
# pingers will be initiated with reflectors in the order specified in the list
# pingers will be initiated with reflectors in the order specified in the list
# additional reflectors will be used to replace any reflectors that go stale
# so e.g. if 6 reflectors are specified and the number of pingers is set to 4, the first 4 reflectors will be used initially
# and the remaining 2 reflectors in the list will be used in the event any of the first 4 go bad
@ -71,13 +78,18 @@ randomize_reflectors=1 # enable (1) or disable (0) randomization of reflectors o
no_pingers=6 # number of pingers to maintain
reflector_ping_interval_s=0.3 # (seconds, e.g. 0.2s or 2s)
# delay threshold in ms is the extent of OWD increase to classify as a delay
# owd delta threshold in ms is the extent of OWD increase to classify as a delay
# these are automatically adjusted based on maximum on the wire packet size
# (adjustment significant at sub 12Mbit/s rates, else negligible)
dl_delay_thr_ms=30 # (milliseconds)
ul_delay_thr_ms=30 # (milliseconds)
# (adjustment significant at sub 12Mbit/s rates, else negligible)
dl_owd_delta_thr_ms=30.0 # (milliseconds)
ul_owd_delta_thr_ms=30.0 # (milliseconds)
# Set either of the below to 0 to adjust one direction only
# average owd delta threshold in ms at which maximum adjust_down_bufferbloat is applied
# set value(s) to 0 to disable and always apply maximum adjust_down_bufferbloat
dl_avg_owd_delta_thr_ms=60.0 # (milliseconds)
ul_avg_owd_delta_thr_ms=60.0 # (milliseconds)
# Set either of the below to 0 to adjust one direction only
# or alternatively set both to 0 to simply use cake-autorate to monitor a connection
adjust_dl_shaper_rate=1 # enable (1) or disable (0) actually changing the dl shaper rate
adjust_ul_shaper_rate=1 # enable (1) or disable (0) actually changing the ul shaper rate
@ -92,7 +104,7 @@ max_ul_shaper_rate_kbps=35000 # maximum bandwidth for upload (Kbit/s)
# sleep functionality saves unecessary pings and CPU cycles by
# pausing all active pingers when connection is not in active use
enable_sleep_function=1 # enable (1) or disable (0) sleep functonality
enable_sleep_function=1 # enable (1) or disable (0) sleep functonality
connection_active_thr_kbps=1000 # threshold in Kbit/s below which dl/ul is considered idle
sustained_idle_sleep_thr_s=60.0 # time threshold to put pingers to sleep on sustained dl/ul achieved rate < idle_thr (seconds)
@ -135,8 +147,8 @@ ping_prefix_string=""
# interval in ms for monitoring achieved rx/tx rates
# this is automatically adjusted based on maximum on the wire packet size
# (adjustment significant at sub 12Mbit/s rates, else negligible)
monitor_achieved_rates_interval_ms=200 # (milliseconds)
# (adjustment significant at sub 12Mbit/s rates, else negligible)
monitor_achieved_rates_interval_ms=200 # (milliseconds)
# bufferbloat is detected when (bufferbloat_detection_thr) samples
# out of the last (bufferbloat detection window) samples are delayed
@ -153,21 +165,20 @@ alpha_baseline_decrease=0.9 # how rapidly baseline RTT is allowed to decrease
# OWD delta from baseline is tracked using ewma with alpha set below
alpha_delta_ewma=0.095
# rate adjustment parameters
# bufferbloat adjustment works with the lower of the adjusted achieved rate and adjusted shaper rate
# to exploit that transfer rates during bufferbloat provide an indication of line capacity
# rate adjustment parameters
# shaper rate is adjusted by a maximum of shaper_rate_max_adjust_down_bufferbloat on detection of bufferbloat
# and this is scaled by the average delta owd / average owd delta threshold
# otherwise shaper rate is adjusted up on load high, and down on load idle or low
achieved_rate_adjust_down_bufferbloat=0.9 # how rapidly to reduce achieved rate upon detection of bufferbloat
shaper_rate_adjust_down_bufferbloat=0.9 # how rapidly to reduce shaper rate upon detection of bufferbloat
shaper_rate_adjust_up_load_high=1.01 # how rapidly to increase shaper rate upon high load detected
shaper_rate_adjust_down_load_low=0.99 # how rapidly to return down to base shaper rate upon idle or low load detected
shaper_rate_adjust_up_load_low=1.01 # how rapidly to return up to base shaper rate upon idle or low load detected
shaper_rate_max_adjust_down_bufferbloat=0.75 # how rapidly to reduce shaper rate upon detection of bufferbloat
shaper_rate_adjust_up_load_high=1.01 # how rapidly to increase shaper rate upon high load detected
shaper_rate_adjust_down_load_low=0.99 # how rapidly to return down to base shaper rate upon idle or low load detected
shaper_rate_adjust_up_load_low=1.01 # how rapidly to return up to base shaper rate upon idle or low load detected
# the load is categoried as low if < high_load_thr and high if > high_load_thr relative to the current shaper rate
high_load_thr=0.75 # % of currently set bandwidth for detecting high load
# refractory periods between successive bufferbloat/decay rate changes
# the bufferbloat refractory period should be greater than the
# the bufferbloat refractory period should be greater than the
# average time it would take to replace the bufferbloat
# detection window with new samples upon a bufferbloat event
bufferbloat_refractory_period_ms=300 # (milliseconds)
@ -181,15 +192,15 @@ reflector_response_deadline_s=1.0 # (seconds)
# reflector misbehaving is detected when $reflector_misbehaving_detection_thr samples
# out of the last (reflector misbehaving detection window) samples are offences
# thus with a 1s interval, window 60 and detection_thr 3, this is tantamount to
# 3 offences within the last 60s
# 3 offences within the last 60s
reflector_misbehaving_detection_window=60
reflector_misbehaving_detection_thr=3
reflector_replacement_interval_mins=60 # how often to replace a random reflector from the present list
reflector_comparison_interval_mins=1 # how often to compare reflectors
reflector_sum_owd_baselines_delta_thr_ms=20 # max increase from min sum owd baselines before reflector rotated
reflector_owd_delta_ewma_delta_thr_ms=10 # max increase from min delta ewma before reflector rotated
reflector_comparison_interval_mins=1 # how often to compare reflectors
reflector_sum_owd_baselines_delta_thr_ms=20.0 # max increase from min sum owd baselines before reflector rotated
reflector_owd_delta_ewma_delta_thr_ms=10.0 # max increase from min delta ewma before reflector rotated
# stall is detected when the following two conditions are met:
# 1) no reflector responses within $stall_detection_thr*$ping_response_interval_us; and
@ -197,7 +208,7 @@ reflector_owd_delta_ewma_delta_thr_ms=10 # max increase from min delta ewma befo
stall_detection_thr=5
connection_stall_thr_kbps=10
global_ping_response_timeout_s=10 # timeout to set shaper rates to min on no ping response whatsoever (seconds)
global_ping_response_timeout_s=10.0 # timeout to set shaper rates to min on no ping response whatsoever (seconds)
if_up_check_interval_s=10.0 # time to wait before re-checking if rx/tx bytes files exist (e.g. from boot state or sleep recovery)