View a markdown version of this page

Example workloads - Amazon Aurora

Example workloads

The following examples use the dataset from Preparing a test dataset and dbcg_load.lua from A sysbench script for a database cluster group for Aurora. Each one gives its goal, the commands, and what to look for. Each command runs on the load generator host and connects to the routing endpoint with the options from Connection options.

Run long workloads in a tmux session, and save each run's output with its start time in UTC. Before each workload, run a short check with a few threads, and confirm that it reports no errors:

sysbench dbcg_load.lua --mysql-host=ROUTING_ENDPOINT --mysql-port=3306 --mysql-user=ROUTER_USER \ --mysql-password=PASSWORD --mysql-ssl=REQUIRED --mysql-db=lt \ --tables=4 --table_size=1000000 --mysql-ignore-errors=63927,63923,63928,1412,1317,1180,1927,2013,2006 \ --report-interval=10 \ --threads=4 --time=10 run

Steady reads

Goal. Send a steady read load through the routing endpoint, with more reads on one table, and see the load land on the member clusters that the data mappings name.

One process reads only table 1. The other spreads its reads over tables 2, 3, and 4. Member cluster A holds tables 1 and 2, as the following diagram shows.

Member cluster A holds tables lt.sbtest1 and lt.sbtest2, and member cluster B holds lt.sbtest3 and lt.sbtest4, each in its own collocation.
# hot table, on member cluster A sysbench dbcg_load.lua --mysql-host=ROUTING_ENDPOINT --mysql-port=3306 --mysql-user=ROUTER_USER \ --mysql-password=PASSWORD --mysql-ssl=REQUIRED --mysql-db=lt \ --tables=4 --table_size=1000000 --mysql-ignore-errors=63927,63923,63928,1412,1317,1180,1927,2013,2006 \ --report-interval=10 \ --table_set=1 --threads=32 --time=3600 run & sleep 10 # the other tables sysbench dbcg_load.lua --mysql-host=ROUTING_ENDPOINT --mysql-port=3306 --mysql-user=ROUTER_USER \ --mysql-password=PASSWORD --mysql-ssl=REQUIRED --mysql-db=lt \ --tables=4 --table_size=1000000 --mysql-ignore-errors=63927,63923,63928,1412,1317,1180,1927,2013,2006 \ --report-interval=10 \ --table_set=2,3,4 --threads=32 --time=3600 run &

Look for. Each process reports steady transactions per second (tps) and no errors. Member cluster A, which holds tables 1 and 2, serves about two-thirds of the reads when the two processes report a similar tps. To compare the member clusters, see Checking a run.

Reads and writes

Goal. Run transactions and writes the way your application does. This workload changes the dataset.

sysbench dbcg_load.lua --mysql-host=ROUTING_ENDPOINT --mysql-port=3306 --mysql-user=ROUTER_USER \ --mysql-password=PASSWORD --mysql-ssl=REQUIRED --mysql-db=lt \ --tables=4 --table_size=1000000 --mysql-ignore-errors=63927,63923,63928,1412,1317,1180,1927,2013,2006 \ --report-interval=10 \ --point_selects=5 --write_pct=10 --threads=64 --time=1800 run

Each read event is a transaction of five point selects on one table, and 10 percent of events update one row. To test a scaleout table, add --scaleout=sbtest: the statements name sbtest, which is lt.sbtest in the database that --mysql-db=lt selects, and the routing layer routes each one by its id.

Look for. No 1235 errors, because no transaction spans member clusters.

A workload during a data move

To see what your application sees while a collocation moves to another member cluster and cuts over, run reads, read transactions, and writes while you rebalance the dataset. For the steps and what to look for, see Running a data movement operation.

Checking a run

With --report-interval=10, sysbench prints a line every 10 seconds, for example:

[ 10s ] thds: 4 tps: 197.66 qps: 197.66 (r/w/o: 197.66/0.00/0.00) lat (ms,95%): 1.25 err/s: 0.00 reconn/s: 0.00

Check the following:

  • tps and the 95th percentile latency (lat) stay steady from one line to the next.

  • err/s counts the errors in --mysql-ignore-errors that sysbench retried, except 2013 and 2006, which sysbench counts in reconn/s after it reconnects. It stays at 0 except around a data movement cutover. Each retry also shows in reconn/s, because the script reopens the connection before it. Any other error stops the run. To find the cause, see Error codes for database cluster groups for Aurora.

  • Connect directly to each member cluster and run SHOW GLOBAL STATUS LIKE 'Questions'; twice, a minute apart, and compare the increase on each member cluster. The member cluster that holds the busier tables shows the larger increase. The counts include statements that the routing layer sends, so compare the member clusters with each other, not with sysbench's qps.