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

roachprod: reduce start-up lag #137916

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

tbg
Copy link
Member

@tbg tbg commented Dec 23, 2024

On my machine (which is in Europe), this brings time roachprod --help from 1.56s down to to 0.06s under the following env vars:

ROACHPROD_DISABLE_UPDATE_CHECK=true
ROACHPROD_DISABLED_PROVIDERS=azure
ROACHPROD_SKIP_AWSCLI_CHECK=true

Under these env vars, my roachprod

  • no longer invokes aws --version on each start (python, ~400ms)
  • no longer inits azure, which is >1s for me
  • doesn't list the gs bucket to check for a newer roachprod binary (~800ms; doesn't exist for OSX anyway).

A better way (but one outside of my purview) for most of these would be to add caching for each of these and so to avoid the cost in the common case.

Azure is an exception, as the (wall-clock) profile below shows we're spending most of our time waiting for GetTokenFromCLIWithParams to return. It's not clear how to optimize this. (The AWS portion of the flamegraph is aws --version).

image

Epic: none

The update check takes >800ms where I am. `roachprod` is slow enough as
is, so allow folks to opt out and also opt out automatically in cases
where `roachprod update` doesn't work in the first place (osx).

Epic: none
Release note: None
@cockroach-teamcity
Copy link
Member

This change is Reviewable

tbg added 2 commits December 23, 2024 15:12
This is how I tracked down the slowness inherent in `roachprod --help`.
It might come in handy again in the future; now it's gated behind the
`ROACHPROD_FGPROF` env var.
Azure in particular takes a long time - sometimes well north of 1s.
@tbg tbg marked this pull request as ready for review December 23, 2024 14:24
@tbg tbg requested review from a team as code owners December 23, 2024 14:24
@tbg tbg requested review from herkolategan, vidit-bhat, golgeek and a team and removed request for a team December 23, 2024 14:24
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.

2 participants