siege4压测脚本示例

agent="Siege 1.0"
rcconfig="/opt/siege4.0/etc/siegerc"
concurrent=$1
repet=$2
url="/opt/siege4.0/etc/$3"

for runTime in `seq 1 $repet`
do
if(($4==1))
then
`nohup /opt/siege4.0/bin/siege -c $concurrent -r $repet -i -b -f $url -R $rcconfig -A "$agent" >/dev/null &`
echo $runTime
else
/opt/siege4.0/bin/siege -c $concurrent -r $repet -i -b -f $url -R $rcconfig -A "$agent" &
echo $runTime
fi
done

vconfig="/opt/siege4.0/etc/siegerc"
vtoken=""
vtype="content-type:application/x-www-form-urlencoded;charset=utf-8"
vagent=""
vrequestUrls=$1
vprocessNumbers=$2
vconcurrentNumbers=$1
vrunTimes=$3
vflag=$4

for pn in `seq 1 $vprocessNumbers`
do
if(($vflag==1))
then
`nohup /opt/siege4/bin/siege -c $vconcurrentNumbers -t $vrunTimes -b -H $vtoken -T $vtype -A $vagent -f $vrequestUrls -R $vconfig >/dev/null &`
#echo $runTime
else
/opt/siege4/bin/siege -c $vconcurrentNumbers -t $vrunTimes -b -H $vtoken -T $vtype -A $vagent -f $vrequestUrls -R $vconfig &
#echo $runTime
fi
done

原文地址:https://www.cnblogs.com/NiceTime/p/8567689.html