「Oltpbenchmark」:修訂間差異

出自Gea-Suan Lin's Wiki
跳至導覽 跳至搜尋
本頁面具有訪問限制。如果您看見此訊息,這代表您沒有訪問本頁面的權限。
行 64: 行 64:
== 外部連結 ==
== 外部連結 ==
* {{Official|https://github.com/oltpbenchmark/oltpbench}}
* {{Official|https://github.com/oltpbenchmark/oltpbench}}
* [https://www.notion.so/gslin/How-to-use-oltpbenchmark-32c1bb0b235041e595274f5af403da6b How to use oltpbenchmark]


[[Category:軟體]]
[[Category:軟體]]

於 2018年12月31日 (一) 04:53 的修訂

oltpbenchmark是一套Java寫的資料庫效能測試程式。

安裝

先下載:

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}'

外部連結