Skip to content

Instantly share code, notes, and snippets.

@oxavelar
Last active February 15, 2026 12:34
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=4500; h=6000; t=250 ;;
5) l=2500; h=5000; t=200 ;;
6) l=3000; h=6000; t=250 ;;
*) l=2500; h=5000; t=200 ;;
esac
echo 0 $((l*84/100)) $((h*88/100)) > "$phy/aql_txq_limit"
echo 1 $((l*88/100)) $((h*92/100)) > "$phy/aql_txq_limit"
echo 2 $((l*92/100)) $((h*96/100)) > "$phy/aql_txq_limit"
echo 3 $((l*96/100)) $((h*99/100)) > "$phy/aql_txq_limit"
echo $((h*t/100)) > "$phy/aql_threshold"
echo "fq_limit 2048" > "$phy/aqm"
echo "fq_quantum 256" > "$phy/aqm"
echo "fq_memory_limit $((2**24))" > "$phy/aqm"
);
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment