Skip to content

Commit 21eab05

Browse files
craig[bot]tbg
andcommitted
Merge #131662
131662: roachtest: add sysbench/oltp_{read_only,write_only,read_write}/nodes=3/cpu=8/conc=64 r=tbg a=tbg This adds 8vcpu flavors of these select three sysbench flavors. Epic: none Release note: None Co-authored-by: Tobias Grieger <[email protected]>
2 parents b38c8dd + 1116b40 commit 21eab05

File tree

1 file changed

+26
-10
lines changed

1 file changed

+26
-10
lines changed

pkg/cmd/roachtest/tests/sysbench.go

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -215,11 +215,27 @@ func runSysbench(ctx context.Context, t test.Test, c cluster.Cluster, opts sysbe
215215
}
216216

217217
func registerSysbench(r registry.Registry) {
218-
for w := sysbenchWorkload(0); w < numSysbenchWorkloads; w++ {
219-
for _, n := range []int{1, 3} {
220-
const cpus = 32
221-
concPerCPU := n*3 - 1
222-
conc := cpus * concPerCPU
218+
for _, d := range []struct {
219+
n, cpus int
220+
pick func(sysbenchWorkload) bool // nil means true for all
221+
}{
222+
{n: 1, cpus: 32},
223+
{n: 3, cpus: 32},
224+
{n: 3, cpus: 8, pick: func(w sysbenchWorkload) bool {
225+
switch w {
226+
case oltpReadOnly, oltpReadWrite, oltpWriteOnly:
227+
return true
228+
default:
229+
return false
230+
}
231+
}},
232+
} {
233+
for w := sysbenchWorkload(0); w < numSysbenchWorkloads; w++ {
234+
if d.pick != nil && !d.pick(w) {
235+
continue
236+
}
237+
concPerCPU := d.n*3 - 1
238+
conc := d.cpus * concPerCPU
223239
opts := sysbenchOptions{
224240
workload: w,
225241
duration: 10 * time.Minute,
@@ -229,10 +245,10 @@ func registerSysbench(r registry.Registry) {
229245
}
230246

231247
r.Add(registry.TestSpec{
232-
Name: fmt.Sprintf("sysbench/%s/nodes=%d/cpu=%d/conc=%d", w, n, cpus, conc),
248+
Name: fmt.Sprintf("sysbench/%s/nodes=%d/cpu=%d/conc=%d", w, d.n, d.cpus, conc),
233249
Benchmark: true,
234250
Owner: registry.OwnerTestEng,
235-
Cluster: r.MakeClusterSpec(n+1, spec.CPU(cpus), spec.WorkloadNode(), spec.WorkloadNodeCPU(16)),
251+
Cluster: r.MakeClusterSpec(d.n+1, spec.CPU(d.cpus), spec.WorkloadNode(), spec.WorkloadNodeCPU(16)),
236252
CompatibleClouds: registry.OnlyGCE,
237253
Suites: registry.Suites(registry.Nightly),
238254
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
@@ -241,14 +257,14 @@ func registerSysbench(r registry.Registry) {
241257
})
242258

243259
// Add a variant of each test that uses PostgreSQL instead of CockroachDB.
244-
if n == 1 {
260+
if d.n == 1 {
245261
pgOpts := opts
246262
pgOpts.usePostgres = true
247263
r.Add(registry.TestSpec{
248-
Name: fmt.Sprintf("sysbench/%s/postgres/cpu=%d/conc=%d", w, cpus, conc),
264+
Name: fmt.Sprintf("sysbench/%s/postgres/cpu=%d/conc=%d", w, d.cpus, conc),
249265
Benchmark: true,
250266
Owner: registry.OwnerTestEng,
251-
Cluster: r.MakeClusterSpec(n+1, spec.CPU(cpus), spec.WorkloadNode(), spec.WorkloadNodeCPU(16)),
267+
Cluster: r.MakeClusterSpec(d.n+1, spec.CPU(d.cpus), spec.WorkloadNode(), spec.WorkloadNodeCPU(16)),
252268
CompatibleClouds: registry.OnlyGCE,
253269
Suites: registry.ManualOnly,
254270
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {

0 commit comments

Comments
 (0)