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

demo: add with-load switch for background workload for loaded dataset #39944

Closed
jordanlewis opened this issue Aug 23, 2019 · 6 comments · Fixed by #40271
Closed

demo: add with-load switch for background workload for loaded dataset #39944

jordanlewis opened this issue Aug 23, 2019 · 6 comments · Fixed by #40271
Assignees
Labels
A-demo C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@jordanlewis
Copy link
Member

Currently, the web ui for cockroach demo doesn't have anything interesting unless you add it. There's nothing in timeseries and nothing in the statements page unless you actually type commands into the shell.

It would be nice for actual demoing purposes if we could add some light background load so that the web ui gets populated with interesting data. This should probably be hidden behind a flag so that data doesn't just change out from under the user unless they're expecting it. The workload should be chosen based on the initial dataset that's loaded.

@jordanlewis jordanlewis added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-cli labels Aug 23, 2019
@rohany
Copy link
Contributor

rohany commented Aug 26, 2019

Do we have a package that automatically runs a workload against a DB? If not, what would go into doing something like that?

@jordanlewis
Copy link
Member Author

Yes, the workload package does this. I don't think there's anything that's already available to run a workload in-process with a database, but setting that up shouldn't be too hard. Take a look at pkg/workload/cli/cli.go for the entrypoint to the standalone binary. I bet @danhhz would have more pointers if necessary.

@danhhz
Copy link
Contributor

danhhz commented Aug 26, 2019

Yup, workload is what you want. Sadly I haven't had time to bang the queryload part of it into a nice abstraction, so you'll probably just want to copy/paste what's in cli.go and go from there. I'm happy to help along the way

@rohany
Copy link
Contributor

rohany commented Aug 26, 2019

It doesn't look like the movr workload has an implementation of the Ops interface (no workload defined). Are there some example queries that docs uses to run against movr?

@jordanlewis
Copy link
Member Author

Ah that's unfortunate. cc @nstewart - would be great to get the movr app into workload. Any simple queries we could start out with?

@nstewart
Copy link
Contributor

nstewart commented Aug 27, 2019

Sure thing -- here's a subset of the MovR queries (except in the movr loadgen app, they are run in transactions): https://www.cockroachlabs.com/docs/dev/movr.html#how-the-movr-application-works

All in, there are 8 transactions that MovR runs. The promo_codes transactions are useful for showing off the locality-aware optimizer (since the promo_codes table can't be geo-partitioned) and the log ride location transaction is useful for showing a time series workload.

@rohany happy to walk you through the transactions and their probabilities

transaction name      time(total)    ops(total)    ops    ops/second    p50(ms)    p90(ms)    p95(ms)    max(ms)
------------------  -------------  ------------  -----  ------------  ---------  ---------  ---------  ---------
add vehicle                    15            22     22      1.43708       13.16      22.59      26.04      44.31
apply promo code               15            15     15      0.976783      16.45      22.47      23.61      23.97
end ride                       15            51     51      3.32073       21.33      26.76      28.43      31.31
get vehicles                   15          3755   3755    244.475         10.82      16.55      20.83     174.64
log ride location              15          2101   2101    136.764         10.51      15.05      17.43     144.72
new promo code                 15             9      9      0.585794      10.48      13.87      13.96      14.05
new user                       15            57     57      3.70979       12         19.04      23.31      37.63
start ride                     15            56     56      3.6446        22.14      35.67      38.85      54.4

The loadgen logic is here: https://github.com/cockroachdb/movr/blob/master/loadmovr.py#L89
And the queries (via an ORM) are here: https://github.com/cockroachdb/movr/blob/master/movr.py

If you run the container cockroachdb/movr:latest with --echo-sql, you will get the exact queries.

rohany added a commit to rohany/cockroach that referenced this issue Aug 28, 2019
Fixes cockroachdb#39944.

When the `--with-load` flag is passed to demo, a sample movr
workload is run against the database.

I tried my best to replicate the Movr load in Nate's example script.

Based on talks with Dan, it was better to copy out a simpler
version of the logic to run the workload than try to hook
into workload.

Release note (cli change): Add a workload to run with cockroach demo.
rohany added a commit to rohany/cockroach that referenced this issue Aug 28, 2019
Fixes cockroachdb#39944.

When the `--with-load` flag is passed to demo, a sample movr
workload is run against the database.

I tried my best to replicate the Movr load in Nate's example script.

Based on talks with Dan, it was better to copy out a simpler
version of the logic to run the workload than try to hook
into workload.

Release note (cli change): Add a workload to run with cockroach demo.
rohany added a commit to rohany/cockroach that referenced this issue Aug 28, 2019
Fixes cockroachdb#39944.

When the `--with-load` flag is passed to demo, a sample movr
workload is run against the database.

I tried my best to replicate the Movr load in Nate's example script.

Based on talks with Dan, it was better to copy out a simpler
version of the logic to run the workload than try to hook
into workload.

Release note (cli change): Add a workload to run with cockroach demo.
craig bot pushed a commit that referenced this issue Aug 29, 2019
40229: demo: Add location information to default demo localities. r=knz a=rohany

Fixes #39937.

Adds default latitude and longitude information for the default
localities in cockroach demo so that the web UI is pre-populated.

Release note (cli change): Add location information to default
localities to populate web UI for cockroach demo.

40271: demo: Add a Movr workload to run in cockroach demo r=danhhz,nstewart a=rohany

Fixes #39944.

When the `--with-load` flag is passed to demo, a sample movr
workload is run against the database.

I tried my best to replicate the Movr load in Nate's example script.

Based on talks with Dan, it was better to copy out a simpler
version of the logic to run the workload than try to hook
into workload.

Release note (cli change): Add a workload to run with cockroach demo.

40320: randutil: allow COCKROACH_RANDOM_SEED to seed NewPseudoRand r=mjibson a=mjibson

Multiple people have been confused about the lack of interaction
between NewPseudoRand (which used to always generate a random seed)
and COCKROACH_RANDOM_SEED (which only influenced using the global rand
methods).

Release note: None

Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
Co-authored-by: Matt Jibson <matt.jibson@gmail.com>
@craig craig bot closed this as completed in cfd9f47 Aug 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-demo C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants