sudo apt install -y ant default-jdk openjdk-8-jdk git locales
cd ~
git clone <https://github.com/oltpbenchmark/oltpbench.git>
cd ~/oltpbench
ant clean
ant
cd ~/oltpbench
cp config/tpcc_config_postgres.xml config/tpcc.xml
vim config/tpcc.xml
# Change "DBUrl", "username", and "password".
cd ~/oltpbench
./oltpbenchmark -b tpcc -c config/tpcc.xml --create=true
./oltpbenchmark -b tpcc -c config/tpcc.xml --load=true
# Test it:
cd ~/oltpbench
./oltpbenchmark -b tpcc -c config/tpcc.xml --execute=true
# Just need data:
cd ~/oltpbench
./oltpbenchmark -b tpcc -c config/tpcc.xml --execute=true | \\
grep 'Rate limited'
# Do benchmark 100 times:
cd ~/oltpbench
for i in {1..100}; do
./oltpbenchmark -b tpcc -c config/tpcc.xml --execute=true 2>&1 | \\
grep 'Rate limited'
done
# Get average result:
cd ~/oltpbench
(for i in {1..100}; do
./oltpbenchmark -b tpcc -c config/tpcc.xml --execute=true 2>&1 | \\
grep 'Rate limited'
done) | awk '{sum += $(NF - 1); print $(NF - 1)} END {print sum / NR}'
This section discusses CockroachDB mainly.
CONSTRAINT
to non-indexed columns, you need to remove these CONSTRAINT
entries in PostgreSQL's DDL SQL file (and rebuild oltpbenchmark):cd ~/oltpbench
vim src/com/oltpbenchmark/benchmarks/tpcc/ddls/tpcc-postgres-ddl.sql
# Remove all "ALTER TABLE ... ADD CONSTRAINT ..." entries near the end of
# the file.
# Then rebuild oltpbenchmark:
cd ~/oltpbench
ant clean
ant
TRANSACTION_SERIALIZABLE
in tpcc.xml
because CockroackDB supports SERIALIZABLE only.