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

refreshing secrets is slow #177

Closed
tfheen opened this issue Jul 28, 2015 · 4 comments
Closed

refreshing secrets is slow #177

tfheen opened this issue Jul 28, 2015 · 4 comments

Comments

@tfheen
Copy link

tfheen commented Jul 28, 2015

Right now knife vault refresh foo bar takes a long time if the search for foo/bar hits a lot of nodes (hundreds to about a thousand in my test).

From my analysis, this primarily comes from two sources:

  • Downloading all the node objects take a long time. About two minutes on my test connection (hosted Chef, I'm in Europe on a DSL line). As we don't actually need the full node objects, we can use a partial search and just ask for the host name.
  • Downloading the client keys is dominated massively by latency. I see two ways this can be solved: use threads or construct a big search query to download all the public keys in one go; basically doing .search(:client, "name:foo OR name:bar OR name:baz …).
@kamaradclimber
Copy link
Contributor

kamaradclimber commented Apr 27, 2017

Resurrecting this very old ticket.
We have exactly the same issue and have implemented a few patches to solve that issue:

Once all these PR will be merged, cost of refresh should be:

  • cost of search to the chef server
  • cost of encrypting symetrical key for new nodes only
  • saving 1 data bag item (xxx_keys) to the chef server

You can read the detail of improvements on each PR.

@kamaradclimber
Copy link
Contributor

Edit, with all these improvements (starting from chef-vault < 3.0) our total refresh time (to refresh all secrets when search_query result has not changed + update secrets to include all admins) has gone from >3h to 20minutes.

@kamaradclimber
Copy link
Contributor

There is still easy points on the way updates are done when changing only the admin list so I think it would be doable to win a few more minutes there.

@kamaradclimber
Copy link
Contributor

I think we can now close this issue and reopen a new one if some obvious speed issue is found.

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

No branches or pull requests

2 participants