update loop.sh.
update add fio policy Signed-off-by: Wenchao Hao <8159277+wenchao-hao@user.noreply.gitee.com>
This commit is contained in:
parent
ba54873b97
commit
7501579046
22
loop.sh
22
loop.sh
|
|
@ -6,20 +6,18 @@ function add_fio()
|
|||
{
|
||||
while :
|
||||
do
|
||||
fio_cnt=$(ps aux | grep fio -c)
|
||||
if [ $fio_cnt -gt 150 ]; then
|
||||
echo "$fio_cnt larger than 150, do not add"
|
||||
continue
|
||||
fi
|
||||
for dev in `lsscsi | grep scsi_debug | awk '{print $6}'`
|
||||
do
|
||||
inject=$[RANDOM%3]
|
||||
if [ $inject -eq 0 ] || [ $inject -eq 1 ] ; then
|
||||
disk=$(basename $dev)
|
||||
threads=$[RANDOM%31+1]
|
||||
echo "add $threads fio for $disk"
|
||||
fio -filename=/dev/$disk -name=rand_write -rw=randrw -bs=4k -direct=1 -size=1G -numjobs=$threads -runtime=240 -group_reporting 2>&1 > /dev/null &
|
||||
fi
|
||||
fio_cnt=$(ps aux | grep fio | grep $dev -c)
|
||||
if [ $fio_cnt -gt 20 ]; then
|
||||
echo "$fio_cnt larger than 20, do not add"
|
||||
continue
|
||||
fi
|
||||
|
||||
threads=$[RANDOM%5+1]
|
||||
echo "add $threads fio for $dev"
|
||||
fio -filename=$dev -name=rand_write -rw=randrw -bs=4k -direct=1 -size=1G -numjobs=$threads -runtime=240 -group_reporting 2>&1 > /dev/null &
|
||||
|
||||
done
|
||||
|
||||
sleep 10
|
||||
|
|
|
|||
Loading…
Reference in New Issue