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

Load and initialize all plugins concurrently #171322

Closed

Conversation

afharo
Copy link
Member

@afharo afharo commented Nov 15, 2023

Summary

After #170856, we may want to parallelize the load of the plugin's code in an attempt to speed up Kibana's startup.

We are only parallelizing the part where we load the plugin and call the constructor but we still maintain the expected order of calling the plugins' setup and start methods.

Risk Matrix

Risk Probability Severity Mitigation/Notes
Concurrently performing this action may cause unexpected spikes in CPU (and Memory?), leading to momentarily high Event Loop Delays. Low Low Memory-wise, it shouldn't be a problem because we already hold all the plugins in memory. I wouldn't expect this approach to use much more. Regarding CPU, it might require higher processing power since it's performing parallel processing, while earlier, it was sequential. We need to test it, but I doubt this will cause any issues.

For maintainers

@afharo afharo added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc performance release_note:skip Skip the PR/issue when compiling release notes backport:skip This commit does not require backporting labels Nov 15, 2023
@afharo afharo requested a review from a team as a code owner November 15, 2023 16:10
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-core (Team:Core)

@afharo afharo self-assigned this Nov 15, 2023
@afharo
Copy link
Member Author

afharo commented Nov 15, 2023

According to our APM data, there doesn't seem to improve things. Which makes sense, given that loading the files from disk is the only thing that can be parallelized. Parsing and evaluating the JS files is synchronous.

Closing the PR

@afharo afharo closed this Nov 15, 2023
@kibana-ci
Copy link
Collaborator

kibana-ci commented Nov 15, 2023

💔 Build Failed

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #82 / Monitoring Collection Prometheus endpoint returns prometheus scraped metrics
  • [job] [logs] FTR Configs #82 / Monitoring Collection Prometheus endpoint returns prometheus scraped metrics

Metrics [docs]

✅ unchanged

History

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

cc @afharo

@afharo afharo deleted the concurrent-initialization-of-plugins branch November 15, 2023 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting performance release_note:skip Skip the PR/issue when compiling release notes Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants