escamil - Hugo deployed website

Rob's Menagerie (recipes and such)

HammerDB Benchmarking

HammerDB is a long-standing easy-to-use database benchmarking tool that creates artificial workloads
using TPC-C workflow (CRUD) collated performance analysis. It supports Postgres, MariaDB, Oracle, etc. While slightly tricky to install and configure, compounded with a quirky interface,
the following is my walkthru for how to deploy on a ubuntu/Amazon Linux client.

Prerequisites:

  1. Install postgres-contrib package and dev package to "make" hammerdb
  apt list --installed | grep postgres       # verify packages not installed
  apt search postgresql
  apt-get install postgresql-contrib-17.5    # update to include your current version
  sudo apt install postgresql-server-dev-17
  1. Change to local folder to store HammerDB Source
  export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/ # location of libpq.dll/libpq.so
  git clone https://github.com/pgsentinel/pgsentinel.git
  cd  pgsentinel/src/
  make
  sudo make install

libpq driver may also exist: /var/lib/postgresql/17/main, /etc/postgresql/17/main/ and can also be found by running /usr/bin/pg_config tool

Configure database with required extensions

postgresql.conf updates (most likely in: /etc/postgresql/17/main/)

shared_preload_libraries = 'pg_stat_statements,pgsentinel'
track_activity_query_size=2048
pg_stat_statements.save=on
pg_stat_statements.track=all
pgsentinel_pgssh.enable = true
pgsentinel_ash.pull_frequency = 1
pgsentinel_ash.max_entries = 1000000

After updating config file, enable extension:
sudo su - postgres
psql postgres -c "CREATE EXTENSION pgsentinel;"

restart postgres
$ /usr/lib/postgresql/17/bin/postgres --config-file=/etc/postgresql/17/main/postgresql.conf

Verify Extensions

SELECT * FROM pg_extension; or \dx

HammerDB Installation

Download Package: hammerdb_5.0-1.ubu24.amd64.deb

$ sudo apt-get install -f ./hammerdb_5.0-1.ubu24.amd64.deb

Launch HammerDB

$ cd /opt/HammerDB-5.0/
$ export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/      # libpq.dll/libpq.so location
$ ./hammerdb

Reference

HammerDB New Features
Postgres-specific Benchmark Performance walkthru

Last updated on 2 Jul 2025
Published on 2 Jul 2025