Last active
April 22, 2021 21:40
-
-
Save acosonic/bee2a6c81428d72b532d318a876b020f to your computer and use it in GitHub Desktop.
Sysbench install and automatically create and test mysql database speed (read test) (first install sysbench apt install -y sysbench)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mysql -u $1 -p$2 -h$3 -e "create database foo" | |
sysbench --db-driver=mysql --mysql-user=$1 --mysql-password=$2 --mysql-host=$3 --mysql-db=foo --range_size=100 --table_size=10000 --tables=2 --threads=1 --events=0 --time=60 --rand-type=uniform /usr/share/sysbench/oltp_read_only.lua prepare | |
sysbench --db-driver=mysql --mysql-user=$1 --mysql-password=$2 --mysql-host=$3 --mysql-db=foo --range_size=100 --table_size=10000 --tables=2 --threads=1 --events=0 --time=60 --rand-type=uniform /usr/share/sysbench/oltp_read_only.lua run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment