The use of shell script AB every 30 minutes concurrent, 10 minutes rest

Time:2020-10-17

1、 The script is as follows:

#!/bin/bash
Echo "program starts!"
Echo "the program stops every 15 minutes and takes a 10 minute break"
while true
do
 Echo "this cycle begins to execute! This concurrent test is 30 minutes! "
 ab -n 738100 -c 410 https://mybank.nbcb.com.cn/cc-test
 Echo "take a 10 minute break at the end of this round of test!"
 sleep 10m
done
Echo "program test finished! "

2、 Use shell scripts to monitor the process and restart it if it stops

#!/bin/bash
Echo "start abtest program!"
while [ 1 ] ; do
 echo "  abtest.sh  The program has been restarted“
 sleep 10s
 result=`pidof -x abtest.sh
 if [ -z "$result" ];then
 echo "process is finished"
 flag=0
 fi
 sh
 echo "  abtes.sh Program hung, please restart! "
done
sh abtest.sh

summary

The above is the use of shell script introduced by Xiaobian to you. AB takes a 10 minute break every 30 minutes. I hope it will be helpful to you. If you have any questions, please leave me a message, and the editor will reply you in time. Thank you very much for your support to the developeppaer website!
If you think this article is helpful to you, welcome to reprint, please indicate the source, thank you!