How to deploy HammerDB CLI fast with Docker

 

The TPC publishes an official Docker image on Docker Hub to enable the rapid deployment and testing of databases with HammerDB.  This image includes example scripts to build schemas and test your databases with a single command.

In this post, we will show an example of using Docker to deploy the HammerDB command line and test a database with minimal effort. Our Linux test system is running a MariaDB 10.10 database with Docker installed, so we are going to use Docker to pull the HammerDB image and run the test scripts to measure the database performance.

Docker Hub

The image can be found on Docker Hub under the tpcorg account.

Docker Pull

On a system with docker installed, use docker pull tpcorg/hammerdb to pull the latest image.

hammerdb@REDPOLL:~$ sudo docker pull tpcorg/hammerdb
[sudo] password for hammerdb: 
Using default tag: latest
latest: Pulling from tpcorg/hammerdb
846c0b181fff: Pull complete 
10b4eb41ac75: Pull complete 
9021d634457d: Pull complete 
b365f60d978b: Pull complete 
215f30832a93: Pull complete 
689ecb6b15e8: Pull complete 
d6464f987fdc: Pull complete 
08589f44a894: Pull complete 
a3fcc3045ce7: Pull complete 
f8ceb6609f8d: Pull complete 
48e559ac800e: Pull complete 
4f4fb700ef54: Pull complete 
f9b42217af04: Pull complete 
Digest: sha256:69bf8b29a19855bb63c7e5266afeedbbb99540cef2a96c6b6a33e6747b3aa38b
Status: Downloaded newer image for tpcorg/hammerdb:latest
docker.io/tpcorg/hammerdb:latest

Use docker run to run the HammerDB container.

hammerdb@REDPOLL:~$ sudo docker run --network=host -it --name hammerdb tpcorg/hammerdb bash
root@REDPOLL:/home/hammerdb/HammerDB-4.6#

Note that all libraries are pre-installed, so we are ready to start running HammerDB.

root@REDPOLL:/home/hammerdb/HammerDB-4.6# ./hammerdbcli 
HammerDB CLI v4.6
Copyright (C) 2003-2022 Steve Shaw
Type "help" for a list of commands
Initialized new SQLite on-disk database /tmp/hammer.DB
hammerdb>librarycheck
Checking database library for Oracle
Success ... loaded library Oratcl for Oracle
Checking database library for MSSQLServer
Success ... loaded library tdbc::odbc for MSSQLServer
Checking database library for Db2
Error: failed to load db2tcl - couldn't load file "/home/hammerdb/HammerDB-4.6/lib/db2tcl2.0.1/libdb2tcl.so": libdb2.so.1: cannot open shared object file: No such file or directory
Ensure that Db2 client libraries are installed and the location in the LD_LIBRARY_PATH environment variable
Checking database library for MySQL
Success ... loaded library mysqltcl for MySQL
Checking database library for PostgreSQL
Success ... loaded library Pgtcl for PostgreSQL
Checking database library for MariaDB
Success ... loaded library mariatcl for MariaDB

Database Configuration

We have run Docker to enable to access the host network so we start the MariaDB on the host with the host bind_address (in this case the system name is redpoll) and the default port of 3306 and start the database.

[mysqld]
skip-log-bin
datadir=/home/hammerdb/mariadb-10.10.2-linux-systemd-x86_64/data
default_authentication_plugin=mysql_native_password
socket=/tmp/mariadb.sock
port=3306
log-error=/tmp/mariadb.log
bind_address=redpoll
...

hammerdb@REDPOLL:~/mariadb-10.10.2-linux-systemd-x86_64$ bin/mysqld --defaults-file=./my.cnf --user=hammerdb
2022-12-14 12:14:05 0 [Note] bin/mysqld (server 10.10.2-MariaDB) starting as process 4483 ...

We can check on the host the IP address of the Docker container,  in this case 172.17.0.1 and allow access to HammerDB from the container as the root user.

root@REDPOLL:/home/hammerdb/mariadb-10.10.2-linux-systemd-x86_64# ip addr show docker0
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default 
    link/ether 02:42:a7:d9:56:a9 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever

MariaDB [(none)]> select password('maria');
+-------------------------------------------+
| password('maria')                         |
+-------------------------------------------+
| *8061C323A725701555411A7E18421F077A840CD7 |
+-------------------------------------------+
1 row in set (0.000 sec)

MariaDB [(none)]> create user 'root'@'172.17.0.1' identified by password '*8061C323A725701555411A7E18421F077A840CD7';
Query OK, 0 rows affected (0.002 sec)
MariaDB [(none)]>

Script Configuration

Under the HammerDB home directory is a scripts directory containing example scripts to test all supported databases except for Db2 in both tcl and python format for both TPROC-C and TPROC-H workloads. There is a driver script that can be used to build, test, delete and query the results of a workload with a single script. The scripts are available in both Python and Tcl formats.

root@REDPOLL:/home/hammerdb/HammerDB-4.6# ls -ltR scripts/
scripts/:
total 8
drwxr-xr-x 8 root root 4096 Dec 13 22:31 python
drwxr-xr-x 8 root root 4096 Dec 13 22:31 tcl
scripts/python:
total 24
drwxr-xr-x 2 root root 4096 Dec 13 22:31 generic
drwxr-xr-x 4 root root 4096 Dec 13 22:31 maria
drwxr-xr-x 4 root root 4096 Dec 13 22:31 mssqls
drwxr-xr-x 4 root root 4096 Dec 13 22:31 mysql
drwxr-xr-x 4 root root 4096 Dec 13 22:31 oracle
drwxr-xr-x 4 root root 4096 Dec 13 22:31 postgres

root@REDPOLL:/home/hammerdb/HammerDB-4.6/scripts/tcl/maria/tprocc# ls
maria_tprocc.sh 
maria_tprocc_deleteschema.tcl  
maria_tprocc_run.tcl
maria_tprocc_buildschema.tcl  
maria_tprocc_result.tcl

Update the scripts to be used with the connection settings for the database to be tested. In this case, the MariaDB database is running on port 3306 on host redpoll.  The socket will not be used as the hostname specified is not “localhost”. The connection parameters for all scripts is all we need to change.

!/bin/tclsh
# maintainer: Pooja Jain
puts "SETTING CONFIGURATION"
dbset db maria
dbset bm TPC-C
diset connection maria_host redpoll
diset connection maria_port 3306
diset connection maria_socket /tmp/mariadb.sock
...

By default the schema will build 5 x the number of warehouses of the CPUs on the system.

set vu [ numberOfCPUs ]
set warehouse [ expr {$vu * 5} ]
diset tpcc maria_count_ware $warehouse

and the test will run with the number of Virtual Users equivalent to the number of CPUs.

Run the test

We can now run the main driver script from the HammerDB home directory to build the schema, run the test, delete the schema and then print the results of the test as follows:

root@REDPOLL:/home/hammerdb/HammerDB-4.6# ./scripts/tcl/maria/tprocc/maria_tprocc.sh 
BUILD HAMMERDB SCHEMA 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 
HammerDB CLI v4.6 
Copyright (C) 2003-2022 Steve Shaw 
Type "help" for a list of commands 
Initialized SQLite on-disk database /home/hammerdb/HammerDB-4.6/TMP/hammer.DB using existing tables (229,376 KB) 
SETTING CONFIGURATION 
Database set to MariaDB 
Benchmark set to TPC-C for MariaDB 
Value redpoll for connection:maria_host is the same as existing value redpoll, no change made 
Value 3306 for connection:maria_port is the same as existing value 3306, no change made 
Value /tmp/mariadb.sock for connection:maria_socket is the same as existing value /tmp/mariadb.sock, no change made 
Value 20 for tpcc:maria_count_ware is the same as existing value 20, no change made 
Value 4 for tpcc:maria_num_vu is the same as existing value 4, no change made 
Value root for tpcc:maria_user is the same as existing value root, no change made 
Value maria for tpcc:maria_pass is the same as existing value maria, no change made 
Value tpcc for tpcc:maria_dbase is the same as existing value tpcc, no change made 
Value innodb for tpcc:maria_storage_engine is the same as existing value innodb, no change made 
Value false for tpcc:maria_partition is the same as existing value false, no change made 
SCHEMA BUILD STARTED 
Script cleared 
Building 20 Warehouses with 5 Virtual Users, 4 active + 1 Monitor VU(dict value maria_num_vu is set to 4) 
Ready to create a 20 Warehouse MariaDB TPROC-C schema 
in host REDPOLL:3306 under user ROOT in database TPCC with storage engine INNODB? 
Enter yes or no: replied yes 
Vuser 1 created - WAIT IDLE 
Vuser 2 created - WAIT IDLE 
Vuser 3 created - WAIT IDLE 
Vuser 4 created - WAIT IDLE 
Vuser 5 created - WAIT IDLE 
Vuser 1:RUNNING 
Vuser 1:Monitor Thread 
Vuser 1:CREATING TPCC SCHEMA 
Vuser 1:Ssl_cipher  
Vuser 1:CREATING DATABASE tpcc 
Vuser 1:CREATING TPCC TABLES 
Vuser 1:Loading Item 
Vuser 2:RUNNING 
Vuser 2:Worker Thread 
Vuser 2:Waiting for Monitor Thread... 
Vuser 2:Ssl_cipher  
Vuser 2:Loading 5 Warehouses start:1 end:5 
Vuser 2:Start:Wed Dec 14 13:47:59 +0000 2022 
Vuser 2:Loading Warehouse 
Vuser 2:Loading Stock Wid=1 
Vuser 3:RUNNING 
Vuser 3:Worker Thread 
Vuser 3:Waiting for Monitor Thread... 
Vuser 3:Ssl_cipher  
Vuser 3:Loading 5 Warehouses start:6 end:10 
Vuser 5:Loading Warehouse 
Vuser 5:Loading Stock Wid=16 
...
Vuser 2:FINISHED SUCCESS 
Vuser 3:...2000 
Vuser 3:...3000 
Vuser 3:Orders Done 
Vuser 3:End:Wed Dec 14 13:51:05 +0000 2022 
Vuser 3:FINISHED SUCCESS 
Vuser 1:Workers: 0 Active 4 Done 
Vuser 1:CREATING TPCC STORED PROCEDURES 
Vuser 1:GATHERING SCHEMA STATISTICS 
Vuser 1:TPCC SCHEMA COMPLETE 
Vuser 1:FINISHED SUCCESS 
ALL VIRTUAL USERS COMPLETE 
SCHEMA BUILD COMPLETED 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 
RUN HAMMERDB TEST 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 
HammerDB CLI v4.6 
Copyright (C) 2003-2022 Steve Shaw 
Type "help" for a list of commands 
Initialized SQLite on-disk database /home/hammerdb/HammerDB-4.6/TMP/hammer.DB using existing tables (372,736 KB) 
SETTING CONFIGURATION 
Database set to MariaDB 
Benchmark set to TPC-C for MariaDB 
Value redpoll for connection:maria_host is the same as existing value redpoll, no change made 
Value 3306 for connection:maria_port is the same as existing value 3306, no change made 
Value /tmp/mariadb.sock for connection:maria_socket is the same as existing value /tmp/mariadb.sock, no change made 
Value root for tpcc:maria_user is the same as existing value root, no change made 
Value maria for tpcc:maria_pass is the same as existing value maria, no change made 
Value tpcc for tpcc:maria_dbase is the same as existing value tpcc, no change made 
Value timed for tpcc:maria_driver is the same as existing value timed, no change made 
Value 2 for tpcc:maria_rampup is the same as existing value 2, no change made 
Value 5 for tpcc:maria_duration is the same as existing value 5, no change made 
Value true for tpcc:maria_allwarehouse is the same as existing value true, no change made 
Value true for tpcc:maria_timeprofile is the same as existing value true, no change made 
Script loaded, Type "print script" to view 
TEST STARTED 
Vuser 1 created MONITOR - WAIT IDLE 
Vuser 2 created - WAIT IDLE 
Vuser 3 created - WAIT IDLE 
Vuser 4 created - WAIT IDLE 
Vuser 5 created - WAIT IDLE 
5 Virtual Users Created with Monitor VU 
Transaction Counter Started 
Transaction Counter thread running with threadid:tid0x7fec51ffb700 
0 MariaDB tpm 
Vuser 1:RUNNING 
Vuser 1:Initializing xtprof time profiler 
Vuser 1:Ssl_cipher  
Vuser 1:Beginning rampup time of 2 minutes 
Vuser 2:RUNNING 
Vuser 2:Initializing xtprof time profiler 
Vuser 3:RUNNING 
Vuser 2:Ssl_cipher  
Vuser 3:Initializing xtprof time profiler 
Vuser 2:VU 2 : Assigning WID=1 based on VU count 4, Warehouses = 20 (1 out of 5) 
Vuser 3:Ssl_cipher  
Vuser 2:VU 2 : Assigning WID=5 based on VU count 4, Warehouses = 20 (2 out of 5) 
Vuser 3:VU 3 : Assigning WID=2 based on VU count 4, Warehouses = 20 (1 out of 5) 
Vuser 2:VU 2 : Assigning WID=9 based on VU count 4, Warehouses = 20 (3 out of 5) 
Vuser 3:VU 3 : Assigning WID=6 based on VU count 4, Warehouses = 20 (2 out of 5) 
Vuser 2:VU 2 : Assigning WID=13 based on VU count 4, Warehouses = 20 (4 out of 5) 
Vuser 3:VU 3 : Assigning WID=10 based on VU count 4, Warehouses = 20 (3 out of 5) 
Vuser 2:VU 2 : Assigning WID=17 based on VU count 4, Warehouses = 20 (5 out of 5) 
Vuser 3:VU 3 : Assigning WID=14 based on VU count 4, Warehouses = 20 (4 out of 5) 
Vuser 2:Processing 10000000 transactions with output suppressed... 
Vuser 3:VU 3 : Assigning WID=18 based on VU count 4, Warehouses = 20 (5 out of 5) 
Vuser 3:Processing 10000000 transactions with output suppressed... 
Vuser 4:RUNNING 
Vuser 4:Initializing xtprof time profiler 
Vuser 4:Ssl_cipher  
Vuser 4:VU 4 : Assigning WID=3 based on VU count 4, Warehouses = 20 (1 out of 5) 
Vuser 4:VU 4 : Assigning WID=7 based on VU count 4, Warehouses = 20 (2 out of 5) 
Vuser 4:VU 4 : Assigning WID=11 based on VU count 4, Warehouses = 20 (3 out of 5) 
Vuser 4:VU 4 : Assigning WID=15 based on VU count 4, Warehouses = 20 (4 out of 5) 
Vuser 4:VU 4 : Assigning WID=19 based on VU count 4, Warehouses = 20 (5 out of 5) 
Vuser 4:Processing 10000000 transactions with output suppressed... 
Vuser 5:RUNNING 
Vuser 5:Initializing xtprof time profiler 
Vuser 5:Ssl_cipher  
Vuser 5:VU 5 : Assigning WID=4 based on VU count 4, Warehouses = 20 (1 out of 5) 
Vuser 5:VU 5 : Assigning WID=8 based on VU count 4, Warehouses = 20 (2 out of 5) 
Vuser 5:VU 5 : Assigning WID=12 based on VU count 4, Warehouses = 20 (3 out of 5) 
Vuser 5:VU 5 : Assigning WID=16 based on VU count 4, Warehouses = 20 (4 out of 5) 
Vuser 5:VU 5 : Assigning WID=20 based on VU count 4, Warehouses = 20 (5 out of 5) 
Vuser 5:Processing 10000000 transactions with output suppressed... 
54690 MariaDB tpm 
86406 MariaDB tpm 
63144 MariaDB tpm 
55824 MariaDB tpm 
90012 MariaDB tpm 
Vuser 1:Rampup 1 minutes complete ... 
90228 MariaDB tpm 
93984 MariaDB tpm 
79008 MariaDB tpm 
67278 MariaDB tpm 
62952 MariaDB tpm 
93834 MariaDB tpm 
107478 MariaDB tpm 
Vuser 1:Rampup 2 minutes complete ... 
Vuser 1:Rampup complete, Taking start Transaction Count. 
Vuser 1:Timing test period of 5 in minutes 
104154 MariaDB tpm 
95004 MariaDB tpm 
82794 MariaDB tpm 
83328 MariaDB tpm 
74424 MariaDB tpm 
43962 MariaDB tpm 
Vuser 1:1 ..., 
105270 MariaDB tpm 
37362 MariaDB tpm 
12816 MariaDB tpm 
5304 MariaDB tpm 
10470 MariaDB tpm 
6084 MariaDB tpm 
Vuser 1:2 ..., 
5730 MariaDB tpm 
6048 MariaDB tpm 
6768 MariaDB tpm 
9438 MariaDB tpm 
11280 MariaDB tpm 
10428 MariaDB tpm 
Vuser 1:3 ..., 
17022 MariaDB tpm 
14310 MariaDB tpm 
19374 MariaDB tpm 
22326 MariaDB tpm 
16698 MariaDB tpm 
20100 MariaDB tpm 
21000 MariaDB tpm 
Vuser 1:4 ..., 
10902 MariaDB tpm 
14898 MariaDB tpm 
60228 MariaDB tpm 
37632 MariaDB tpm 
50778 MariaDB tpm 
34044 MariaDB tpm 
Vuser 1:5 ..., 
Vuser 1:Test complete, Taking end Transaction Count. 
Vuser 1:4 Active Virtual Users configured 
Vuser 1:TEST RESULT : System achieved 15199 NOPM from 35354 MariaDB TPM 
Vuser 1:Gathering timing data from Active Virtual Users... 
48096 MariaDB tpm 
Vuser 5:FINISHED SUCCESS 
Vuser 2:FINISHED SUCCESS 
Vuser 3:FINISHED SUCCESS 
Vuser 4:FINISHED SUCCESS 
Vuser 1:Calculating timings... 
8226 MariaDB tpm 
Vuser 1:Writing timing data to /home/hammerdb/HammerDB-4.6/TMP/hdbxtprofile.log 
0 MariaDB tpm 
0 MariaDB tpm 
0 MariaDB tpm 
0 MariaDB tpm 
0 MariaDB tpm 
0 MariaDB tpm 
0 MariaDB tpm 
0 MariaDB tpm 
0 MariaDB tpm 
Vuser 1:FINISHED SUCCESS 
ALL VIRTUAL USERS COMPLETE 
0 MariaDB tpm 
vudestroy success 
Transaction Counter thread running with threadid:tid0x7fec51ffb700 
Stopping Transaction Counter 
TEST COMPLETE 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 
DROP HAMMERDB SCHEMA 
HammerDB CLI v4.6 
Copyright (C) 2003-2022 Steve Shaw 
Type "help" for a list of commands 
Initialized SQLite on-disk database /home/hammerdb/HammerDB-4.6/TMP/hammer.DB using existing tables (397,312 KB) 
SETTING CONFIGURATION 
Database set to MariaDB 
Benchmark set to TPC-C for MariaDB 
Value redpoll for connection:maria_host is the same as existing value redpoll, no change made 
Value 3306 for connection:maria_port is the same as existing value 3306, no change made 
Value /tmp/mariadb.sock for connection:maria_socket is the same as existing value /tmp/mariadb.sock, no change made 
Value root for tpcc:maria_user is the same as existing value root, no change made 
Value maria for tpcc:maria_pass is the same as existing value maria, no change made 
Value tpcc for tpcc:maria_dbase is the same as existing value tpcc, no change made 
 DROP SCHEMA STARTED 
Script cleared 
Deleting schema with 1 Virtual User 
Do you want to delete the TPCC TPROC-C schema 
 in host REDPOLL:3306 under user ROOT? 
Enter yes or no: replied yes 
Vuser 1 created - WAIT IDLE 
Vuser 1:RUNNING 
Vuser 1:Ssl_cipher  
DROP SCHEMA COMPLETED 
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- 
HAMMERDB RESULT 
HammerDB CLI v4.6 
Copyright (C) 2003-2022 Steve Shaw 
Type "help" for a list of commands 
Initialized SQLite on-disk database /home/hammerdb/HammerDB-4.6/TMP/hammer.DB using existing tables (397,312 KB) 
TRANSACTION RESPONSE TIMES 
{ 
  "DELIVERY": { 
    "elapsed_ms": "439561.0", 
    "calls": "3320", 
    "min_ms": "4.383", 
    "avg_ms": "59.972", 
    "max_ms": "77608.65", 
    "total_ms": "199106.945", 
    "p99_ms": "307.374", 
    "p95_ms": "10.461", 
    "p50_ms": "5.74", 
    "sd": "1684200.807", 
    "ratio_pct": "45.476" 
  }, 
  "NEWORD": { 
    "elapsed_ms": "439561.0", 
    "calls": "33945", 
    "min_ms": "1.227", 
    "avg_ms": "5.016", 
    "max_ms": "17419.641", 
    "total_ms": "170261.191", 
    "p99_ms": "8.509", 
    "p95_ms": "4.596", 
    "p50_ms": "2.503", 
    "sd": "105049.036", 
    "ratio_pct": "38.888" 
  }, 
  "PAYMENT": { 
    "elapsed_ms": "439561.0", 
    "calls": "33696", 
    "min_ms": "0.602", 
    "avg_ms": "1.512", 
    "max_ms": "2687.342", 
    "total_ms": "50964.941", 
    "p99_ms": "3.443", 
    "p95_ms": "1.773", 
    "p50_ms": "1.004", 
    "sd": "23559.832", 
    "ratio_pct": "11.64" 
  }, 
  "OSTAT": { 
    "elapsed_ms": "439561.0", 
    "calls": "3393", 
    "min_ms": "0.454", 
    "avg_ms": "3.023", 
    "max_ms": "1321.03", 
    "total_ms": "10255.874", 
    "p99_ms": "3.218", 
    "p95_ms": "1.519", 
    "p50_ms": "0.868", 
    "sd": "44465.804", 
    "ratio_pct": "2.342" 
  }, 
  "SLEV": { 
    "elapsed_ms": "439561.0", 
    "calls": "3310", 
    "min_ms": "0.82", 
    "avg_ms": "1.352", 
    "max_ms": "184.051", 
    "total_ms": "4476.381", 
    "p99_ms": "3.524", 
    "p95_ms": "1.995", 
    "p50_ms": "1.135", 
    "sd": "3229.144", 
    "ratio_pct": "1.022" 
  } 
} 
 
TRANSACTION COUNT 
{"MariaDB tpm": { 
    "0": "2022-12-14 14:00:23", 
    "54690": "2022-12-14 13:51:19", 
    "86406": "2022-12-14 13:51:29", 
    "63144": "2022-12-14 13:51:39", 
    "55824": "2022-12-14 13:51:49", 
    "90012": "2022-12-14 13:51:59", 
    "90228": "2022-12-14 13:52:10", 
    "93984": "2022-12-14 13:52:19", 
    "79008": "2022-12-14 13:52:29", 
    "67278": "2022-12-14 13:52:39", 
    "62952": "2022-12-14 13:52:49", 
    "93834": "2022-12-14 13:52:59", 
    "107478": "2022-12-14 13:53:09", 
    "104154": "2022-12-14 13:53:19", 
    "95004": "2022-12-14 13:53:29", 
    "82794": "2022-12-14 13:53:39", 
    "83328": "2022-12-14 13:53:49", 
    "74424": "2022-12-14 13:53:59", 
    "43962": "2022-12-14 13:54:09", 
    "105270": "2022-12-14 13:54:19", 
    "37362": "2022-12-14 13:54:29", 
    "12816": "2022-12-14 13:54:39", 
    "5304": "2022-12-14 13:54:49", 
    "10470": "2022-12-14 13:54:59", 
    "6084": "2022-12-14 13:55:09", 
    "5730": "2022-12-14 13:55:19", 
    "6048": "2022-12-14 13:55:29", 
    "6768": "2022-12-14 13:55:39", 
    "9438": "2022-12-14 13:55:49", 
    "11280": "2022-12-14 13:56:00", 
    "10428": "2022-12-14 13:56:10", 
    "17022": "2022-12-14 13:56:22", 
    "14310": "2022-12-14 13:56:30", 
    "19374": "2022-12-14 13:56:40", 
    "22326": "2022-12-14 13:56:50", 
    "16698": "2022-12-14 13:57:00", 
    "20100": "2022-12-14 13:57:10", 
    "21000": "2022-12-14 13:57:20", 
    "10902": "2022-12-14 13:57:30", 
    "14898": "2022-12-14 13:57:40", 
    "60228": "2022-12-14 13:57:50", 
    "37632": "2022-12-14 13:58:00", 
    "50778": "2022-12-14 13:58:10", 
    "34044": "2022-12-14 13:58:20", 
    "48096": "2022-12-14 13:58:32", 
    "8226": "2022-12-14 13:58:45" 
  }} 
 
HAMMERDB RESULT 
[ 
  "6399D4CD5EFC03E233239383", 
  "2022-12-14 13:51:09", 
  "4 Active Virtual Users configured", 
  "TEST RESULT : System achieved 15199 NOPM from 35354 MariaDB TPM" 
]

Note that we captured the job timings, transaction count and test result at the end of the test.

Results storage

HammerDB will export a TMP directory in the HammerDB home directory for the storage of configuration databases and a text output of results.

root@REDPOLL:/home/hammerdb/HammerDB-4.6/TMP# ls
database.db  hammer.DB-journal                          mariadb.db      postgresql.db
db2.db       hdbxtprofile.log                           mssqlserver.db
generic.db   maria_tprocc                               mysql.db
hammer.DB    maria_tprocc_6399D4CD5EFC03E233239383.out  oracle.db

However with the jobs command, you can also query the results directly from the repository.

hammerdb>job "6399D4CD5EFC03E233239383" result
[
  "6399D4CD5EFC03E233239383",
  "2022-12-14 13:51:09",
  "4 Active Virtual Users configured",
  "TEST RESULT : System achieved 15199 NOPM from 35354 MariaDB TPM"
]

Stopping and Starting Docker

Use the Docker, stop, start and attach commands to run the HammerDB container when required.

root@REDPOLL:~# docker stop hammerdb
hammerdb
root@REDPOLL:~# docker start hammerdb
hammerdb
root@REDPOLL:~# docker attach hammerdb
root@REDPOLL:/home/hammerdb/HammerDB-4.6#

Summary

In this post we have used the offical HammerDB docker container from tpcorg to rapidly deploy HammerDB and run the included example scripts to gain an insight into database performance on our host system. You can also run HammerDB interactively or with your own scripts to gain further insight.

Author