Overview
BenchMarkSQL is a JAVA implementation tool based on the TPC-C benchmark. TPC-C is an online transaction processing (OLTP) benchmark. It uses a commodity sales model to test an OLTP system. For more information, see TPC-C.
Test plan
Deploy an OceanBase cluster in the 1:1:1 pattern, with three OBServer nodes evenly distributed across three zones. After successful deployment, create the tenant and users required for running the TPC-C benchmark. The
systenant is a built-in system tenant used for managing the cluster. Do not use the sys tenant to run the benchmark. SetPRIMARY_ZONEof the tenant toRANDOM.The following table describes the specifications of the test environment.
warehouses=1000 loadWorkers=40 terminals = 800 runMins = 5 newOrderWeight = 45 paymentWeight = 43 orderStatusWeight = 4 deliveryWeight = 4 stockLevelWeight = 4
Test environment
Hardware configuration
Project type Memory CPU OceanBase Database 3 × 128 GB 3 × 32 cores BenchMarkSQL 1 × 128 GB 1 × 32 cores ODP 1 × 128 GB 1 × 32 cores Tenant specifications
CREATE RESOURCE UNIT if not exists fu_xyoracle MAX_CPU 80, MAX_MEMORY 500000000000, MAX_IOPS 128, MAX_DISK_SIZE 1000000000, MAX_SESSION_NUM 64, MIN_CPU=80, MIN_MEMORY=500000000000, MIN_IOPS=128; CREATE RESOURCE POOL if not exists f_pool_xyoracle UNIT= 'fu_xyoracle', UNIT_NUM=1, ZONE_LIST= ('z1','z2','z3'); CREATE TENANT xyoracle RESOURCE_POOL_LIST=('f_pool_xyoracle'), PRIMARY_ZONE=RANDOM, LOCALITY='F@z1,F@z2,F@z3' SET ob_compatibility_mode='oracle',ob_tcp_invited_nodes='%';Note
- You must dynamically adjust the parameters based on the hardware configurations of your database. For more information, see Modify a tenant.
- To test the performance of a tenant, you must configure the maximum available resources of the tenant.
Software version
Project type Software version and model OceanBase Database V3.2.3 ODP V3.1.0 BenchMarkSQL V5.0 oceanbase-client oceanbase-client-1.1.10 OS CentOS Linux release 7.9.2009 (Core) CPU Intel(R) Xeon(R) Platinum 8369B CPU @ 2.70GHz
Environment information
Operating system information
$cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
$uname -a
Linux testdriver 3.10.0-1160.24.1.el7.x86_64 #1 SMP Thu Apr 8 19:51:47 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
CPU information
$lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 2
Core(s) per socket: 16
Socket: 1
NUMA node: 1
Manufacturer ID: GenuineIntel
CPU series: 6
Model: 106
Model name: Intel(R) Xeon(R) Platinum 8369B CPU @ 2.70GHz
Step size: 6
CPU MHz: 2699.998
BogoMIPS: 5399.99
Hypermanager manufacturer: KVM
Virtualization type: Full
L1d cache: 48K
L1i cache: 32K
L2 cache: 1280K
L3 cache: 49152K
NUMA node 0 CPU: 0-31
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc eagerfpu pni pclmulqdq monitor ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch invpcid_single ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 arat avx512vbmi avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq arch_capabilities
Memory information
$free -g
total used free shared buff/cache available
Mem: 123 41 2 0 79 81
Swap: 0 0 0
Software information
OBServer
$./observer -V
observer (OceanBase Database V3.2.3)
REVISION: 20220125174436-b765b7557c36d62bcd42597142fe0ee34bd21f6e
BUILD_BRANCH: 3_2_x_release
BUILD_TIME: Jan 25 2022 17:56:14
BUILD_FLAGS: RelWithDebInfo
BUILD_INFO:
Copyright (c) 2011-2020 Alipay Inc.
ODP
$./obproxy -V
obproxy (OceanBase Database V3.1.0 4358.el6)
REVISION: 4358-local-9a6209a5e7db8e692882782ce67cf6359f03c3ab
BUILD_TIME: May 5 2021 23:00:26
BUILD_FLAGS: -g -O2 -D_OB_VERSION=1000 -D_NO_EXCEPTION -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DNDEBUG -D__USE_LARGEFILE64 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -Wall -Wextra -Wunused-parameter -Wformat -Wconversion -Wno-deprecated -Wno-invalid-offsetof -finline-functions -fno-strict-aliasing -mtune=core2 -Wno-psabi -Wno-sign-compare -DGCC_52 -DUSE_POSIX_FALLOCATE -DSUPPORT_SSE4_2 -DHAVE_SCHED_GETCPU -DHAVE_REALTIME_COARSE -DOB_HAVE_EVENTFD -DHAVE_FALLOCATE -DHAVE_MINIDUMP -Werror
oceanbase-client
oceanbase-client-1.1.10.jar
http://mvn.dev.alipay.net/artifactory/service/local/repositories/Alipay-Releases/content/com/alipay/oceanbase/oceanbase-client/1.1.10/oceanbase-client-1.1.10.jar
Test content
Test configuration
OBServer startup parameters
ALTER SYSTEM SET datafile_size='8T';
ALTER SYSTEM SET memory_limit='100g';
ALTER SYSTEM SET system_cpu_quota=10;
ALTER SYSTEM SET net_thread_count=12;
ALTER SYSTEM SET syslog_io_bandwidth_limit='2048M';
ALTER SYSTEM SET major_freeze_duty_time='disable';
ALTER SYSTEM SET memory_limit_percentage=90;
ALTER SYSTEM SET memstore_limit_percentage=50;
ALTER SYSTEM SET merger_warm_up_duration_time='0s';
ALTER SYSTEM SET zone_merge_concurrency=0;
ALTER SYSTEM SET schema_history_expire_time='1d';
ALTER SYSTEM SET minor_freeze_times=3;
ALTER SYSTEM SET enable_syslog_wf=false;
ALTER SYSTEM SET __min_full_resource_pool_memory=1073741824;
ALTER SYSTEM SET system_memory=15G;
ALTER SYSTEM SET _ob_clog_disk_buffer_cnt=1000;
ODP startup parameters
ALTER PROXYCONFIG SET enable_strict_kernel_release=false;
ALTER PROXYCONFIG SET work_thread_num=128;
ALTER PROXYCONFIG SET automatic_match_work_thread=false;
ALTER PROXYCONFIG SET enable_compression_protocol=false;
ALTER PROXYCONFIG SET syslog_level=info;
ALTER PROXYCONFIG SET enable_async_log=true;
ALTER PROXYCONFIG SET enable_metadb_used='false';
Kernel configuration
kernel.sched_migration_cost_ns = 0
Cluster configuration
ALTER SYSTEM SET enable_sql_audit=false;
ALTER SYSTEM SET enable_early_lock_release=false tenant=all;
ALTER SYSTEM SET enable_auto_leader_switch=false;
ALTER SYSTEM SET memory_chunk_cache_size =0;
ALTER SYSTEM SET clog_transport_compress_all=false;
ALTER SYSTEM SET trx_try_wait_lock_timeout='0ms';
ALTER SYSTEM SET trace_log_slow_query_watermark='500ms';
ALTER SYSTEM SET syslog_io_bandwidth_limit='30m';
ALTER SYSTEM SET enable_async_syslog=true;
ALTER SYSTEM SET merger_warm_up_duration_time='0';
ALTER SYSTEM SET merger_switch_leader_duration_time='0';
ALTER SYSTEM SET large_query_worker_percentage=10;
ALTER SYSTEM SET builtin_db_data_verify_cycle = 0;
ALTER SYSTEM SET enable_merge_by_turn = False;
ALTER SYSTEM SET minor_merge_concurrency=30;
ALTER SYSTEM SET system_memory ='30G';
ALTER SYSTEM SET memory_limit_percentage = 85;
ALTER SYSTEM SET memstore_limit_percentage = 70;
ALTER SYSTEM SET freeze_trigger_percentage = 60;
ALTER SYSTEM SET micro_block_merge_verify_level = 0;
ALTER SYSTEM SET max_kept_major_version_number=1;
ALTER SYSTEM SET sys_bkgd_io_high_percentage = 90;
ALTER SYSTEM SET sys_bkgd_io_low_percentage = 70;
ALTER SYSTEM SET merge_thread_count = 20;
ALTER SYSTEM SET large_query_threshold = '200s';
ALTER SYSTEM SET cpu_quota_concurrency = 4;
ALTER SYSTEM SET minor_warm_up_duration_time = 0;
ALTER SYSTEM SET minor_freeze_times=1;
ALTER SYSTEM SET minor_compact_trigger=0;
ALTER SYSTEM SET minor_merge_concurrency =20;
ALTER SYSTEM SET trace_log_slow_query_watermark = '10s';
ALTER SYSTEM SET gts_refresh_interval='500us';
ALTER SYSTEM SET server_permanent_offline_time='36000s';
ALTER SYSTEM SET weak_read_version_refresh_interval=0;
ALTER SYSTEM SET _ob_get_gts_ahead_interval = '1ms';
ALTER SYSTEM SET bf_cache_priority = 10;
ALTER SYSTEM SET user_block_cache_priority=5;
ALTER SYSTEM SET merge_stat_sampling_ratio = 1;
ALTER SYSTEM SET syslog_level='PERF';
ALTER SYSTEM SET enable_perf_event=false;
ALTER SYSTEM SET _cache_wash_interval = '1m';
ALTER SYSTEM SET cache_wash_threshold = '10G';
ALTER SYSTEM SET plan_cache_evict_interval = '30s';
ALTER SYSTEM SET bf_cache_miss_count_threshold = 1;
ALTER SYSTEM SET __easy_memory_limit='20G';
ALTER SYSTEM SET _clog_aggregation_buffer_amount=4 tenant=all;
ALTER SYSTEM SET _flush_clog_aggregation_buffer_timeout='1ms' tenant=all;
ALTER SYSTEM SET _enable_defensive_check=false;
SET GLOBAL binlog_row_image='MINIMAL';
Tenant configuration
ALTER SYSTEM SET enable_monotonic_weak_read=false;
ALTER SYSTEM SET ob_enable_batched_multi_statement=false;
SET GLOBAL ob_query_timeout=3600000000;
SET GLOBAL ob_trx_timeout=3600000000;
SET GLOBAL max_allowed_packet=67108864;
SET GLOBAL ob_sql_work_area_percentage=100;
SET GLOBAL parallel_servers_target=600;
SET GLOBAL binlog_row_image='MINIMAL';
ODP configuration
ALTER PROXYCONFIG SET proxy_mem_limited='2G';
ALTER PROXYCONFIG SET slow_proxy_process_time_threshold='500ms';
ALTER PROXYCONFIG SET syslog_level='ERROR';
ALTER PROXYCONFIG SET enable_prometheus=false;
ALTER PROXYCONFIG SET enable_compression_protocol=false;
BenchmarkSQL configuration
driver=com.alipay.oceanbase.obproxy.mysql.jdbc.Driver
conn=jdbc:oceanbase://IP:PORT/test?rewriteBatchedStatements=true&allowMultiQueries=true&useLocalSessionState=true&useUnicode=true&characterEncoding=utf-8
user=test@xyoracle
password=***********
warehouses=3000
loadWorkers=80
Test table structure
CREATE TABLE bmsql_config (
cfg_name varchar2(30) primary key,
cfg_value varchar2(50)
);
CREATE TABLEGROUP tpcc_group PARTITION BY HASH PARTITIONS 128;
CREATE TABLE bmsql_warehouse (
w_id NUMBER NOT NULL primary key,
w_ytd DECIMAL(12,2),
w_tax DECIMAL(4,4),
w_name VARCHAR2(10),
w_street_1 VARCHAR2(20),
w_street_2 VARCHAR2(20),
w_city VARCHAR2(20),
w_state CHAR(2),
w_zip CHAR(9)
)tablegroup='TPCC_GROUP' compress partition by hash(w_id) partitions 128;
CREATE TABLE bmsql_district (
d_w_id NUMBER NOT NULL,
d_id NUMBER NOT NULL,
d_ytd DECIMAL(12,2),
d_tax DECIMAL(4,4),
d_next_o_id NUMBER,
d_name VARCHAR2(10),
d_street_1 VARCHAR2(20),
d_street_2 VARCHAR2(20),
d_city VARCHAR2(20),
d_state CHAR(2),
d_zip CHAR(9),
constraint pk_district PRIMARY KEY (d_w_id, d_id)
)tablegroup='TPCC_GROUP' compress partition by hash(d_w_id) partitions 128;
CREATE TABLE bmsql_customer (
c_w_id NUMBER NOT NULL,
c_d_id NUMBER NOT NULL,
c_id NUMBER NOT NULL,
c_discount DECIMAL(4,4),
c_credit CHAR(2),
c_last VARCHAR2(16),
c_first VARCHAR2(16),
c_credit_lim DECIMAL(12,2),
c_balance DECIMAL(12,2),
c_ytd_payment DECIMAL(12,2),
c_payment_cnt NUMBER,
c_delivery_cnt NUMBER,
c_street_1 VARCHAR2(20),
c_street_2 VARCHAR2(20),
c_city VARCHAR2(20),
c_state CHAR(2),
c_zip CHAR(9),
c_phone CHAR(16),
c_since TIMESTAMP WITH TIME ZONE,
c_middle CHAR(2),
c_data VARCHAR2(500),
constraint pk_customer PRIMARY KEY (c_w_id, c_d_id, c_id)
)tablegroup='TPCC_GROUP' compress partition by hash(c_w_id) partitions 128;
CREATE TABLE bmsql_history (
hist_id NUMBER,
h_w_id NUMBER,
h_c_id NUMBER,
h_c_d_id NUMBER,
h_c_w_id NUMBER,
h_d_id NUMBER,
h_date TIMESTAMP,
h_amount DECIMAL(6,2),
h_data VARCHAR2(24),
constraint pk_history PRIMARY KEY (hist_id, h_w_id)
)tablegroup='TPCC_GROUP' compress partition by hash(h_w_id) partitions 128;
create sequence history_seq
START WITH 1
INCREMENT BY 1
NOMAXVALUE
NOCYCLE
CACHE 1000000
NOORDER;
CREATE TABLE bmsql_new_order (
no_w_id NUMBER NOT NULL,
no_d_id NUMBER NOT NULL,
no_o_id NUMBER NOT NULL,
constraint pk_new_order PRIMARY KEY (no_w_id, no_d_id, no_o_id)
)tablegroup='TPCC_GROUP' compress partition by hash(no_w_id) partitions 128;
CREATE TABLE bmsql_oorder (
o_w_id NUMBER NOT NULL,
o_d_id NUMBER NOT NULL,
o_id NUMBER NOT NULL,
o_c_id NUMBER,
o_carrier_id NUMBER,
o_ol_cnt DECIMAL(2,0),
o_all_local DECIMAL(1,0),
o_entry_d TIMESTAMP WITH TIME ZONE,
constraint pk_oorder PRIMARY KEY (o_w_id, o_d_id, o_id)
)tablegroup='TPCC_GROUP' compress partition by hash(o_w_id) partitions 128;
CREATE TABLE bmsql_order_line (
ol_w_id NUMBER NOT NULL,
ol_d_id NUMBER NOT NULL,
ol_o_id NUMBER NOT NULL,
ol_number NUMBER NOT NULL,
ol_i_id NUMBER NOT NULL,
ol_delivery_d TIMESTAMP WITH LOCAL TIME ZONE,
ol_amount DECIMAL(6,2),
ol_supply_w_id NUMBER,
ol_quantity DECIMAL(2,0),
ol_dist_info CHAR(24),
constraint pk_order_line PRIMARY KEY (ol_w_id, ol_d_id, ol_o_id, ol_number)
)tablegroup='TPCC_GROUP' compress partition by hash(ol_w_id) partitions 128;
CREATE TABLE bmsql_item (
i_w_id NUMBER NOT NULL,
i_id NUMBER NOT NULL,
i_name VARCHAR2(24),
i_price DECIMAL(5,2),
i_data VARCHAR2(50),
i_im_id NUMBER,
constraint pk_item PRIMARY KEY (i_w_id, i_id)
)tablegroup='TPCC_GROUP' compress partition by hash(i_w_id) partitions 128;
CREATE TABLE bmsql_stock (
s_w_id NUMBER NOT NULL,
s_i_id NUMBER NOT NULL,
s_quantity DECIMAL(4,0),
s_ytd DECIMAL(8,2),
s_order_cnt NUMBER,
s_remote_cnt NUMBER,
s_data VARCHAR2(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),
constraint pk_stock PRIMARY KEY (s_w_id, s_i_id)
)tablegroup='TPCC_GROUP' compress partition by hash(s_w_id) partitions 128;
create index bmsql_customer_idx1
on bmsql_customer (c_w_id, c_d_id, c_last, c_first) local;
create index bmsql_oorder_idx1
on bmsql_oorder(o_w_id, o_d_id, o_carrier_id, o_id) local;
Test process
Create a table.
sh runCreatetable.sh;Import data and create indexes.
sh runLoader.sh;Perform a major compaction for the database.
alter system major freeze;Run the workload.
Test result
[Thread-230] INFO jTPCC : Term-00, Measured tpmC (NewOrders) = 365882.93
[Thread-230] INFO jTPCC : Term-00, Measured tpmTOTAL = 812448.17
[Thread-230] INFO jTPCC : Term-00, Transaction Count = 4232761