Skip to content

Commit

Permalink
roachtest: add KV configurations with no manual splits
Browse files Browse the repository at this point in the history
Before this PR we always ran our KV benchmarks with 1000 manual splits.
This is almost certainly too many. We preserve this value for the historical
continuity of the tests but add new configurations which do no manual
splitting.

Release note: None
  • Loading branch information
ajwerner committed Aug 15, 2019
1 parent 6185789 commit 0099761
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion pkg/cmd/roachtest/kv.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,25 @@ func registerKV(r *testRegistry) {
readPercent int
batchSize int
blockSize int
splits int // 0 implies default, negative implies 0
encryption bool
sequential bool
duration time.Duration
tags []string
}
computeNumSplits := func(opts kvOptions) int {
// TODO(ajwerner): set this default to a more sane value or remove it and
// rely on load-based splitting.
const defaultNumSplits = 1000
switch {
case opts.splits == 0:
return defaultNumSplits
case opts.splits < 0:
return 0
default:
return opts.splits
}
}
runKV := func(ctx context.Context, t *test, c *cluster, opts kvOptions) {
nodes := c.spec.NodeCount - 1
c.Put(ctx, cockroach, "./cockroach", c.Range(1, nodes))
Expand All @@ -49,7 +63,8 @@ func registerKV(r *testRegistry) {
m := newMonitor(ctx, c, c.Range(1, nodes))
m.Go(func(ctx context.Context) error {
concurrency := ifLocal("", " --concurrency="+fmt.Sprint(nodes*64))
splits := " --splits=1000"

splits := " --splits=" + strconv.Itoa(computeNumSplits(opts))
if opts.duration == 0 {
opts.duration = 10 * time.Minute
}
Expand Down Expand Up @@ -89,8 +104,12 @@ func registerKV(r *testRegistry) {
{nodes: 1, cpus: 32, readPercent: 95},
{nodes: 3, cpus: 8, readPercent: 0},
{nodes: 3, cpus: 8, readPercent: 95},
{nodes: 3, cpus: 8, readPercent: 0, splits: -1 /* no splits */},
{nodes: 3, cpus: 8, readPercent: 95, splits: -1 /* no splits */},
{nodes: 3, cpus: 32, readPercent: 0},
{nodes: 3, cpus: 32, readPercent: 95},
{nodes: 3, cpus: 32, readPercent: 0, splits: -1 /* no splits */},
{nodes: 3, cpus: 32, readPercent: 95, splits: -1 /* no splits */},

// Configs with large block sizes.
{nodes: 3, cpus: 8, readPercent: 0, blockSize: 1 << 12 /* 4 KB */},
Expand Down Expand Up @@ -143,6 +162,9 @@ func registerKV(r *testRegistry) {
if opts.blockSize != 0 { // support legacy test name which didn't include block size
nameParts = append(nameParts, fmt.Sprintf("size=%dkb", opts.blockSize>>10))
}
if opts.splits != 0 { // support legacy test name which didn't include splits
nameParts = append(nameParts, fmt.Sprintf("splt=%d", computeNumSplits(opts)))
}
if opts.sequential {
nameParts = append(nameParts, fmt.Sprintf("seq"))
}
Expand Down

0 comments on commit 0099761

Please sign in to comment.