HammerDB v4.5 introduced a Dockerfile and Docker Images to pull from Docker Hub for rapid deployment of HammerDB with builds already including third-party database libraries.
HammerDB v4.7 introduces more lightweight database specific Docker Images, so if you only want to run benchmarks against a specific database you can go from having no benchmarking environment to reviewing your results in as little as 3 commands.
In this example, we will use the PostgreSQL Docker image and have PostgreSQL running on our Linux system. To install HammerDB for Docker we pull the PostgreSQL specific image.
1.
~/pgsql$ sudo docker pull tpcorg/hammerdb:postgres
[sudo] password for hammerdb:
postgres: Pulling from tpcorg/hammerdb
06d39c85623a: Already exists
a030842f98bc: Pull complete
c5c513b4b24b: Pull complete
6b7637531b01: Pull complete
bdf997c08005: Pull complete
f6cc176b4372: Pull complete
bb48f6545dc6: Pull complete
4f4fb700ef54: Pull complete
Digest: sha256:59d901bfd14452ca3f345524384dd9d4b61effcc555e5133a71534440141c378
Status: Downloaded newer image for tpcorg/hammerdb:postgres
docker.io/tpcorg/hammerdb:postgres
and run it as follows:
2.
~/pgsql$ sudo docker run --network=host -it --name hammerdb-postgres tpcorg/hammerdb:postgres bash
As HammerDB has built in example scripts, if our database has default connection parameters, we can go straight ahead and run the PostgreSQL driver script. Alternatively, the following post explains how to update the scripts for your connection parameters. Note that if you are sure that you are using the default connection parameters, you can go ahead and run the script instead of the bash shell in step 2 as above.
3.
/home/hammerdb/HammerDB-4.7# ./scripts/tcl/postgres/tprocc/pg_tprocc.sh
When the script has finished we can gather our results, having installed, started and run a benchmark in our HammerDB Docker image in 3 steps.
...
BUILD HAMMERDB SCHEMA
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
HammerDB CLI v4.7
...
HAMMERDB RESULT
HammerDB CLI v4.7
Copyright (C) 2003-2023 Steve Shaw
Type "help" for a list of commands
Initialized SQLite on-disk database /home/hammerdb/HammerDB-4.7/TMP/hammer.DB using existing tables (188,416 KB)
TRANSACTION RESPONSE TIMES
{
"NEWORD": {
"elapsed_ms": "436026.5",
"calls": "33387",
"min_ms": "0.505",
"avg_ms": "7.431",
"max_ms": "8131.221",
"total_ms": "248091.653",
"p99_ms": "31.727",
"p95_ms": "2.933",
"p50_ms": "1.676",
"sd": "147681.729",
"ratio_pct": "56.998"
},
"PAYMENT": {
"elapsed_ms": "436026.5",
"calls": "33439",
"min_ms": "0.28",
"avg_ms": "3.821",
"max_ms": "9115.8",
"total_ms": "127767.668",
"p99_ms": "5.088",
"p95_ms": "1.645",
"p50_ms": "0.852",
"sd": "115840.578",
"ratio_pct": "29.354"
},
"DELIVERY": {
"elapsed_ms": "436026.5",
"calls": "3300",
"min_ms": "1.129",
"avg_ms": "8.367",
"max_ms": "7738.33",
"total_ms": "27612.602",
"p99_ms": "39.382",
"p95_ms": "6.893",
"p50_ms": "3.635",
"sd": "144034.336",
"ratio_pct": "6.344"
},
"SLEV": {
"elapsed_ms": "436026.5",
"calls": "3296",
"min_ms": "0.804",
"avg_ms": "4.103",
"max_ms": "1834.672",
"total_ms": "13524.524",
"p99_ms": "8.315",
"p95_ms": "4.386",
"p50_ms": "2.685",
"sd": "39241.027",
"ratio_pct": "3.107"
},
"OSTAT": {
"elapsed_ms": "436026.5",
"calls": "3378",
"min_ms": "0.203",
"avg_ms": "3.592",
"max_ms": "2699.458",
"total_ms": "12135.334",
"p99_ms": "22.288",
"p95_ms": "1.47",
"p50_ms": "0.64",
"sd": "65613.436",
"ratio_pct": "2.788"
}
}
TRANSACTION COUNT
{"PostgreSQL tpm": {
"0": "2023-03-27 15:22:48",
"65952": "2023-03-27 15:22:58",
"72756": "2023-03-27 15:23:08",
"50502": "2023-03-27 15:23:18",
"41172": "2023-03-27 15:23:28",
"55320": "2023-03-27 15:23:38",
"72258": "2023-03-27 15:23:49",
"68442": "2023-03-27 15:23:58",
"61098": "2023-03-27 15:24:08",
"52602": "2023-03-27 15:24:18",
"57360": "2023-03-27 15:24:28",
"56484": "2023-03-27 15:24:38",
"74220": "2023-03-27 15:24:48",
"55518": "2023-03-27 15:24:58",
"69714": "2023-03-27 15:25:09",
"63444": "2023-03-27 15:25:19",
"62340": "2023-03-27 15:25:29",
"57720": "2023-03-27 15:25:39",
"40698": "2023-03-27 15:25:49",
"40446": "2023-03-27 15:25:59",
"39720": "2023-03-27 15:26:09",
"31398": "2023-03-27 15:26:19",
"38124": "2023-03-27 15:26:29",
"36048": "2023-03-27 15:26:39",
"29814": "2023-03-27 15:26:49",
"34938": "2023-03-27 15:26:59",
"13980": "2023-03-27 15:27:09",
"23304": "2023-03-27 15:27:19",
"11022": "2023-03-27 15:27:29",
"47718": "2023-03-27 15:27:39",
"38202": "2023-03-27 15:27:49",
"36006": "2023-03-27 15:27:59",
"11832": "2023-03-27 15:28:09",
"29982": "2023-03-27 15:28:19",
"37308": "2023-03-27 15:28:29",
"36054": "2023-03-27 15:28:39",
"21456": "2023-03-27 15:28:49",
"15510": "2023-03-27 15:28:59",
"36534": "2023-03-27 15:29:10",
"34746": "2023-03-27 15:29:20",
"28920": "2023-03-27 15:29:30",
"8976": "2023-03-27 15:29:40",
"29280": "2023-03-27 15:29:50",
"38514": "2023-03-27 15:30:03",
"24288": "2023-03-27 15:30:10",
}}
HAMMERDB RESULT
[
"6421B4C85F7E03E293532393",
"2023-03-27 15:22:48",
"4 Active Virtual Users configured",
"TEST RESULT : System achieved 15824 NOPM from 36400 PostgreSQL TPM"
]
If preferred, to access utilities such as PostgreSQL metrics in this example, you can also run the HammerDB GUI and export the DISPLAY back to your host Desktop.