Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Microbenchmarks to test parallel workers scaling performance #117

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
type: POSTGRES
driver: org.postgresql.Driver
url: jdbc:postgresql://{{ endpoint }}:5432/postgres?sslmode=require
username: {{ username }}
password: {{ password }}
isolation: TRANSACTION_REPEATABLE_READ
batchsize: 128
terminals: 1
collect_pg_stat_statements: true
works:
work:
time_secs: 120
active_terminals: 1
rate: unlimited
warmup: 30
microbenchmark:
class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark
properties:
setAutoCommit: true
create:
- DROP TABLE IF EXISTS pkeyBigint1M_1;
- DROP TABLE IF EXISTS pkeyBigint1M_2;
- DROP TABLE IF EXISTS pkeyBigint1M_3;
- CREATE TABLE pkeyBigint1M_1(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1, col_bigint_id_2, col_bigint_id_3, col_bigint_card1_1));
- CREATE TABLE pkeyBigint1M_2(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1, col_bigint_id_2, col_bigint_id_3, col_bigint_card1_1));
- CREATE TABLE pkeyBigint1M_3(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1, col_bigint_id_2, col_bigint_id_3, col_bigint_card1_1));
- CREATE INDEX ON pkeyBigint1M_1(col_bigint_card2_1);
- CREATE INDEX ON pkeyBigint1M_2(col_bigint_card2_1);
- CREATE INDEX ON pkeyBigint1M_3(col_bigint_card2_1);

cleanup:
- DROP TABLE IF EXISTS pkeyBigint1M_1;
- DROP TABLE IF EXISTS pkeyBigint1M_2;
- DROP TABLE IF EXISTS pkeyBigint1M_3;
loadRules:
- table: pkeyBigint1M_
count: 3
rows: 1000000
columns:
- name: col_bigint_card1_
count: 1
util: RandomInt
params: [ 1000001, 1001000 ]
- name: col_bigint_card2_
count: 1
util: RandomInt
params: [ 1000001, 1010001 ]
- name: col_bigint_card3_
count: 1
util: OneNumberFromArray
params: [ 1000000 ]
- name: col_bigint_id_
count: 3
util: PrimaryIntGen
params: [ 1, 1000000 ]
- name: col_float2_
count: 2
util: RandomNoWithDecimalPoints
params: [ 1, 1000000, 2 ]
- name: col_float5_
count: 2
util: RandomNoWithDecimalPoints
params: [ 1, 1000000, 5 ]
- name: col_boolean_
count: 1
util: RandomBoolean
- name: col_varchar10_id_
count: 1
util: PrimaryStringGen
params: [1, 10]
- name: col_varchar100_id_
count: 2
util: PrimaryStringGen
params: [1, 100]
- name: col_varchar500_id_
count: 1
util: PrimaryStringGen
params: [1, 500]

executeRules:
- workload: JOING12_1_join_with_2_parallel_workers_project_aggregate
customTags: schematype=regular,partition=hash,pkey=hash,cardinality=multiple,projectition=aggregate,queryshape=join,joinon=pkey
run:
- name: join_on_pk_3tbl
weight: 100
queries:
- query: /*+ set(max_parallel_workers_per_gather 2) */ select count(*) from pkeyBigint1M_1 as a join pkeyBigint1M_2 as b on a.col_bigint_card1_1=b.col_bigint_card1_1 and a.col_bigint_card3_1=b.col_bigint_card3_1 where b.col_bigint_card1_1>1000000 and b.col_bigint_card2_1 >1000000;


- workload: JOING12_2_join_with_4_parallel_workers_project_aggregate
customTags: schematype=regular,partition=hash,pkey=hash,cardinality=multiple,projectition=aggregate,queryshape=join,joinon=pkey
run:
- name: join_on_pk_3tbl
weight: 100
queries:
- query: /*+ set(max_parallel_workers_per_gather 4) */ select count(*) from pkeyBigint1M_1 as a join pkeyBigint1M_2 as b on a.col_bigint_card1_1=b.col_bigint_card1_1 and a.col_bigint_card3_1=b.col_bigint_card3_1 where b.col_bigint_card1_1>1000000 and b.col_bigint_card2_1 >1000000;

- workload: JOING12_3_join_with_8_parallel_workers_project_aggregate
customTags: schematype=regular,partition=hash,pkey=hash,cardinality=multiple,projectition=aggregate,queryshape=join,joinon=pkey
run:
- name: join_on_pk_3tbl
weight: 100
queries:
- query: /*+ set(max_parallel_workers_per_gather 8) */ select count(*) from pkeyBigint1M_1 as a join pkeyBigint1M_2 as b on a.col_bigint_card1_1=b.col_bigint_card1_1 and a.col_bigint_card3_1=b.col_bigint_card3_1 where b.col_bigint_card1_1>1000000 and b.col_bigint_card2_1 >1000000;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the query is running for 26 seconds. Do we want to reduce the time of the query to say 2-3 seconds. This will ensure that the query is run multiple times. Right now, the query is being run only 4-10 times

Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
type: YUGABYTE
driver: com.yugabyte.Driver
url: jdbc:yugabytedb://{{endpoint}}:5433/yugabyte?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true&load-balance=false
createdb: drop database if exists yb_colocated; create database yb_colocated with colocated=true
username: {{ username }}
password: {{ password }}
isolation: TRANSACTION_REPEATABLE_READ
batchsize: 128
terminals: 1
collect_pg_stat_statements: true
use_dist_in_explain : true
works:
work:
time_secs: 120
active_terminals: 1
rate: unlimited
warmup: 30
microbenchmark:
class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark
properties:
setAutoCommit: true
create:
- DROP TABLE IF EXISTS pkeyBigint1M_1;
- DROP TABLE IF EXISTS pkeyBigint1M_2;
- DROP TABLE IF EXISTS pkeyBigint1M_3;
- CREATE TABLE pkeyBigint1M_1(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1, col_bigint_id_2, col_bigint_id_3, col_bigint_card1_1));
- CREATE TABLE pkeyBigint1M_2(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1, col_bigint_id_2, col_bigint_id_3, col_bigint_card1_1));
- CREATE TABLE pkeyBigint1M_3(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1, col_bigint_id_2, col_bigint_id_3, col_bigint_card1_1));
- CREATE INDEX ON pkeyBigint1M_1(col_bigint_card2_1);
- CREATE INDEX ON pkeyBigint1M_2(col_bigint_card2_1);
- CREATE INDEX ON pkeyBigint1M_3(col_bigint_card2_1);

cleanup:
- DROP TABLE IF EXISTS pkeyBigint1M_1;
- DROP TABLE IF EXISTS pkeyBigint1M_2;
- DROP TABLE IF EXISTS pkeyBigint1M_3;
loadRules:
- table: pkeyBigint1M_
count: 3
rows: 1000000
columns:
- name: col_bigint_card1_
count: 1
util: RandomInt
params: [ 1000001, 1001000 ]
- name: col_bigint_card2_
count: 1
util: RandomInt
params: [ 1000001, 1010001 ]
- name: col_bigint_card3_
count: 1
util: OneNumberFromArray
params: [ 1000000 ]
- name: col_bigint_id_
count: 3
util: PrimaryIntGen
params: [ 1, 1000000 ]
- name: col_float2_
count: 2
util: RandomNoWithDecimalPoints
params: [ 1, 1000000, 2 ]
- name: col_float5_
count: 2
util: RandomNoWithDecimalPoints
params: [ 1, 1000000, 5 ]
- name: col_boolean_
count: 1
util: RandomBoolean
- name: col_varchar10_id_
count: 1
util: PrimaryStringGen
params: [1, 10]
- name: col_varchar100_id_
count: 2
util: PrimaryStringGen
params: [1, 100]
- name: col_varchar500_id_
count: 1
util: PrimaryStringGen
params: [1, 500]

executeRules:

- workload: JOING12_1_join_with_2_parallel_workers_project_aggregate
customTags: schematype=regular,partition=hash,pkey=hash,cardinality=multiple,projectition=aggregate,queryshape=join,joinon=pkey
run:
- name: join_on_pk_3tbl
weight: 100
queries:
- query: /*+ set(max_parallel_workers_per_gather 2) */ select count(*) from pkeyBigint1M_1 as a join pkeyBigint1M_2 as b on a.col_bigint_card1_1=b.col_bigint_card1_1 and a.col_bigint_card3_1=b.col_bigint_card3_1 where b.col_bigint_card1_1>1000000 and b.col_bigint_card2_1 >1000000;


- workload: JOING12_2_join_with_4_parallel_workers_project_aggregate
customTags: schematype=regular,partition=hash,pkey=hash,cardinality=multiple,projectition=aggregate,queryshape=join,joinon=pkey
run:
- name: join_on_pk_3tbl
weight: 100
queries:
- query: /*+ set(max_parallel_workers_per_gather 4) */ select count(*) from pkeyBigint1M_1 as a join pkeyBigint1M_2 as b on a.col_bigint_card1_1=b.col_bigint_card1_1 and a.col_bigint_card3_1=b.col_bigint_card3_1 where b.col_bigint_card1_1>1000000 and b.col_bigint_card2_1 >1000000;

- workload: JOING12_3_join_with_8_parallel_workers_project_aggregate
customTags: schematype=regular,partition=hash,pkey=hash,cardinality=multiple,projectition=aggregate,queryshape=join,joinon=pkey
run:
- name: join_on_pk_3tbl
weight: 100
queries:
- query: /*+ set(max_parallel_workers_per_gather 8) */ select count(*) from pkeyBigint1M_1 as a join pkeyBigint1M_2 as b on a.col_bigint_card1_1=b.col_bigint_card1_1 and a.col_bigint_card3_1=b.col_bigint_card3_1 where b.col_bigint_card1_1>1000000 and b.col_bigint_card2_1 >1000000;
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
type: YUGABYTE
driver: com.yugabyte.Driver
url: jdbc:yugabytedb://{{endpoint}}:5433/yugabyte?sslmode=require&ApplicationName=featurebench&reWriteBatchedInserts=true&load-balance=false
createdb: drop database if exists yb_colocated; create database yb_colocated with colocated=true
username: {{ username }}
password: {{ password }}
isolation: TRANSACTION_REPEATABLE_READ
batchsize: 128
terminals: 1
collect_pg_stat_statements: true
use_dist_in_explain : true
works:
work:
time_secs: 120
active_terminals: 1
rate: unlimited
warmup: 30
microbenchmark:
class: com.oltpbenchmark.benchmarks.featurebench.customworkload.YBDefaultMicroBenchmark
properties:
setAutoCommit: true
create:
- DROP TABLE IF EXISTS pkeyBigint1M_1;
- DROP TABLE IF EXISTS pkeyBigint1M_2;
- DROP TABLE IF EXISTS pkeyBigint1M_3;
- CREATE TABLE pkeyBigint1M_1(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1, col_bigint_id_2, col_bigint_id_3, col_bigint_card1_1));
- CREATE TABLE pkeyBigint1M_2(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1, col_bigint_id_2, col_bigint_id_3, col_bigint_card1_1));
- CREATE TABLE pkeyBigint1M_3(col_bigint_card1_1 bigint, col_bigint_card2_1 bigint, col_bigint_card3_1 bigint, col_bigint_id_1 bigint, col_bigint_id_2 bigint, col_bigint_id_3 bigint, col_float2_1 float(2), col_float2_2 float(2), col_float5_1 float(5), col_float5_2 float(5), col_boolean_1 boolean, col_varchar10_id_1 varchar(10), col_varchar100_id_1 varchar(100), col_varchar100_id_2 varchar(100), col_varchar500_id_1 varchar(500), PRIMARY KEY(col_bigint_id_1, col_bigint_id_2, col_bigint_id_3, col_bigint_card1_1));
- CREATE INDEX ON pkeyBigint1M_1(col_bigint_card2_1);
- CREATE INDEX ON pkeyBigint1M_2(col_bigint_card2_1);
- CREATE INDEX ON pkeyBigint1M_3(col_bigint_card2_1);

cleanup:
- DROP TABLE IF EXISTS pkeyBigint1M_1;
- DROP TABLE IF EXISTS pkeyBigint1M_2;
- DROP TABLE IF EXISTS pkeyBigint1M_3;
loadRules:
- table: pkeyBigint1M_
count: 3
rows: 1000000
columns:
- name: col_bigint_card1_
count: 1
util: RandomInt
params: [ 1000001, 1001000 ]
- name: col_bigint_card2_
count: 1
util: RandomInt
params: [ 1000001, 1010001 ]
- name: col_bigint_card3_
count: 1
util: OneNumberFromArray
params: [ 1000000 ]
- name: col_bigint_id_
count: 3
util: PrimaryIntGen
params: [ 1, 1000000 ]
- name: col_float2_
count: 2
util: RandomNoWithDecimalPoints
params: [ 1, 1000000, 2 ]
- name: col_float5_
count: 2
util: RandomNoWithDecimalPoints
params: [ 1, 1000000, 5 ]
- name: col_boolean_
count: 1
util: RandomBoolean
- name: col_varchar10_id_
count: 1
util: PrimaryStringGen
params: [1, 10]
- name: col_varchar100_id_
count: 2
util: PrimaryStringGen
params: [1, 100]
- name: col_varchar500_id_
count: 1
util: PrimaryStringGen
params: [1, 500]

executeRules:
- workload: JOING12_1_join_with_2_parallel_workers_project_aggregate
customTags: schematype=regular,partition=hash,pkey=hash,cardinality=multiple,projectition=aggregate,queryshape=join,joinon=pkey
run:
- name: join_on_pk_3tbl
weight: 100
queries:
- query: /*+ set(max_parallel_workers_per_gather 2) */ select count(*) from pkeyBigint1M_1 as a join pkeyBigint1M_2 as b on a.col_bigint_card1_1=b.col_bigint_card1_1 and a.col_bigint_card3_1=b.col_bigint_card3_1 where b.col_bigint_card1_1>1000000 and b.col_bigint_card2_1 >1000000;


- workload: JOING12_2_join_with_4_parallel_workers_project_aggregate
customTags: schematype=regular,partition=hash,pkey=hash,cardinality=multiple,projectition=aggregate,queryshape=join,joinon=pkey
run:
- name: join_on_pk_3tbl
weight: 100
queries:
- query: /*+ set(max_parallel_workers_per_gather 4) */ select count(*) from pkeyBigint1M_1 as a join pkeyBigint1M_2 as b on a.col_bigint_card1_1=b.col_bigint_card1_1 and a.col_bigint_card3_1=b.col_bigint_card3_1 where b.col_bigint_card1_1>1000000 and b.col_bigint_card2_1 >1000000;

- workload: JOING12_3_join_with_8_parallel_workers_project_aggregate
customTags: schematype=regular,partition=hash,pkey=hash,cardinality=multiple,projectition=aggregate,queryshape=join,joinon=pkey
run:
- name: join_on_pk_3tbl
weight: 100
queries:
- query: /*+ set(max_parallel_workers_per_gather 8) */ select count(*) from pkeyBigint1M_1 as a join pkeyBigint1M_2 as b on a.col_bigint_card1_1=b.col_bigint_card1_1 and a.col_bigint_card3_1=b.col_bigint_card3_1 where b.col_bigint_card1_1>1000000 and b.col_bigint_card2_1 >1000000;