-
Notifications
You must be signed in to change notification settings - Fork 8.5k
Closed
Labels
Team:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Team:OperationsKibana-Operations TeamKibana-Operations TeamenhancementNew value added to drive a business resultNew value added to drive a business result
Description
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.
kibana/src/core/server/plugins/plugin.ts
Line 141 in 744a7b1
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-registerthrowing 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.
dgieselaar, cauemarcondes, shahzad31, sorenlouv and watson
Metadata
Metadata
Assignees
Labels
Team:CorePlatform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Platform Core services: plugins, logging, config, saved objects, http, ES client, i18n, etc t//Team:OperationsKibana-Operations TeamKibana-Operations TeamenhancementNew value added to drive a business resultNew value added to drive a business result