From 6630ab7838ca9bd4c4b9e4646fe4def83e503757 Mon Sep 17 00:00:00 2001 From: ZhouPengcheng Date: Mon, 16 Oct 2023 09:24:53 +0000 Subject: [PATCH] Improved code robustness Signed-off-by: ZhouPengcheng --- examples/tuning/nginx/benchmark_result | 1 + examples/tuning/nginx/nginx_benchmark.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 examples/tuning/nginx/benchmark_result diff --git a/examples/tuning/nginx/benchmark_result b/examples/tuning/nginx/benchmark_result new file mode 100644 index 00000000..d801e22b --- /dev/null +++ b/examples/tuning/nginx/benchmark_result @@ -0,0 +1 @@ +nginx_benchmark.sh: line 17: httpress: command not found diff --git a/examples/tuning/nginx/nginx_benchmark.sh b/examples/tuning/nginx/nginx_benchmark.sh index 969402c3..196b26e8 100644 --- a/examples/tuning/nginx/nginx_benchmark.sh +++ b/examples/tuning/nginx/nginx_benchmark.sh @@ -10,4 +10,14 @@ # See the Mulan PSL v2 for more details. # Create: 2020-11-26 -httpress -n 1000000 -c 512 -t 7 -k http://localhost:80 +retry_num=0 + +while [ $retry_num -le 5 ] +do + httpress -n 1000000 -c 512 -t 7 -k http://localhost:80 > benchmark_result 2>&1 + if [ $? == 0 ];then + cat benchmark_result + break + fi + retry_num=$((retry_num + 1)) +done -- Gitee