lkml.org 
[lkml]   [2020]   [Nov]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectBFS revisited.
Date
Here's a somewhat imperfect, though short script I knocked together that fixes scheduling issues.

while true
do
for i in `iotop -P -b -q -o -d 0.1 -n 10 | awk -F ' ' '{if ( $1 ~ /[0-9]/ && $10 > 10) print $1}'`
do
ionice -c 3 -p $i
echo "process $i reniced to idel as it was hogging io"
done
for i in `top -b -d 0.1 -n 10 | awk -F ' ' '{if ( $1 ~ /[0-9]/ && $4 == 0 && $9 > 15) print $1}'`
do
renice -n 10 -p $i
echo "process $i reniced to idel as it was hogging cpu"
done
for i in `top -b -d 0.1 -n 10 | awk -F ' ' '{if ( $1 ~ /[0-9]/ && $4 == 10 && $9 < 10) print $1}'`
do
renice -n 0 -p $i
echo "process $i reniced to idel as it stopped hogging cpu"
done
sleep 0.5
done

\
 
 \ /
  Last update: 2020-11-01 17:21    [W:0.030 / U:0.572 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site