From 4342a9123e1c86319f0dfa168d6440636a504907 Mon Sep 17 00:00:00 2001 From: DZC <9535280+douzhichong@user.noreply.gitee.com> Date: Fri, 8 Mar 2024 09:50:06 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=96=B0=E5=BB=BAredis=E6=80=A7=E8=83=BD?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=B5=8B=E8=AF=95=E5=A5=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/redis/install.sh | 19 +++++++++++++++ tests/redis/run.sh | 55 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 tests/redis/install.sh create mode 100644 tests/redis/run.sh diff --git a/tests/redis/install.sh b/tests/redis/install.sh new file mode 100644 index 0000000..bf5de1b --- /dev/null +++ b/tests/redis/install.sh @@ -0,0 +1,19 @@ +#!/bin/bash +WEB_URL="https://ostester.oss-cn-hangzhou.aliyuncs.com/benchmarks/redis-7.2.zip" + + +build() +{ + cp -r $TONE_BM_CACHE_DIR/redis-7.2.zip $TONE_BM_RUN_DIR + cd $TONE_BM_RUN_DIR + unzip redis-7.2.zip + cd $TONE_BM_RUN_DIR/redis-7.2 + make +} + + +install() +{ + make PREFIX=$TONE_BM_RUN_DIR/redis-7.2 install + cd $TONE_BM_RUN_DIR/redis-7.2/bin && ./redis-server +} diff --git a/tests/redis/run.sh b/tests/redis/run.sh new file mode 100644 index 0000000..863b518 --- /dev/null +++ b/tests/redis/run.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +server_cmd="redis-benchmark -n 1000000 -q" + + +setup() +{ + export PATH="$TONE_BM_RUN_DIR"/redis-7.2/bin:$PATH + firewalld_status_flag=0 + firewalld_status=`systemctl status firewalld` + if [[ $firewalld_status =~ "active" ]];then + systemctl stop firewalld + firewalld_status_flag=1 + fi +} + +run() +{ + echo "start test redis" + ${server_cmd} | tee 2>&1 "$TONE_CURRENT_RESULT_DIR"/${testsuite}.json + echo "redis has finished" +} + + +parse() +{ + grep "PING_INLINE" |awk -F " " '{print $2}' + grep "PING_BULK" |awk -F " " '{print $2}' + grep "^SET" |awk -F " " '{print $2}' + grep "GET" |awk -F " " '{print $2}' + grep "INCR" |awk -F " " '{print $2}' + grep "^LPUSH:" |awk -F " " '{print $2}' + grep "LPOP" |awk -F " " '{print $2}' + grep "SADD" |awk -F " " '{print $2}' + grep "SPOP" |awk -F " " '{print $2}' + grep "LPUSH " |awk -F " " '{print $6}' + grep "LRANGE_100" |awk -F " " '{print $5}' + grep "LRANGE_300" |awk -F " " '{print $5}' + grep "LRANGE_500" |awk -F " " '{print $5}' + grep "LRANGE_600" |awk -F " " '{print $5}' + grep "MSET" |awk -F " " '{print $4}' +} + +teardown() +{ + cd $TONE_BM_RUN_DIR/redis-7.2 + sleep 2 + if [ $firewalld_status_flag -eq 1 ];then + systemctl start firewalld + fi + make clean + ps -ef |grep redis |grep -v "color"|awk -F " " '{print $2}' |xargs kill -9 + rm -rf $TONE_BM_RUN_DIR/redis-7.2 +} + -- Gitee From 63530a3c745064aa4d62fb77ffb8dd2365158a1b Mon Sep 17 00:00:00 2001 From: DZC <9535280+douzhichong@user.noreply.gitee.com> Date: Fri, 8 Mar 2024 10:05:09 +0800 Subject: [PATCH 2/8] =?UTF-8?q?iozone=E7=BC=96=E8=AF=91=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E5=A4=9A=E7=A7=8D=E6=93=8D=E4=BD=9C=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/iozone-ceprei/install.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tests/iozone-ceprei/install.sh b/tests/iozone-ceprei/install.sh index bf41613..dd9d181 100644 --- a/tests/iozone-ceprei/install.sh +++ b/tests/iozone-ceprei/install.sh @@ -18,11 +18,7 @@ build() tar -xvf iozone3_430.tar cd ./iozone3_430/src/current pwd - if [[ $(/bin/arch) == 'x86_64' ]];then - make linux-AMD64 - else - make linux - fi + make CFLAGS=-fcommon linux } install() -- Gitee From fa0834f951c621b0ffc4ded88c0c567ca0fa072a Mon Sep 17 00:00:00 2001 From: DZC <9535280+douzhichong@user.noreply.gitee.com> Date: Fri, 8 Mar 2024 02:09:13 +0000 Subject: [PATCH 3/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20test?= =?UTF-8?q?s/redis/install.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/redis/install.sh | 19 ------------------- 1 file changed, 19 deletions(-) delete mode 100644 tests/redis/install.sh diff --git a/tests/redis/install.sh b/tests/redis/install.sh deleted file mode 100644 index bf5de1b..0000000 --- a/tests/redis/install.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash -WEB_URL="https://ostester.oss-cn-hangzhou.aliyuncs.com/benchmarks/redis-7.2.zip" - - -build() -{ - cp -r $TONE_BM_CACHE_DIR/redis-7.2.zip $TONE_BM_RUN_DIR - cd $TONE_BM_RUN_DIR - unzip redis-7.2.zip - cd $TONE_BM_RUN_DIR/redis-7.2 - make -} - - -install() -{ - make PREFIX=$TONE_BM_RUN_DIR/redis-7.2 install - cd $TONE_BM_RUN_DIR/redis-7.2/bin && ./redis-server -} -- Gitee From b38133986827bf56d8d4ce5f739c2f168cb9ed25 Mon Sep 17 00:00:00 2001 From: DZC <9535280+douzhichong@user.noreply.gitee.com> Date: Fri, 8 Mar 2024 02:09:42 +0000 Subject: [PATCH 4/8] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=96=87=E4=BB=B6=20test?= =?UTF-8?q?s/redis/run.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/redis/run.sh | 55 ---------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 tests/redis/run.sh diff --git a/tests/redis/run.sh b/tests/redis/run.sh deleted file mode 100644 index 863b518..0000000 --- a/tests/redis/run.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash - -server_cmd="redis-benchmark -n 1000000 -q" - - -setup() -{ - export PATH="$TONE_BM_RUN_DIR"/redis-7.2/bin:$PATH - firewalld_status_flag=0 - firewalld_status=`systemctl status firewalld` - if [[ $firewalld_status =~ "active" ]];then - systemctl stop firewalld - firewalld_status_flag=1 - fi -} - -run() -{ - echo "start test redis" - ${server_cmd} | tee 2>&1 "$TONE_CURRENT_RESULT_DIR"/${testsuite}.json - echo "redis has finished" -} - - -parse() -{ - grep "PING_INLINE" |awk -F " " '{print $2}' - grep "PING_BULK" |awk -F " " '{print $2}' - grep "^SET" |awk -F " " '{print $2}' - grep "GET" |awk -F " " '{print $2}' - grep "INCR" |awk -F " " '{print $2}' - grep "^LPUSH:" |awk -F " " '{print $2}' - grep "LPOP" |awk -F " " '{print $2}' - grep "SADD" |awk -F " " '{print $2}' - grep "SPOP" |awk -F " " '{print $2}' - grep "LPUSH " |awk -F " " '{print $6}' - grep "LRANGE_100" |awk -F " " '{print $5}' - grep "LRANGE_300" |awk -F " " '{print $5}' - grep "LRANGE_500" |awk -F " " '{print $5}' - grep "LRANGE_600" |awk -F " " '{print $5}' - grep "MSET" |awk -F " " '{print $4}' -} - -teardown() -{ - cd $TONE_BM_RUN_DIR/redis-7.2 - sleep 2 - if [ $firewalld_status_flag -eq 1 ];then - systemctl start firewalld - fi - make clean - ps -ef |grep redis |grep -v "color"|awk -F " " '{print $2}' |xargs kill -9 - rm -rf $TONE_BM_RUN_DIR/redis-7.2 -} - -- Gitee From 2c51148a1026a0385673a21a7e73743eb712cc30 Mon Sep 17 00:00:00 2001 From: DZC <9535280+douzhichong@user.noreply.gitee.com> Date: Fri, 8 Mar 2024 02:42:46 +0000 Subject: [PATCH 5/8] update tests/iozone-ceprei/install.sh. Signed-off-by: DZC <9535280+douzhichong@user.noreply.gitee.com> --- tests/iozone-ceprei/install.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/iozone-ceprei/install.sh b/tests/iozone-ceprei/install.sh index dd9d181..bf41613 100644 --- a/tests/iozone-ceprei/install.sh +++ b/tests/iozone-ceprei/install.sh @@ -18,7 +18,11 @@ build() tar -xvf iozone3_430.tar cd ./iozone3_430/src/current pwd - make CFLAGS=-fcommon linux + if [[ $(/bin/arch) == 'x86_64' ]];then + make linux-AMD64 + else + make linux + fi } install() -- Gitee From e676b11171614568a6151a9e789e15614a6b4e2e Mon Sep 17 00:00:00 2001 From: DZC <9535280+douzhichong@user.noreply.gitee.com> Date: Fri, 8 Mar 2024 10:43:54 +0800 Subject: [PATCH 6/8] =?UTF-8?q?stream=E6=B5=8B=E8=AF=95=E5=A5=97=E4=B8=89?= =?UTF-8?q?=E7=BA=A7=E7=BC=93=E5=AD=98=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=97=B6?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEarraysize=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/stream-ceprei/run.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/stream-ceprei/run.sh b/tests/stream-ceprei/run.sh index 21a0f45..29af8a8 100644 --- a/tests/stream-ceprei/run.sh +++ b/tests/stream-ceprei/run.sh @@ -12,7 +12,9 @@ run() STREAM_ARRAY_SIZE=$(echo "$l3_cache_bytes_all * 4.1 /8" | bc) echo "STREAM_ARRAY_SIZE: $STREAM_ARRAY_SIZE" - + if [ -z "$STREAM_ARRAY_SIZE" ]; then + STREAM_ARRAY_SIZE="100000000" + fi if [ $test == 'full_thread' ];then gcc -O3 stream.c -o stream -D"STREAM_ARRAY_SIZE=$STREAM_ARRAY_SIZE" -fopenmp else -- Gitee From 9492bbf9e9374fcac263e02221251603bbd94f54 Mon Sep 17 00:00:00 2001 From: DZC <9535280+douzhichong@user.noreply.gitee.com> Date: Tue, 9 Apr 2024 14:10:00 +0800 Subject: [PATCH 7/8] add ab testcase --- conf/performance/ab.conf | 4 ++++ tests/ab/install.sh | 7 +++++++ tests/ab/run.sh | 27 +++++++++++++++++++++++++++ 3 files changed, 38 insertions(+) create mode 100644 conf/performance/ab.conf create mode 100644 tests/ab/install.sh create mode 100644 tests/ab/run.sh diff --git a/conf/performance/ab.conf b/conf/performance/ab.conf new file mode 100644 index 0000000..487b0aa --- /dev/null +++ b/conf/performance/ab.conf @@ -0,0 +1,4 @@ +nr_task +50% +100% +200% diff --git a/tests/ab/install.sh b/tests/ab/install.sh new file mode 100644 index 0000000..6fc371d --- /dev/null +++ b/tests/ab/install.sh @@ -0,0 +1,7 @@ +#!/bin/bash + + +install() +{ + yum install httpd-tools,nginx -y +} diff --git a/tests/ab/run.sh b/tests/ab/run.sh new file mode 100644 index 0000000..7daf1f0 --- /dev/null +++ b/tests/ab/run.sh @@ -0,0 +1,27 @@ +#!/bin/bash +setup() +{ + # get cpus + cpus=$(lscpu |grep ^CPU:|awk -F " " '{print $2}') + # increase open file number + ulimit -n 65536 + CONCURRENCY=$((cpus * 2)) + REQUESTS=1000000 + systemctl restart nginx +} + +run() +{ + ab -n $REQUESTS -c $CONCURRENCY http://localhost/index.html +} + +teardown() +{ + yum remove httpd-tools,nginx -y +} + +parse() +{ + grep "Requests per second:" |awk -F " " '{print $4}' +} + -- Gitee From f12696328f77657333da1995bedc2e6659d357dd Mon Sep 17 00:00:00 2001 From: DZC <9535280+douzhichong@user.noreply.gitee.com> Date: Tue, 16 Apr 2024 09:09:03 +0800 Subject: [PATCH 8/8] Signed-off-by: DZC <9535280+douzhichong@user.noreply.gitee.com> Add a new testcase wrk to test nginx performance. You should make sure that the network is accessible. The load is twice the processing capacity of the CPU. --- tests/wrk/install.sh | 17 +++++++++++++++++ tests/wrk/run.sh | 17 +++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 tests/wrk/install.sh create mode 100644 tests/wrk/run.sh diff --git a/tests/wrk/install.sh b/tests/wrk/install.sh new file mode 100644 index 0000000..df6e0ae --- /dev/null +++ b/tests/wrk/install.sh @@ -0,0 +1,17 @@ +#!/bin/bash + + +install() +{ + yum yum install wget,nginx -y + wget https://github.com/wg/wrk/archive/refs/tags/4.2.0.zip + unzip 4.2.0.zip + cd wrk-4.2.0 + make + cp wrk /usr/local/bin/ + cpus=$(lscpu |grep ^CPU:|awk -F " " '{print $2}') + ulimit -n 65536 + +} + + diff --git a/tests/wrk/run.sh b/tests/wrk/run.sh new file mode 100644 index 0000000..741e6f1 --- /dev/null +++ b/tests/wrk/run.sh @@ -0,0 +1,17 @@ +#!/bin/bash +run() +{ + CONCURRENCY=$((cpus * 2)) + REQUESTS=1000000 + wrk -t$CONCURRENCY -c$REQUESTS -d30 http://127.0.0.1/index.html +} + +teardown() +{ + yum remove wget,nginx -y +} + +parse() +{ + grep "^Requests/sec"|awk -F " " '{print $2}' +} -- Gitee