#!/bin/bash : ${SRCTREE=/mariadb/10.6} : ${MDIR=/dev/shm/10.6} IDIR=$BLDTREE/include : ${TDIR=/mariadb/sbtest} LD_LIBRARY_PATH="$MDIR/libmysql" MYSQL_SOCK=$TDIR/mysqld.sock MYSQL_USER=root BENCH_TIME=300 BENCH_THREADS="64" # Frequently used tests: oltp_update_index, oltp_update_non_index, oltp_read_write, connect, oltp_read_only, oltp_point_select SYSBENCH="sysbench /usr/share/sysbench/oltp_update_index.lua \ --mysql-socket=$MYSQL_SOCK \ --mysql-user=$MYSQL_USER \ --mysql-db=test \ --percentile=99 \ --tables=8 \ --table_size=2000000" #--mysql_storage_engine=aria --point_selects=1000 --simple_ranges=0 --sum_ranges=0 --order_ranges=0 --distinct_ranges=0 \ #--aria-pagecache-buffer-size=2048M \ rm -rf "$TDIR" sh mysql_install_db --no-defaults --user="$USERNAME" --srcdir="$SRCTREE" --builddir=. --datadir="$TDIR" --auth-root-authentication-method=normal cd ../ mysqld --no-defaults --gdb --core-file --loose-debug-sync-timeout=300 --innodb \ --datadir="$TDIR" --lc-messages-dir=./$MDIR/sql/share/ --socket=$MYSQL_SOCK \ --innodb_log_file_size=1G\ --innodb_buffer_pool_size=50G \ --innodb_io_capacity=50000\ --innodb_io_capacity_max=90000 \ --innodb_flush_log_at_trx_commit=0 \ --innodb_adaptive_flushing_lwm=0 \ --innodb-adaptive-flushing=1 \ --innodb_flush_neighbors=1 \ --innodb-use-native-aio=1 \ --innodb_file-per-table=1 \ --innodb-fast-shutdown=0 \ --innodb-flush-method=O_DIRECT \ --innodb_lru_scan_depth=1024 \ --innodb_lru_flush_size=256 \ --max-connections=2048 \ --table_open_cache=4096 \ --max_prepared_stmt_count=1048576 \ --aria-checkpoint-interval=0 \ > "$TDIR"/mysqld.err 2>&1 & timeo=600 echo -n "waiting for server to come up " while [ $timeo -gt 0 ] do mysqladmin -S $MYSQL_SOCK -u $MYSQL_USER -b -s ping && break echo -n "." timeo=$(($timeo - 1)) sleep 1 done if [ $timeo -eq 0 ] then echo " server not starting! Abort!" break fi $SYSBENCH prepare for i in $BENCH_THREADS do $SYSBENCH --rand-seed=42 --rand-type=uniform --max-requests=0 --time=$BENCH_TIME --report-interval=5 --threads=$i run done #$SYSBENCH cleanup mysqladmin -u $MYSQL_USER -S $MYSQL_SOCK shutdown