BENCHER - the benchmarking tool for MySQL Cluster
You can also customize this very easily (see the Documentation) to benchmark more elaborate SQL requsts, and NDBAPI requests.
------- Starting Benchmark ----------
Thread 1 - 638 qps (average qps measured after 5 secs)
Thread 0 - 631 qps (average qps measured after 5 secs)
Thread 1 - 680 qps (average qps measured after 10 secs)
Thread 0 - 679 qps (average qps measured after 10 secs)
------- Benchmark Finished ----------
Thread 0 - max: 83091 us, min 668 us, less than 5 ms: 9761 of 10000, avg: 1485 us, total time: 14949 ms, qps: 668.91
Thread 1 - max: 43743 us, min 578 us, less than 5 ms: 9770 of 10000, avg: 1475 us, total time: 14767 ms, qps: 677.16
Total throughput = 1346.08 qps
Average exec time per thread = 14.86 secs
Future improvements are amongst others to implement support for warmup periods, reading queries from a file, write statistics to a file etc.
Download - source dist only (latest first) - Community version (GPL)
Version 0.18- released 29th of Apr 2010 - download source dist - fixed finding NDBAPI headers issue.
Drop an email toInstallation
Pre-requisites
In order to make it simple it is also recommended to have:
Compile bencher
Make sure you have the correct mysql_config on the path. If you have used the config tool (and the default install path):
Make sure you have: g++ and gcc installed (run those two commands from the command line). If they don't exists you have to install them!!
or ..another popular PATH is
Proceed with the following when you can execute the command
If you don't set the
on Solaris (you need Sun studio) run the following configure:
Running bencher
Running bencher is easy:
Important!
If you specify
If you leave out
The example below runs the query
Documentation
Benching SQL requests
The following command starts bencher with 10 threads and each thread loops 10 times:
./bencher --mysqlhost=localhost -t 10
The following command starts bencher with 10 threads and each thread will have one Ndb_cluster_connection (this will require --threads=N free [mysqld] slots in config.ini :
./bencher --mysqlhost=localhost -t 10 --ndbmulticonnect
To start bencher to execute a particular query N times:
./bencher --mysqlhost=localhost -t 10 --mysqlquery="select * from t1 limit 1" --loops=10000
Benching custom SQL requests
You can also implement (using MySQL C API) more advanced type of requests. E.g, HLR or IMS type of requests requiring multiple statements. The you must not supply * YOU SQL QUERY SHOULD BE COPIED INTO mysqlquery . E.g using sprintf:
* sprintf(mysqlquery, "INSERT INTO t1(a) VALUES (%d)", i);
*/
Then you can start
Benching NDBAPI requests
In order to benchmark NDBAPI requests you need to know the NDBAPI. The NDBAPI request should be implemented in the thread_runner_ndb function. Locate the section:
/**
* Your NDBAPI code goes here!
*/
and put the code there!
The following command starts bencher with 10 threads and each thread loops 10 times:
./bencher --ndb-connectstring=localhost --threads=10 --loops=10
The following command starts bencher with 10 threads and each thread will have one Ndb_cluster_connection (this will require --threads=N free [mysqld] slots in config.ini :
./bencher --ndb-connectstring=localhost -t 10 --ndbmulticonnect
GnuPlot
If you run bencher with -o (--output) and specify a test name, you will get data files and a GNU Plot script written to /tmp:
./bencher --mysqlhost=localhost -t 10 --mysqlquery="select * from t1 limit 1" --loops=10000 -o mytest
Then you do:
gnuplot gnuplot_t1_mytest.script > mytest.png
And you will get a .png containing two graphs for your test run, one for response times and one for throughput.
* Your NDBAPI code goes here!
*/
Then you do:
And you will get a .png containing two graphs for your test run, one for response times and one for throughput.