Prerequisites
- Docker. Both the VillageSQL server and HammerDB run in containers, so you don’t install either one on the host.
- About 5 GB of free disk space: about 2 GB for the two images, and about 3 GB for the data that the test below writes. Most of that data is the server’s binary log, which grows with the length of the run.
Start a VillageSQL server
Create a Docker network so that the HammerDB container can reach the server by name, then start the server on it:vsql_host, vsql_user, and vsql_pass in the scripts below to that server’s address and credentials, and drop --network hammerdb-net from the HammerDB commands.
Write the HammerDB scripts
HammerDB runs from its command-line interface,hammerdbcli, which reads a script of settings and commands. Create a folder for the scripts:
build.tcl. It builds the TPROC-C schema in a database named tpcc:
run.tcl. It runs a timed test: one minute of ramp-up, then two minutes of measurement, with four virtual users:
dbset db vsql selects VillageSQL. The five ssl lines turn on TLS without certificate files. The root account authenticates with caching_sha2_password, which needs an encrypted connection over TCP, and HammerDB’s default certificate folder, /etc/mysql/certs, doesn’t exist in the image.
Build the schema
Runbuild.tcl from the HammerDB VillageSQL image, with the scripts folder mounted:
ALL VIRTUAL USERS COMPLETE even when the build fails, so look for FINISHED FAILED in the output. If it’s there, see Troubleshooting.
Run the test
Scale the test
The test above checks that the setup works. To measure a server, raise these settings:
The HammerDB documentation covers every TPROC-C setting, the TPROC-H workload, and the HammerDB GUI.
Troubleshooting
Clean up
Remove the server container with its data volume, and the network:See also
- MySQL on Docker — running the server container for longer than a benchmark
- Diagnosing slow queries — what to look at when a result is lower than you expect
- InnoDB storage — how the buffer pool and the data size shape a TPROC-C result