Skip to content

Instantly share code, notes, and snippets.

@arossouw
Last active August 29, 2015 14:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arossouw/1b81e3a45896e73a3758 to your computer and use it in GitHub Desktop.
Save arossouw/1b81e3a45896e73a3758 to your computer and use it in GitHub Desktop.
8 Threads sysbench 1000 rows - mysql
#!/bin/bash
ROWS=10000
touch result.dat
for ENGINE in "myisam" "innodb"
do
CSV=$ENGINE-$ROWS.csv
cp /dev/null $CSV
for threads in 2 4 6 8
do
sysbench --test=oltp --oltp-table-size=10000 --oltp-test-mode=complex \
--oltp-read-only=off --num-threads=$threads --max-time=60 \
--max-requests=0 --mysql-db=dbtest \
--mysql-user=mysqluser --mysql-password=mysqluser --mysql-table-engine=$ENGINE cleanup
sysbench --test=oltp --oltp-table-size=10000 --oltp-test-mode=complex \
--oltp-read-only=off --num-threads=$threads --max-time=60 \
--max-requests=0 --mysql-db=dbtest \
--mysql-user=mysqluser --mysql-password=mysqluser --mysql-table-engine=$ENGINE prepare
sysbench --test=oltp --oltp-table-size=10000 --oltp-test-mode=complex \
--oltp-read-only=off --num-threads=$threads --max-time=60 \
--max-requests=0 --mysql-db=dbtest \
--mysql-user=mysqluser --mysql-password=mysqluser \
--mysql-table-engine=$ENGINE run >result.dat
READ=`egrep 'read:' result.dat`
WRITE=`egrep 'write:' result.dat`
echo $threads,$READ,$WRITE >>$CSV
done
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment