溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

怎么使用PostgreSQL中的benchmarksql

發(fā)布時間:2021-11-08 16:27:23 來源:億速云 閱讀:220 作者:iii 欄目:關(guān)系型數(shù)據(jù)庫

這篇文章主要介紹“怎么使用PostgreSQL中的benchmarksql”,在日常操作中,相信很多人在怎么使用PostgreSQL中的benchmarksql問題上存在疑惑,小編查閱了各式資料,整理出簡單好用的操作方法,希望對大家解答”怎么使用PostgreSQL中的benchmarksql”的疑惑有所幫助!接下來,請跟著小編一起來學習吧!

benchmarksql是一款使用Java開發(fā)的測試工具.
安裝使用相對比較簡單,下載解壓到安裝目錄

cd /home/pg12/software/benchmarksql-4.1.1/run

配置參數(shù),修改配置文件props.pg

#############################################
[pg12@localhost run]$ cat props.pg 
//數(shù)據(jù)庫連接信息
driver=org.postgresql.Driver
conn=jdbc:postgresql://192.168.26.28:5440/benchmarkdb
user=pg12
password=pg12
//多少倉
warehouses=100
//并發(fā)數(shù)
terminals=20
//To run specified transactions per terminal- runMins must equal zero
runTxnsPerTerminal=0
//To run for specified minutes- runTxnsPerTerminal must equal zero
//這是運行時間
runMins=10
//Number of total transactions per minute
limitTxnsPerMin=0
//The following five values must add up to 100
//The default percentages of 45, 43, 4, 4 & 4 match the TPC-C spec
newOrderWeight=45
paymentWeight=43
orderStatusWeight=4
deliveryWeight=4
stockLevelWeight=4

創(chuàng)建數(shù)據(jù)表&索引(100倉的數(shù)據(jù))

#############################################
./runSQL.sh  props.pg sqlTableCreates
./runLoader.sh props.pg  numwarehouses 32
./runSQL.sh  props.pg sqlIndexCreates

執(zhí)行測試

./runBenchmark.sh props.pg
#1
...
2019-08-27 16:30:33,025  INFO - Term-00, Measured tpmC (NewOrders) = 7527.02                              
2019-08-27 16:30:33,025  INFO - Term-00, Measured tpmTOTAL = 16752.67
2019-08-27 16:30:33,025  INFO - Term-00, Session Start     = 2019-08-27 16:20:32
2019-08-27 16:30:33,025  INFO - Term-00, Session End       = 2019-08-27 16:30:33
2019-08-27 16:30:33,025  INFO - Term-00, Transaction Count = 167552
#2
...
2019-08-27 17:30:27,264  INFO - Term-00, Measured tpmC (NewOrders) = 5879.05
2019-08-27 17:30:27,264  INFO - Term-00, Measured tpmTOTAL = 13086.97                                    
2019-08-27 17:30:27,264  INFO - Term-00, Session Start     = 2019-08-27 17:20:20
2019-08-27 17:30:27,265  INFO - Term-00, Session End       = 2019-08-27 17:30:27
2019-08-27 17:30:27,265  INFO - Term-00, Transaction Count = 132408

到此,關(guān)于“怎么使用PostgreSQL中的benchmarksql”的學習就結(jié)束了,希望能夠解決大家的疑惑。理論與實踐的搭配能更好的幫助大家學習,快去試試吧!若想繼續(xù)學習更多相關(guān)知識,請繼續(xù)關(guān)注億速云網(wǎng)站,小編會繼續(xù)努力為大家?guī)砀鄬嵱玫奈恼拢?/p>

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI