Index: utils/loadrunner ================================================================== --- utils/loadrunner +++ utils/loadrunner @@ -25,10 +25,17 @@ sh -c "cd $CURRWD;export DISPLAY=$DISPLAY; export PATH=$PATH; nohup $* > $TARGETHOST_LOGF 2>&1 &" else ssh -n -f $TARGETHOST "sh -c \"cd $CURRWD;export DISPLAY=$DISPLAY; export PATH=$PATH; nohup $* > $TARGETHOST_LOGF 2>&1 &\"" fi } + +function get_delay_time () { + RANGE=$1 + number=$RANDOM + let "number %= $RANGE" + echo $number +} if which cpucheck > /dev/null;then numcpu=`cpucheck|tail -1|awk '{print $6}'` elif which lscpu > /dev/null;then numcpu=`lscpu|grep "CPU.s.:"|awk '{print $2}'` @@ -63,7 +70,7 @@ else # echo "Load too high: lperc=$lperc, max_load=$max_load, waiting two minutes before trying to run command: \"$@\"" echo "$LOADRUNNER $@" | at now + 2 minutes 2> /dev/null fi -sleep 4 +sleep $(get_delay_time 10) rm -f $lfile