Skip to content

Dev server restart time #77298

@mshustov

Description

@mshustov

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Team:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Team:OperationsKibana-Operations TeamenhancementNew value added to drive a business result

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions