diff --git a/conf/performance/ab.conf b/conf/performance/ab.conf new file mode 100644 index 0000000000000000000000000000000000000000..487b0aaaa2d87a8ae1714056d081fa4ae82aa037 --- /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 0000000000000000000000000000000000000000..6fc371dae6d1a6bf0937928eebd7528a025b563d --- /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 0000000000000000000000000000000000000000..7daf1f01b4a0fc09b9142597da4780f400a64a4e --- /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}' +} + diff --git a/tests/stream-ceprei/run.sh b/tests/stream-ceprei/run.sh index 21a0f4596bff61c95cca3ab6c14adcf0b530fe37..29af8a8a5ec73a147d441b90732d1f18533e058d 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 diff --git a/tests/wrk/install.sh b/tests/wrk/install.sh new file mode 100644 index 0000000000000000000000000000000000000000..df6e0aefedb78ad86840f064ada23e8bb70d9e86 --- /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 0000000000000000000000000000000000000000..741e6f161078ffcd8642a4cbe0d59745b48cab40 --- /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}' +}