2012/11/28 [WHD-RS] Benjamin SCHILZ <[email protected]>:
>>> Perso j'ai fait des scripts dans le ifup.d qui redistribue les IRQs réseau
>>> en round-robin sur tous mes coeurs (je les matche avec une regex).
> Un petit exemple ;)
>
Allez, câdo, drop in /etc/network/if-up.d et chmod +x, et ifdown/ifup
une des cartes. Y'a sûrement mieux à faire, mais ça marche bien pour
moi. Le mieux que j'ai trouvé c'est 3 cartes réseaux intel 8 files en
LAG LACP pour 24 coeurs sur mon matériel. La regex est sûrement à
tuner.
#!/bin/bash
# This script balances the interrupts statically.
# It only touches the interrupts specified by this regular expressions
(grepped in /proc/interrupts)
# Only active interrupts will be grepped, so please re-run the script
on post-up.
NETWORK_INTERRUPTS=' (gbe|bnx|eth|igb)[0-9]+(-TxRx)?-[0-7]$'
# Balance the interrupts on all the cores, in round-robin fashion.
total_cores=$(cat /proc/cpuinfo | grep '^processor' | wc -l)
interrupts=$(cat /proc/interrupts | egrep "${NETWORK_INTERRUPTS}" |
awk -F: "{ print \$1 }" | tr '\n' ' ')
let current_core=0;
for irq in ${interrupts};
do
affinity="$(printf "%08x" $((1 << ($current_core % $total_cores))))"
# echo "IRQ #${irq} will have affinity to ${affinity}"
echo "${affinity}" > "/proc/irq/${irq}/smp_affinity"
let current_core=$(($current_core+1))
done
--
Aurélien Guillaume
_______________________________________________
Liste de diffusion du FRsAG
http://www.frsag.org/