Install it using the documentation available here.
create a database on the server:
create database stresstest;
then run:
sysbench prepare:
sysbench /usr/share/sysbench/oltp_read_write.lua \ --mysql-db=stresstest --threads=4 --mysql-host=<hostname> \ --mysql-user=<root> --mysql-password=<password> --tables=10 \ --table-size=250000 prepare
sysbench run:
sysbench --db-driver=mysql --report-interval=2 \ --threads=4 --time=300 --mysql-host=<hostname> \ --mysql-user=<root> --mysql-password=<password> \ --mysql-db=stresstest /usr/share/sysbench/oltp_read_write.lua run
see that I’ve run the oltp version 🙂
available sysbench scripts are:
ubuntu@ip-10-0-10-94:~$ ls /usr/share/sysbench/
bulk_insert.lua oltp_delete.lua oltp_point_select.lua oltp_read_write.lua oltp_update_non_index.lua select_random_points.lua
oltp_common.lua oltp_insert.lua oltp_read_only.lua oltp_update_index.lua oltp_write_only.lua select_random_ranges.lua
FYI, I’ve just discovered a 10% performance decrease after upgrading a sanbox database from MySQL 5.7.38 to 8.0.30 when configured with READ-COMMITTED isolation level.