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

外部链接