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

[Ingest Manager] Optimize installation of integration #67708

Merged
merged 10 commits into from
Jun 1, 2020

Conversation

neptunian
Copy link
Contributor

@neptunian neptunian commented May 28, 2020

Installing an integration for a large package like AWS is timing out in cloud. I think this might speed things up enough.

Changes:

  • Makes sure to only call getArchiveInfo which caches the tar.gz file once per package installed
  • fixes checking whether the package is cached by getting the correct key

To test try the following on master and then in this PR:

  • restart kibana (clear caching of packages)
  • refresh the browser (to make sure setup has run and installed default packages)
  • Install AWS with chrome dev tools open
  • See how long the request takes
  • repeat for each request

*Note that because we use a cache it will take longer the first time its installed (which is going mostly always be the case) and whether or not other packages are installed (because of building the index patterns #67760 - i'm not comfortable making this optimization in alpha ) so these cases should be checked, too.

Fixes: #67743

Before changes, locally I consistently get about 7-9 seconds
Screen Shot 2020-05-29 at 11 54 23 AM

With these changes its around 3-5
Screen Shot 2020-05-29 at 11 40 49 AM

These comparisons were made by restarting the kibana server before each request so there was no cache of aws and while the default packages were installed only (base, endpoint, system)

@neptunian neptunian added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes v7.8.0 Team:Fleet Team label for Observability Data Collection Fleet team Ingest Management:alpha1 Group issues for ingest management alpha1 labels May 28, 2020
@neptunian neptunian requested a review from a team May 28, 2020 21:39
@elasticmachine
Copy link
Contributor

Pinging @elastic/ingest-management (Team:Ingest Management)

Copy link
Contributor

@jfsiii jfsiii left a comment

Choose a reason for hiding this comment

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

I'll try out locally ASAP. Any chance you have traces that show the difference before and after?

@neptunian
Copy link
Contributor Author

neptunian commented May 29, 2020

I'll try out locally ASAP. Any chance you have traces that show the difference before and after?

No, I was having some issues with server errors from APM working on your PR but noticed looking at the traces that this was a good place to start. Using chrome dev tools and looking at the time it takes for the integration install it usually cut the time significantly.

@neptunian
Copy link
Contributor Author

@elasticmachine merge upstream

@jfsiii jfsiii self-requested a review June 1, 2020 11:59
Copy link
Contributor

@jfsiii jfsiii left a comment

Choose a reason for hiding this comment

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

Didn't run locally but LGTM. Sorry for the holdup.

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@nchaulet nchaulet left a comment

Choose a reason for hiding this comment

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

🚀

@neptunian neptunian merged commit cf2aebf into elastic:master Jun 1, 2020
neptunian added a commit to neptunian/kibana that referenced this pull request Jun 1, 2020
* call getArchiveInfo once first, pass paths to template

* pass paths to installPreBuiltTemplates

* pass paths to installILMPolicy

* pass paths to ingest pipeline creation

* use correct package key for cache

* pass paths to kibana assets

* cache other installed packages

* create function for ensuring packages are cached

* remove unused imports

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
neptunian added a commit to neptunian/kibana that referenced this pull request Jun 1, 2020
* call getArchiveInfo once first, pass paths to template

* pass paths to installPreBuiltTemplates

* pass paths to installILMPolicy

* pass paths to ingest pipeline creation

* use correct package key for cache

* pass paths to kibana assets

* cache other installed packages

* create function for ensuring packages are cached

* remove unused imports

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
neptunian added a commit that referenced this pull request Jun 1, 2020
* call getArchiveInfo once first, pass paths to template

* pass paths to installPreBuiltTemplates

* pass paths to installILMPolicy

* pass paths to ingest pipeline creation

* use correct package key for cache

* pass paths to kibana assets

* cache other installed packages

* create function for ensuring packages are cached

* remove unused imports

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
neptunian added a commit that referenced this pull request Jun 1, 2020
* call getArchiveInfo once first, pass paths to template

* pass paths to installPreBuiltTemplates

* pass paths to installILMPolicy

* pass paths to ingest pipeline creation

* use correct package key for cache

* pass paths to kibana assets

* cache other installed packages

* create function for ensuring packages are cached

* remove unused imports

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
@ruflin
Copy link
Member

ruflin commented Jun 2, 2020

@neptunian Could you elaborate on how / where exactly do we cache it?

@neptunian
Copy link
Contributor Author

@ruflin getArchiveInfo is called which eventually calls getOrFetchArchiveBuffer which stores the buffer of each path in memory. It's been around for a while. A lot of the requests being made for it didn't need to keep calling this, though, and some were checking the cache with the wrong key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ingest Management:alpha1 Group issues for ingest management alpha1 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.8.0 v7.9.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Ingest Management] Package Registry hit multiple times
6 participants