Update tweaking.sh
This commit is contained in:
parent
0a2483d53f
commit
bbee0103dd
29
tweaking.sh
29
tweaking.sh
|
@ -45,7 +45,7 @@ function Network_Other_Tweaking {
|
|||
apt-get -qqy install net-tools
|
||||
ifconfig $interface txqueuelen 10000
|
||||
sleep 1
|
||||
#Other 2
|
||||
#Increaseing the congestion windows
|
||||
iproute=$(ip -o -4 route show to default)
|
||||
ip route change $iproute initcwnd 25 initrwnd 25
|
||||
}
|
||||
|
@ -57,35 +57,30 @@ function Scheduler_Tweaking {
|
|||
normal_1; echo "Changing I/O Scheduler"; warn_2
|
||||
i=1
|
||||
drive=()
|
||||
#List out all the available drives
|
||||
disk=$(lsblk -nd --output NAME)
|
||||
#Count the number of drives
|
||||
diskno=$(echo $disk | awk '{print NF}')
|
||||
#Putting the device name in an array to loop through later
|
||||
while [ $i -le $diskno ]
|
||||
do
|
||||
device=$(echo $disk | awk -v i=$i '{print $i}')
|
||||
drive+=($device)
|
||||
i=$(( $i + 1 ))
|
||||
done
|
||||
i=1
|
||||
x=0
|
||||
disk_name=$(printf $(lsblk | grep -m1 'disk' | awk '{print $1}'))
|
||||
disktype=$(cat /sys/block/$disk_name/queue/rotational)
|
||||
i=1 x=0
|
||||
#Changing the scheduler per disk depending on whether they are HDD or SSD
|
||||
while [ $i -le $diskno ]
|
||||
do
|
||||
diskname=$(eval echo ${drive["$x"]})
|
||||
disktype=$(cat /sys/block/$diskname/queue/rotational)
|
||||
if [ "${disktype}" == 0 ]; then
|
||||
while [ $i -le $diskno ]
|
||||
do
|
||||
diskname=$(eval echo ${drive["$x"]})
|
||||
echo kyber > /sys/block/$diskname/queue/scheduler
|
||||
i=$(( $i + 1 ))
|
||||
x=$(( $x + 1 ))
|
||||
done
|
||||
else
|
||||
while [ $i -le $diskno ]
|
||||
do
|
||||
diskname=$(eval echo ${drive["$x"]})
|
||||
echo mq-deadline > /sys/block/$diskname/queue/scheduler
|
||||
i=$(( $i + 1 ))
|
||||
x=$(( $x + 1 ))
|
||||
done
|
||||
fi
|
||||
i=$(( $i + 1 )) x=$(( $x + 1 ))
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue