bencher
is a test program that allows you to benchmark requests on MySQL
Cluster. I have used this utility a lot of customers, because it lets
me:
- specify a simple query that I want to benchmark on the command line
- implement more complex use cases.
- implement NDBAPI requests
I don't have to reinvent the wheel every time. It is all there:
connectivity, multi-threading support, timers, and some basic
statistics, and it compiles on most platforms. I just have to focus on
the queries I want to optimize or benchmark.
is to specify the SQL query you want to benchmark, the number of
threads, and how many times. You can also customize this very easily to
benchmark more elaborate SQL requsts, and NDBAPI requests.
bencher
outputs per thread statistics and total throughput:
./src/bencher -s /tmp/mysql.sock.3306 -t 2 -l 10000 -q "select * from t1 limit 1"
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)
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
Average exec time per thread = 14.86 secs
can also specify a "querytime-threshold", to see how many transaction
have executed under a certain time (default is 5 ms). From the above
you can see that for this particular query
9760/10000
requests finished within 5 ms.