#!/bin/bash : ${SRCTREE=/mariadb/main} : ${MDIR=/dev/shm/m} : ${TDIR=/mariadb/sbtest} MYSQL_SOCK=$TDIR/mysqld.sock MYSQL_USER=root : ${BENCH_TIME=12} : ${INTERVAL=3} : ${DELAY=$INTERVAL} : ${THREADS=24} : ${PARALLEL=4} : ${LEGACY=0} rm /tmp/backup.txt touch /tmp/nul cat > /tmp/nul << EOF #!/bin/sh exec wc -c >> /tmp/backup.txt EOF chmod +x /tmp/nul BU="BACKUP SERVER WITH $PARALLEL CONCURRENT '/tmp/nul'" # 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=24 \ --table_size=1000000" rm -rf "$TDIR" cd $MDIR sh scripts/mysql_install_db --user="$USERNAME" --srcdir="$SRCTREE" --builddir=. --datadir="$TDIR" --auth-root-authentication-method=normal --innodb-log-file-size=32g --innodb-log-buffer-size=2m #numactl --cpunodebind 1 --localalloc \ LD_LIBRARY_PATH=~/lib-framepointer2 sql/mariadbd --no-defaults --gdb --core-file --loose-debug-sync-timeout=300 --innodb \ --datadir="$TDIR" --socket=$MYSQL_SOCK \ --innodb_log_file_size=32g \ --innodb_buffer_pool_size=32g \ --innodb_flush_log_at_trx_commit=2 \ --max-connections=300 --max_prepared_stmt_count=100000 \ --aria-checkpoint-interval=0 > "$TDIR"/mysqld.err 2>&1 & mariadbd_pid=$! timeo=600 echo -n "waiting for server to come up " while [ $timeo -gt 0 ] do client/mariadb-admin -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 --threads="$THREADS" client/mariadb -u $MYSQL_USER -S $MYSQL_SOCK -e 'SET GLOBAL innodb_log_checkpoint_now=ON' $SYSBENCH --rand-seed=42 --rand-type=uniform --max-requests=0 --time=$BENCH_TIME --report-interval="$INTERVAL" --threads="$THREADS" run & sleep "$DELAY" if [ "$LEGACY" -gt 0 ] then time extra/mariabackup/mariadb-backup -u $MYSQL_USER -S $MYSQL_SOCK --backup --parallel="$PARALLEL" --stream=xbstream 2>/dev/null|wc -c else time client/mariadb -u $MYSQL_USER -S $MYSQL_SOCK -e "$BU" sum=0 while read do sum=$(($sum + $REPLY)) done < /tmp/backup.txt echo $sum fi wait $! kill -KILL $mariadbd_pid wait $mariadbd_pid