You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/kbn-optimizer/README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,10 +20,12 @@ The `@kbn/optimizer` is automatically executed from the dev cli, the Kibana buil
20
20
21
21
### Worker count
22
22
23
-
You can limit the number of workers the optimizer uses by setting the `KBN_OPTIMIZER_MAX_WORKERS` environment variable. You might want to do this if your system struggles to keep up while the optimizer is getting started and building all plugins as fast as possible. Setting `KBN_OPTIMIZER_MAX_WORKERS=1` will cause the optimizer to take the longest amount of time but will have the smallest impact on other components of your system.
23
+
You can limit the number of workers the optimizer uses by setting the `KBN_OPTIMIZER_MAX_ACTIVE_WORKERS` environment variable. You might want to do this if your system struggles to keep up while the optimizer is getting started and building all plugins as fast as possible. Setting `KBN_OPTIMIZER_MAX_ACTIVE_WORKERS=1` will cause the optimizer to take the longest amount of time but will have the smallest impact on other components of your system.
24
24
25
25
We only limit the number of workers we will start at any given time. If we start more workers later we will limit the number of workers we start at that time by the maximum, but we don't take into account the number of workers already started because it is assumed that those workers are doing very little work. This greatly simplifies the logic as we don't ever have to reallocate workers and provides the best performance in most cases.
26
26
27
+
You can also influce the number of works using the `KBN_OPTIMIZER_TARGET_MODULES_PER_WORKER` environment variable. This value defaults to 3000 and will cause the creation of enough workers so that each worker will be building approximately this many bundles. If the number of workers created by this value is greater than the maximum allowed by `KBN_OPTIMIZER_MAX_ACTIVE_WORKERS` then we will only start the maximum allowed active workers initially and start subsequent workers once the first ones are done (or idle when in `watch` mode).
28
+
27
29
### Caching
28
30
29
31
Bundles built by the the optimizer include a cache file which describes the information needed to determine if the bundle needs to be rebuilt when the optimizer is restarted. Caching is enabled by default and is very aggressive about invalidating the cache output, but if you need to disable caching you can pass `--no-cache` to `node scripts/build_kibana_platform_plugins`, or set the `KBN_OPTIMIZER_NO_CACHE` environment variable to anything (env overrides everything).
0 commit comments