Skip to content

cli,democluster: defer simulated latency until after cluster setup#92231

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
ajwerner:ajwerner/faster-startup
Nov 23, 2022
Merged

cli,democluster: defer simulated latency until after cluster setup#92231
craig[bot] merged 2 commits intocockroachdb:masterfrom
ajwerner:ajwerner/faster-startup

Conversation

@ajwerner
Copy link
Copy Markdown
Contributor

democluster,serverutils/regionlatency,rpc: extract code for simulating latency

We'll want to leverage these helpers in some tests to measure behavior under
simulated latency.

cli,democluster: defer simulated latency until after cluster setup

Cluster creation and tenant setup is chatty. That's an okay thing: we don't
really care about cluster creation being that slow in general. In the case of
demo when we want to simulate latency and use tenants, it was particularly
painful. Starting the 9 tenants would take many minutes. This patch alleviates
this problem by keeping latency between the simulated nodes low until just
before we pass control to the user.

Fixes #76305

Release note (cli change): cockroach demo --global will now start up more
quickly. The latency which will be injected is not injected until after the
initial cluster is set up internally.

@ajwerner ajwerner requested review from a team as code owners November 21, 2022 01:03
@ajwerner ajwerner requested a review from a team November 21, 2022 01:03
@ajwerner ajwerner requested a review from a team as a code owner November 21, 2022 01:03
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@ajwerner ajwerner force-pushed the ajwerner/faster-startup branch 3 times, most recently from f571a78 to 26a99fc Compare November 21, 2022 04:10
Copy link
Copy Markdown
Contributor

@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.

LGTM but please also seek review from @rafiss

@ajwerner ajwerner requested a review from rafiss November 22, 2022 02:07
Copy link
Copy Markdown
Collaborator

@rafiss rafiss 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 to have, lgtm!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)


pkg/testutils/serverutils/regionlatency/region_latencies.go line 117 at r1 (raw file):

// RoundTripPairs are pairs of round-trip latency between regions.
type RoundTripPairs map[Pair]time.Duration

nit: should the value-type be RoundTripLatency?

…g latency

We'll want to leverage these helpers in some tests to measure behavior under
simulated latency.

Release note: None
Cluster creation and tenant setup is chatty. That's an okay thing: we don't
really care about cluster creation being that slow in general. In the case of
demo when we want to simulate latency and use tenants, it was particularly
painful. Starting the 9 tenants would take many minutes. This patch alleviates
this problem by keeping latency between the simulated nodes low until just
before we pass control to the user.

Fixes cockroachdb#76305

Release note (cli change): `cockroach demo --global` will now start up more
quickly. The latency which will be injected is not injected until after the
initial cluster is set up internally.
@ajwerner ajwerner force-pushed the ajwerner/faster-startup branch from 26a99fc to 137b27b Compare November 22, 2022 19:47
Copy link
Copy Markdown
Contributor Author

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

TFTR!

bors r+

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @rafiss)


pkg/testutils/serverutils/regionlatency/region_latencies.go line 117 at r1 (raw file):

Previously, rafiss (Rafi Shamim) wrote…

nit: should the value-type be RoundTripLatency?

Done.

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 22, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 22, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Nov 23, 2022

Build succeeded:

@ajstorm
Copy link
Copy Markdown
Collaborator

ajstorm commented Nov 23, 2022

Nice. Thanks for getting to this @ajwerner!

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.

multitenant: demo startup performance is poor with multiple tenants and simulated latencies

5 participants