irq_balance_habrahabr.sh
#!/bin/bash | |
# from http://habrahabr.ru/post/108240/ | |
ncpus=`grep -ciw ^processor /proc/cpuinfo` | |
test "$ncpus" -gt 1 || exit 1 | |
n=0 | |
for irq in `cat /proc/interrupts | grep eth | awk '{print $1}' | sed s/\://g` | |
do | |
f="/proc/irq/$irq/smp_affinity" | |
test -r "$f" || continue | |
cpu=$[$ncpus - ($n % $ncpus) - 1] | |
if [ $cpu -ge 0 ] | |
then | |
mask=`printf %x $[2 ** $cpu]` | |
echo "Assign SMP affinity: eth queue $n, irq $irq, cpu $cpu, mask 0x$mask" | |
echo "$mask" > "$f" | |
let n+=1 | |
fi | |
done |
This comment has been minimized.
This comment has been minimized.
hit0ri
commented
Jun 25, 2015
You can replace line 4 with this: |
This comment has been minimized.
This comment has been minimized.
Thanks for feedback! But it's very draft tool and you could fix it as you want :) |
This comment has been minimized.
This comment has been minimized.
SaveTheRbtz
commented
Nov 26, 2016
Intel provides |
This comment has been minimized.
This comment has been minimized.
jwbensley
commented
Sep 9, 2017
•
@hit0ri - The problem with
|
This comment has been minimized.
This comment has been minimized.
Jordynhollander
commented
Nov 15, 2018
(dont ask me why, hehe) On php
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
unconditional commentedJun 25, 2015
http://www.smallo.ruhr.de/award.html is yours
cat /proc/interrupts | grep eth | awk '{print $1}' | sed s/\://g
-->
awk -F"[ :]" '/eth/{print $1}' /proc/interrupts