Merge pull request #2 from joshtronic/development
feat: support testing with old and new sysbench
This commit is contained in:
commit
8d57b2b725
1 changed files with 23 additions and 9 deletions
20
run.sh
Normal file → Executable file
20
run.sh
Normal file → Executable file
|
@ -1,5 +1,8 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Skip prompts so we can run unattended
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
if [ $# -eq 0 ]; then
|
||||
echo 'Missing argument, provider name'
|
||||
exit 1
|
||||
|
@ -11,7 +14,10 @@ swapoff -a
|
|||
|
||||
apt-get update
|
||||
apt-get upgrade -y
|
||||
apt-get install sysbench apache2 mailutils mysql-server python -y
|
||||
apt-get install sysbench nginx mysql-server python -y
|
||||
|
||||
# Grabs the major version of sysbench so we can use the correct parameters for MySQL
|
||||
SYSBENCH_MAJOR_VERSION=$(sysbench --version | cut -d ' ' -f 2 | cut -d '.' -f 1)
|
||||
|
||||
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
|
||||
chmod +x speedtest-cli
|
||||
|
@ -29,15 +35,23 @@ sysbench --test=fileio prepare
|
|||
sysbench --test=fileio --file-test-mode=rndrw run > results/fileio.log
|
||||
sysbench --test=fileio cleanup
|
||||
|
||||
if [ "$SYSBENCH_MAJOR_VERSION" == "0" ]; then
|
||||
# Ubuntu 16.04
|
||||
mysql -uroot -e "CREATE DATABASE sbtest;"
|
||||
sysbench --test=oltp --oltp-table-size=1000000 --mysql-user=root prepare
|
||||
sysbench --test=oltp --oltp-table-size=1000000 --mysql-user=root run > results/mysql.log
|
||||
sysbench --test=oltp --oltp-table-size=1000000 --mysql-user=root cleanup
|
||||
else
|
||||
# Ubuntu 18.04
|
||||
mysql -uroot -e "CREATE DATABASE sbtest;"
|
||||
sysbench --db-driver=mysql --table-size=1000000 --mysql-user=root /usr/share/sysbench/oltp_read_write.lua prepare
|
||||
sysbench --db-driver=mysql --table-size=1000000 --mysql-user=root /usr/share/sysbench/oltp_read_write.lua run > results/mysql.log
|
||||
sysbench --db-driver=mysql --table-size=1000000 --mysql-user=root /usr/share/sysbench/oltp_read_write.lua cleanup
|
||||
fi
|
||||
|
||||
./speedtest-cli --server=16089 > results/speedtest1.log
|
||||
./speedtest-cli --server=16089 > results/speedtest2.log
|
||||
./speedtest-cli --server=16089 > results/speedtest3.log
|
||||
|
||||
ab -kc 1000 -n 10000 http://127.0.0.1/ > results/ab.log
|
||||
|
||||
# Wraps it all up in a nice package
|
||||
tar -zcvf "results-$PROVIDER.tgz" results
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue