Part 8— Sysbench Test
This multi-part series breaks down each section into easy logical steps.
If you have not completed part 1, start here.
Sysbench
Sysbench is a great tool for testing various parts of a system, one of the tests is a MySQL driver that allows us to test our MariaDB installation.
We are going to use Sysbench to create a load on our system, via the MaxScale server.
You can read my blog on Sysbench testing here, for further use examples.
On the MaxScale server, you need to install Sysbench, using yum, sysbench requires the epel-release, so you need to make sure this is installed first:
yum install nc epel-release -y
yum install sysbench -y
We need to create a database and user for our sysbench test. Whilst we could do this via MaxScale, we have not yet created application users, so on whichever server is your primary, in my case server1, connect to mariadb using the command line tool mariadb
and run the following commands:
CREATE DATABASE sbtest;
GRANT ALL on *.* TO 'sbtest'@'%' IDENTIFIED BY 'SBtest_123';
On the MaxScale server, you can now run the Sysbench command to populate the system. The IP address you connect to should be that of the MaxScale server:
sysbench oltp_common \
--mysql-user=sbtest \
--mysql-password=SBtest_123 \
--mysql-db=sbtest \
--db-driver=mysql \
--tables=16 \
--table-size=100000 \
--mysql-host=10.106.0.5 \
prepare
This command will take a few moments, to populate 16 tables, with 100,000 records each.
You can now run a Sysbench test against your database cluster, via MaxScale. This particular test will run for one minute, testing 100 connections over the 16 tables that were created:
sysbench oltp_read_write \
--time=60 \
--db-driver=mysql \
--mysql-user=sbtest \
--mysql-password=SBtest_123 \
--mysql-port=3306 \
--mysql-db=sbtest \
--threads=100 \
--report-interval=1 \
--tables=16 \
--table-size=100000 \
--mysql-host=10.106.0.5 \
run
Running the maxctrl list servers command:maxctrl list servers
Should show to us, all three servers in sync.
In the final part of this mini-series, we will test various failure options and rebuild the underlying database nodes. Read Part 9.
Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7 | Part 8 | Part 9
Leave a Reply
You must be logged in to post a comment.