提供GaussDB使用BenchmarkSQL進行性能測試的方法和測試數(shù)據(jù)報告。
BenchmarkSQL,一個JDBC基準測試工具,內(nèi)嵌了TPC-C測試腳本,支持很多數(shù)據(jù)庫,如PostgreSQL、Oracle和Mysql等。
TPC-C是專門針對聯(lián)機交易處理系統(tǒng)(OLTP系統(tǒng))的規(guī)范,一般情況下我們也把這類系統(tǒng)稱為業(yè)務(wù)處理系統(tǒng)。幾乎所有在OLTP市場提供軟硬平臺的國外主流廠商都發(fā)布了相應(yīng)的TPC-C測試結(jié)果,隨著計算機技術(shù)的不斷發(fā)展,這些測試結(jié)果也在不斷刷新。
測試環(huán)境
局點:華為云。
實例類型:分布式。
規(guī)格選擇:16U128G和32U256G。
集群規(guī)模:3CN,3分片,3副本。
測試方法
1.修改連接配置。
配置文件所在目錄為:./run/props.pg
2.重點參數(shù)修改。
//連接配置
conn=jdbc:postgresql://127.0.0.1:8000/postgres?autoBalance=true
//連接用戶名
user=****
//連接密碼
password=****
//壓入數(shù)據(jù)量
warehouses=1000
//壓入并發(fā)
loadWorkers=10
//業(yè)務(wù)并發(fā)
terminals=2048
//運行時間
runMins=30
3.壓數(shù)據(jù)
cd ~/BenchmarkSQL-5.0/run
./runDatabaseBuild.sh props.pg
4.運行tpcc業(yè)務(wù)場景
cd ~/BenchmarkSQL-5.0/run
./runBenchmark.sh props.pg
建表語句
create table bmsql_config (
cfg_name varchar(30),
cfg_value varchar(50)
) DISTRIBUTE BY REPLICATION;
create table bmsql_warehouse (
w_id integer not null,
w_ytd decimal(12,2),
w_tax decimal(4,4),
w_name varchar(10),
w_street_1 varchar(20),
w_street_2 varchar(20),
w_city varchar(20),
w_state char(2),
w_zip char(9)
)WITH (FILLFACTOR=80) DISTRIBUTE BY hash(w_id);
create table bmsql_district (
d_w_id integer not null,
d_id integer not null,
d_ytd decimal(12,2),
d_tax decimal(4,4),
d_next_o_id integer,
d_name varchar(10),
d_street_1 varchar(20),
d_street_2 varchar(20),
d_city varchar(20),
d_state char(2),
d_zip char(9)
)WITH (FILLFACTOR=80) DISTRIBUTE BY hash(d_w_id);
create table bmsql_customer (
c_w_id integer not null,
c_d_id integer not null,
c_id integer not null,
c_discount decimal(4,4),
c_credit char(2),
c_last varchar(16),
c_first varchar(16),
c_credit_lim decimal(12,2),
c_balance decimal(12,2),
c_ytd_payment decimal(12,2),
c_payment_cnt integer,
c_delivery_cnt integer,
c_street_1 varchar(20),
c_street_2 varchar(20),
c_city varchar(20),
c_state char(2),
c_zip char(9),
c_phone char(16),
c_since timestamp,
c_middle char(2),
c_data varchar(500)
)WITH (FILLFACTOR=80) DISTRIBUTE BY hash(c_w_id);
create sequence bmsql_hist_id_seq cache 1000;
create table bmsql_history (
hist_id integer,
h_c_id integer,
h_c_d_id integer,
h_c_w_id integer,
h_d_id integer,
h_w_id integer,
h_date timestamp,
h_amount decimal(6,2),
h_data varchar(24)
)WITH (FILLFACTOR=80) DISTRIBUTE BY hash(h_w_id);
create table bmsql_new_order (
no_w_id integer not null,
no_d_id integer not null,
no_o_id integer not null
)WITH (FILLFACTOR=80) DISTRIBUTE BY hash(no_w_id);
create table bmsql_oorder (
o_w_id integer not null,
o_d_id integer not null,
o_id integer not null,
o_c_id integer,
o_carrier_id integer,
o_ol_cnt integer,
o_all_local integer,
o_entry_d timestamp
)WITH (FILLFACTOR=80) DISTRIBUTE BY hash(o_w_id);
create table bmsql_order_line (
ol_w_id integer not null,
ol_d_id integer not null,
ol_o_id integer not null,
ol_number integer not null,
ol_i_id integer not null,
ol_delivery_d timestamp,
ol_amount decimal(6,2),
ol_supply_w_id integer,
ol_quantity integer,
ol_dist_info char(24)
)WITH (FILLFACTOR=80) DISTRIBUTE BY hash(ol_w_id);
create table bmsql_item (
i_id integer not null,
i_name varchar(24),
i_price decimal(5,2),
i_data varchar(50),
i_im_id integer
) DISTRIBUTE BY REPLICATION;
create table bmsql_stock (
s_w_id integer not null,
s_i_id integer not null,
s_quantity integer,
s_ytd integer,
s_order_cnt integer,
s_remote_cnt integer,
s_data varchar(50),
s_dist_01 char(24),
s_dist_02 char(24),
s_dist_03 char(24),
s_dist_04 char(24),
s_dist_05 char(24),
s_dist_06 char(24),
s_dist_07 char(24),
s_dist_08 char(24),
s_dist_09 char(24),
s_dist_10 char(24)
)WITH (FILLFACTOR=80) DISTRIBUTE BY hash(s_w_id);
測試指標
流量指標(Throughput,簡稱tpmC):按照TPC組織的定義,流量指標描述了系統(tǒng)在執(zhí)行支付操作、訂單狀態(tài)查詢、發(fā)貨和庫存狀態(tài)查詢這4種交易的同時,每分鐘可以處理多少個新訂單交易。
所有交易的響應(yīng)時間必須滿足TPC-C測試規(guī)范的要求,且各種交易數(shù)量所占的比例也應(yīng)該滿足TPC-C測試規(guī)范的要求。在這種情況下,流量指標值越大說明系統(tǒng)的聯(lián)機事務(wù)處理能力越高。