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

Dev server restart time #77298

Closed
mshustov opened this issue Sep 14, 2020 · 3 comments
Closed

Dev server restart time #77298

mshustov opened this issue Sep 14, 2020 · 3 comments
Labels
enhancement New value added to drive a business result Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Operations Team label for Operations Team

Comments

@mshustov
Copy link
Contributor

mshustov commented Sep 14, 2020

Kibana restarts the server in dev mode whenever the server-side code has been changed. However, I felt the server restart is extremely slow (~40sec. on my high-end laptop) and decided to figure a reason. Turned out, Kibana spends 90% of that time compiling js code with babel-register. Several problems need solving:

  • the platform always imports and re-compiles plugin server-side code, even if a plugin is disabled. That's a downside of the current implementation of the plugin config schema declaration.
    const pluginDefinition = require(pluginPathServer);

    In a long term, we might need to reconsider our approach to code compilation in dev: do not compile disabled plugins, speed up compilation, use a single compiler(created Dev server restart time #77298 to discuss) etc.
  • I can often observe babel-register throwing OOM exception when writing cache to the disk during server restart. As a result, the cache is not updated and won't be used when re-compiling. From my testing, it seems that with re-used cache the compilation takes ~15sec, without ~40sec.
    As a short term solution, we could increase the memory limit for nodejs process in dev mode to ensure babel writes its cache to the disk.
@mshustov mshustov added Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Operations Team label for Operations Team enhancement New value added to drive a business result labels Sep 14, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-operations (Team:Operations)

@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-platform (Team:Platform)

@mshustov
Copy link
Contributor Author

mshustov commented Oct 6, 2020

the slow compilation problem solved by
#79052
#79358

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New value added to drive a business result Team:Core Core services & architecture: plugins, logging, config, saved objects, http, ES client, i18n, etc Team:Operations Team label for Operations Team
Projects
None yet
Development

No branches or pull requests

2 participants