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

workload/tpcc: extend --wait to also support fractions #39685

Merged
merged 1 commit into from
Sep 3, 2019

Conversation

knz
Copy link
Contributor

@knz knz commented Aug 15, 2019

In order to use TPC-C for operational testing (i.e. NOT benchmarking)
it is useful to increase the rate of transactions without
altogether saturating the TPS capacity (--wait=false).

For this purpose, this commit extends the syntax accepted by --wait
to recognize a multiplier which is applied to all wait times. The
default is 1.0 (i.e. 100% of the wait time required by a benchmark).
The words true/on and false/off are aliases for 1.0 and 0.0,
respectively

@knz knz requested review from danhhz and tbg August 15, 2019 12:25
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Contributor

@danhhz danhhz left a comment

Choose a reason for hiding this comment

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

I'm okay with this, though we should probably deprecate the --waits flag since --wait-fraction=0 should be the same thing, right? Mind running this by nathan or awerner to see if they have thoughts on whether tpcc is the right thing for what you'd looking for?

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @danhhz and @tbg)

@knz
Copy link
Contributor Author

knz commented Sep 2, 2019

I have talked to @nvanbenschoten and we agreed that this is an OK way to go forward, as long as the users of the flag are mindful that it changes the amount of contention.

@danhhz what is it that you'd like me to do about --waits? Are you not concerned about making a flag disappear outright? Should I mark it as hidden/deprecated instead?

@petermattis
Copy link
Collaborator

You could change the existing --waits flag to take a fractional argument. So --waits=true would be equivalent to --waits=1 and --waits=false would be equivalent to --waits=0. But then you could also specify --waits=0.1. Perhaps overly clever, but that's what I'm here for.

@danhhz
Copy link
Contributor

danhhz commented Sep 3, 2019

I was imagining adding a deprecation notice to the --waits flag description. If that makes 19.2, I'd be comfortable removing the flag in 20.1

@knz
Copy link
Contributor Author

knz commented Sep 3, 2019

You could change the existing --waits flag to take a fractional argument. So --waits=true would be equivalent to --waits=1 and --waits=false would be equivalent to --waits=0. But then you could also specify --waits=0.1. Perhaps overly clever, but that's what I'm here for.

I understand how to do this. I think it is a good idea because it's upward compatible and doesn't require a deprecation cycle. I'll try that.

@knz knz changed the title workload/tpcc: add a new flag --wait-fraction to accelerate tpcc workload/tpcc: extend --wait to also support fractions Sep 3, 2019
@knz
Copy link
Contributor Author

knz commented Sep 3, 2019

Modified as suggested, RFAL

Copy link
Contributor

@danhhz danhhz left a comment

Choose a reason for hiding this comment

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

this is great, much better than what I was suggesting. :lgtm:

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @knz and @tbg)


pkg/workload/tpcc/tpcc.go, line 157 at r1 (raw file):

			`split`:              {RuntimeOnly: true},
			`wait`:               {RuntimeOnly: true},
			`wait-fraction`:      {RuntimeOnly: true},

no longer necessary, right?

Copy link
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @danhhz and @tbg)


pkg/workload/tpcc/tpcc.go, line 157 at r1 (raw file):

Previously, danhhz (Daniel Harrison) wrote…

no longer necessary, right?

Indeed, fixed.

@knz
Copy link
Contributor Author

knz commented Sep 3, 2019

bors r=danhhz,petermattis

In order to use TPC-C for operational testing (i.e. NOT benchmarking)
it is useful to increase the rate of transactions without
altogether saturating the TPS capacity (`--wait=false`).

For this purpose, this commit extends the syntax accepted by `--wait`
to recognize a multiplier which is applied to all wait times. The
default is 1.0 (i.e. 100% of the wait time required by a benchmark).
The words `true`/`on` and `false`/`off` are aliases for 1.0 and 0.0,
respectively.

Release note: None
@craig
Copy link
Contributor

craig bot commented Sep 3, 2019

Canceled

@knz
Copy link
Contributor Author

knz commented Sep 3, 2019

there was a lint failure, sorry about that

bors r=danhhz,petermattis

craig bot pushed a commit that referenced this pull request Sep 3, 2019
39685: workload/tpcc: extend --wait to also support fractions r=danhhz,petermattis a=knz

In order to use TPC-C for operational testing (i.e. NOT benchmarking)
it is useful to increase the rate of transactions without
altogether saturating the TPS capacity (`--wait=false`).

For this purpose, this commit extends the syntax accepted by `--wait`
to recognize a multiplier which is applied to all wait times. The
default is 1.0 (i.e. 100% of the wait time required by a benchmark).
The words `true`/`on` and `false`/`off` are aliases for 1.0 and 0.0,
respectively

40380: exec: use same decimal context as non-vec r=rafiss a=rafiss

Use the same decimal contexts that eval.go uses for decimal arithmetic.

based on discussion in #40327

Release note: None

Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
Co-authored-by: Rafi Shamim <rafi@cockroachlabs.com>
@craig
Copy link
Contributor

craig bot commented Sep 3, 2019

Build succeeded

@craig craig bot merged commit c6ec74f into cockroachdb:master Sep 3, 2019
@@ -200,15 +241,15 @@ func (w *tpcc) Hooks() workload.Hooks {
// waiting, we only use up to a set number of connections per warehouse.
// This isn't mandated by the spec, but opening a connection per worker
// when they each spend most of their time waiting is wasteful.
if !w.doWaits {
if w.waitFraction == 0 {
w.numConns = w.workers
} else {
w.numConns = w.activeWarehouses * numConnsPerWarehouse
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to scale the number of connections by the wait fraction? I'd expect them to saturate as-is with a fraction like 0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants