Skip to content

Instantly share code, notes, and snippets.

@oxavelar
Last active January 19, 2026 03:38
Show Gist options
  • Select an option

  • Save oxavelar/f3b2e6dc3930a0b90df3959803b4e742 to your computer and use it in GitHub Desktop.

Select an option

Save oxavelar/f3b2e6dc3930a0b90df3959803b4e742 to your computer and use it in GitHub Desktop.
Linux AQL Adjustments
for phy in $(find /sys/kernel -name 'phy[0-9]'); do
(case "$(iw phy "$(basename "$phy")" info 2>/dev/null | awk '/\* [0-9.]+ MHz/ {print ($2<3000?"2.4":$2<6000?"5":"6");exit}')" in
2.4) l=3500; h=6000; t=110 ;;
5) l=5000; h=8000; t=150 ;;
6) l=6000; h=9000; t=200 ;;
*) l=5000; h=8000; t=150 ;;
esac
echo 0 $l $((h*35/100)) > "$phy/aql_txq_limit"
echo 1 $((l*35/100)) $((h*40/100)) > "$phy/aql_txq_limit"
echo 2 $((l*50/100)) $((h*50/100)) > "$phy/aql_txq_limit"
echo 3 $((l*55/100)) $((h*60/100)) > "$phy/aql_txq_limit"
echo $((h*t/100)) > "$phy/aql_threshold"
echo "fq_limit 4096" > "$phy/aqm"
echo "fq_quantum 64" > "$phy/aqm"
echo "fq_memory_limit $((2**25))" > "$phy/aqm"
);
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment