Skip to content

Instantly share code, notes, and snippets.

@acosonic
Last active April 22, 2021 21:40
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 acosonic/bee2a6c81428d72b532d318a876b020f to your computer and use it in GitHub Desktop.
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)
#!/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