From d581cb0aeed2f47a1d136781c4c73baa11fa63e6 Mon Sep 17 00:00:00 2001 From: Andy Arthur Date: Wed, 23 Feb 2022 13:47:29 -0800 Subject: [PATCH] updated benchmarking tools --- go/go.mod | 3 ++ go/performance/scripts/local_benchmark.sh | 13 +++++++ go/performance/scripts/mysql_benchmark.sh | 47 +++++++++++++++++++++++ 3 files changed, 63 insertions(+) create mode 100755 go/performance/scripts/mysql_benchmark.sh diff --git a/go/go.mod b/go/go.mod index 6e01d04430..efb131d674 100644 --- a/go/go.mod +++ b/go/go.mod @@ -131,6 +131,9 @@ require ( replace ( github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi => ./gen/proto/dolt/services/eventsapi github.com/oliveagle/jsonpath => github.com/dolthub/jsonpath v0.0.0-20210609232853-d49537a30474 + + github.com/dolthub/go-mysql-server => ../../go-mysql-server + github.com/dolthub/vitess => ../../vitess ) go 1.17 diff --git a/go/performance/scripts/local_benchmark.sh b/go/performance/scripts/local_benchmark.sh index 102abaaee0..4891b97c81 100755 --- a/go/performance/scripts/local_benchmark.sh +++ b/go/performance/scripts/local_benchmark.sh @@ -16,6 +16,13 @@ do --new-nbf) export DOLT_FORMAT_FEATURE_FLAG=true ;; + --new-new) export DOLT_FORMAT_FEATURE_FLAG=true && + export ENABLE_ROW_ITER_2=true + ;; + + --no-exchange) export SINGLE_THREAD_FEATURE_FLAG=true + ;; + # benchmark with pprof profiling --pprof) PPROF=1 ;; @@ -105,8 +112,14 @@ sysbench \ --mysql-host="0.0.0.0" \ --mysql-user="user" \ --mysql-password="pass" \ + --db-ps-mode=disable \ "$SYSBENCH_TEST" run +unset DOLT_FORMAT_FEATURE_FLAG +unset ENABLE_ROW_ITER_2 +unset SINGLE_THREAD_FEATURE_FLAG +unset GOMAXPROCS + echo "benchmark $SYSBENCH_TEST complete at $WORKING_DIR" echo "DOLT_FORMAT_FEATURE_FLAG='$DOLT_FORMAT_FEATURE_FLAG'" echo "" diff --git a/go/performance/scripts/mysql_benchmark.sh b/go/performance/scripts/mysql_benchmark.sh new file mode 100755 index 0000000000..c882f7520e --- /dev/null +++ b/go/performance/scripts/mysql_benchmark.sh @@ -0,0 +1,47 @@ +#!/bin/bash +set -e +set -o pipefail + +SYSBENCH_TEST="oltp_point_select" +WORKING_DIR=`mktemp -d` +PPROF=0 +# parse options +# superuser.com/questions/186272/ +while test $# -gt 0 +do + case "$1" in + + # specify sysbench benchmark + *) SYSBENCH_TEST="$1" + ;; + + esac + shift +done + +if [ ! -d "./sysbench-lua-scripts" ]; then + git clone https://github.com/dolthub/sysbench-lua-scripts.git +fi + +pushd sysbench-lua-scripts + +sleep 1 +sysbench \ + --mysql-host="127.0.0.1" \ + --mysql-user="root" \ + --mysql-password="toor" \ + --mysql-port=3316 \ + "$SYSBENCH_TEST" prepare + +# run benchmark +echo "benchmark $SYSBENCH_TEST starting at $WORKING_DIR" + +sysbench \ + --mysql-host="127.0.0.1" \ + --mysql-user="root" \ + --mysql-password="toor" \ + --mysql-port=3316 \ + --db-ps-mode=disable \ + "$SYSBENCH_TEST" run + +popd