Skip to content

Commit

Permalink
Merge pull request #492 from vitessio/add-fk-benchmarks
Browse files Browse the repository at this point in the history
Add Foreign Keys TPC-C benchmarks
  • Loading branch information
frouioui authored Jan 8, 2024
2 parents bee9d2e + 4184a11 commit 13497b2
Show file tree
Hide file tree
Showing 9 changed files with 109 additions and 102 deletions.
2 changes: 0 additions & 2 deletions ansible/macrobench_sharded_inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ all:
vars:
arewefastyet_git_repo: "https://github.com/vitessio/arewefastyet.git"
arewefastyet_git_version: "main"
macrobenchmark_vschema_oltp: "./vitess-benchmark/sysbench.json"
macrobenchmark_vschema_tpcc: "./vitess-benchmark/tpcc_vschema.json"
cell: local
keyspace: main
provision: 1
Expand Down
47 changes: 41 additions & 6 deletions ansible/macrobench_unsharded_inventory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ all:
vars:
arewefastyet_git_repo: "https://github.com/vitessio/arewefastyet.git"
arewefastyet_git_version: "main"
macrobenchmark_vschema: "./vitess-benchmark/sysbench.json"
cell: local
keyspace: main
provision: 1
Expand All @@ -28,7 +27,8 @@ all:
hosts:
DEVICE_IP_0:
vars:
vtgate_web_ports: "15001,15002"

vtgate_web_ports: "15001,15002,15003"
sysbench:
hosts:
DEVICE_IP_0:
Expand All @@ -43,7 +43,7 @@ all:
DEVICE_IP_0:
vtgate:
vars:
vtgate_max_goproc: 6
vtgate_max_goproc: 42
hosts:
DEVICE_IP_0:
gateways:
Expand All @@ -55,15 +55,50 @@ all:
port: 15002
mysql_port: 13307
grpc_port: 15307
- id: 3
port: 15003
mysql_port: 13308
grpc_port: 15308
vttablet:
vars:
vitess_memory_ratio: 0.6
vttablet_max_goproc: 24
vitess_memory_ratio: 0.8
vttablet_max_goproc: 42
hosts:
DEVICE_IP_0:
tablets:
- id: 1001
keyspace: main
shard: 0
pool_size: 500
transaction_cap: 2000
transaction_cap: 2000
port: 16011
grpc_port: 17011
mysql_port: 18011
mysqld_exporter_port: 9104
- id: 1002
keyspace: main
shard: 0
pool_size: 500
transaction_cap: 2000
port: 16012
grpc_port: 17012
mysql_port: 18012
mysqld_exporter_port: 9105
- id: 2001
keyspace: main
shard: 0
pool_size: 500
transaction_cap: 2000
port: 16021
grpc_port: 17021
mysql_port: 18021
mysqld_exporter_port: 9106
- id: 2002
keyspace: main
shard: 0
pool_size: 500
transaction_cap: 2000
port: 16022
grpc_port: 17022
mysql_port: 18022
mysqld_exporter_port: 9107
16 changes: 16 additions & 0 deletions ansible/vitess-benchmark/tpcc_fk_vschema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"sharded": false,
"foreignKeyMode": "managed",
"tables": {
"customer1": {},
"district1": {},
"history1": {},
"item1": {},
"new_orders1": {},
"order_line1": {},
"orders1": {},
"stock1": {},
"warehouse1": {}
}
}

2 changes: 1 addition & 1 deletion ansible/vitess-benchmark/tpcc_vschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,6 @@
}
]
}
}
}
}

43 changes: 43 additions & 0 deletions config/benchmarks/tpcc_fk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
## Exec configuration
exec-type: tpcc_fk
exec-schema: "./vitess-benchmark/tpcc_fk_vschema.json"
minimum-version: 18

## Ansible
ansible-inventory-file: macrobench_unsharded_inventory.yml
ansible-playbook-file: macrobench.yml

## Macrobench cmd
macrobench-sysbench-executable: /usr/local/bin/sysbench
macrobench-workload-path: /src/sysbench-tpcc/tpcc.lua
macrobench-skip-steps:
macrobench-type: tpcc
macrobench-working-directory: /src/sysbench-tpcc

## Sysbench all steps
macrobench_all_mysql-db: main
macrobench_all_mysql-host: 127.0.0.1
macrobench_all_mysql-port: 13306
macrobench_all_db-ps-mode: disable
macrobench_all_db-driver: mysql
macrobench_all_luajit-cmd: "off"
macrobench_all_threads: 42
macrobench_all_tables: 1
macrobench_all_scale: 1
macrobench_all_rand-type: uniform
macrobench_all_rand-seed: 1
macrobench_all_use_fk: 1
macrobench_all_mysql-ignore-errors: all

## Sysbench prepare step
macrobench_prepare_time: 60
macrobench_prepare_report-interval: 10

## Sysbench warm up step
macrobench_warmup_time: 60
macrobench_warmup_report-interval: 10

## Sysbench run step
macrobench_run_time: 600
macrobench_run_report_json: "yes"
macrobench_run_verbosity: 0
2 changes: 1 addition & 1 deletion config/dev/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ web-pr-label-trigger: '"Benchmark me"'
web-pr-label-trigger-planner-v3: '"Benchmark me (V3)"'
web-vitess-path: /tmp
web-mode: "development"
web-cron-schedule: "1 1 1 1 1"
web-cron-schedule: "*/1 * * * *"
web-cron-schedule-pull-requests: "1 1 1 1 1"
web-cron-schedule-tags: "1 1 1 1 1"

Expand Down
13 changes: 7 additions & 6 deletions go/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,16 +174,17 @@ func (s *Server) Init() error {
}

s.benchmarkConfig = map[string]benchmarkConfig{
"micro": {file: path.Join(s.benchmarkConfigPath, "micro.yaml"), v: viper.New(), skip: true},
"oltp": {file: path.Join(s.benchmarkConfigPath, "oltp.yaml"), v: viper.New()},
"oltp-set": {file: path.Join(s.benchmarkConfigPath, "oltp-set.yaml"), v: viper.New()},
"oltp-readonly": {file: path.Join(s.benchmarkConfigPath, "oltp-readonly.yaml"), v: viper.New()},
// "micro": {file: path.Join(s.benchmarkConfigPath, "micro.yaml"), v: viper.New(), skip: true},
// "oltp": {file: path.Join(s.benchmarkConfigPath, "oltp.yaml"), v: viper.New()},
// "oltp-set": {file: path.Join(s.benchmarkConfigPath, "oltp-set.yaml"), v: viper.New()},
// "oltp-readonly": {file: path.Join(s.benchmarkConfigPath, "oltp-readonly.yaml"), v: viper.New()},

// TODO: oltp-readonly-olap benchmarks are skipped for now as they fail very often due to
// MySQL connections being dropped. This issue will be investigated soon.
"oltp-readonly-olap": {file: path.Join(s.benchmarkConfigPath, "olap-readonly.yaml"), v: viper.New(), skip: true},
// "oltp-readonly-olap": {file: path.Join(s.benchmarkConfigPath, "olap-readonly.yaml"), v: viper.New(), skip: true},

"tpcc": {file: path.Join(s.benchmarkConfigPath, "tpcc.yaml"), v: viper.New()},
// "tpcc": {file: path.Join(s.benchmarkConfigPath, "tpcc.yaml"), v: viper.New()},
"tpcc_fk": {file: path.Join(s.benchmarkConfigPath, "tpcc_fk.yaml"), v: viper.New()},
}
for configName, config := range s.benchmarkConfig {
config.v.SetConfigFile(config.file)
Expand Down
5 changes: 0 additions & 5 deletions go/tools/macrobench/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ type (
Type string
)

const (
OLTP = Type("oltp")
TPCC = Type("tpcc")
)

// Type implements Cobra flag.Value interface.
func (mbtype *Type) Type() string {
return "Type"
Expand Down
81 changes: 0 additions & 81 deletions go/tools/macrobench/types_test.go

This file was deleted.

0 comments on commit 13497b2

Please sign in to comment.