ml-settings.asciidoc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. [role="xpack"]
  2. [[ml-settings]]
  3. === Machine learning settings in Elasticsearch
  4. ++++
  5. <titleabbrev>Machine learning settings</titleabbrev>
  6. ++++
  7. [[ml-settings-description]]
  8. // tag::ml-settings-description-tag[]
  9. You do not need to configure any settings to use {ml}. It is enabled by default.
  10. IMPORTANT: {ml-cap} uses SSE4.2 instructions, so it works only on machines whose
  11. CPUs {wikipedia}/SSE4#Supporting_CPUs[support] SSE4.2. If you run {es} on older
  12. hardware, you must disable {ml} (by setting `xpack.ml.enabled` to `false`).
  13. // end::ml-settings-description-tag[]
  14. [discrete]
  15. [[general-ml-settings]]
  16. ==== General machine learning settings
  17. `node.roles: [ ml ]`::
  18. (<<static-cluster-setting,Static>>) Set `node.roles` to contain `ml` to identify
  19. the node as a _{ml} node_. If you want to run {ml} jobs, there must be at least
  20. one {ml} node in your cluster.
  21. +
  22. If you set `node.roles`, you must explicitly specify all the required roles for
  23. the node. To learn more, refer to <<modules-node>>.
  24. +
  25. [IMPORTANT]
  26. ====
  27. * On dedicated coordinating nodes or dedicated master nodes, do not set
  28. the `ml` role.
  29. * It is strongly recommended that dedicated {ml} nodes also have the `remote_cluster_client` role; otherwise, {ccs} fails when used in {ml} jobs or {dfeeds}. See <<remote-node>>.
  30. ====
  31. `xpack.ml.enabled`::
  32. (<<static-cluster-setting,Static>>) Set to `true` (default) to enable {ml} APIs
  33. on the node.
  34. +
  35. If set to `false`, the {ml} APIs are disabled on the node. Therefore the node
  36. cannot open jobs, start {dfeeds}, or receive transport (internal) communication
  37. requests related to {ml} APIs. If the node is a coordinating node, {ml} requests
  38. from clients (including {kib}) also fail. For more information about disabling
  39. {ml} in specific {kib} instances, see
  40. {kibana-ref}/ml-settings-kb.html[{kib} {ml} settings].
  41. +
  42. IMPORTANT: If you want to use {ml-features} in your cluster, it is recommended
  43. that you set `xpack.ml.enabled` to `true` on all nodes. This is the default
  44. behavior. At a minimum, it must be enabled on all master-eligible nodes. If you
  45. want to use {ml-features} in clients or {kib}, it must also be enabled on all
  46. coordinating nodes.
  47. `xpack.ml.inference_model.cache_size`::
  48. (<<static-cluster-setting,Static>>) The maximum inference cache size allowed.
  49. The inference cache exists in the JVM heap on each ingest node. The cache
  50. affords faster processing times for the `inference` processor. The value can be
  51. a static byte sized value (such as `2gb`) or a percentage of total allocated
  52. heap. Defaults to `40%`. See also <<model-inference-circuit-breaker>>.
  53. [[xpack-interference-model-ttl]]
  54. // tag::interference-model-ttl-tag[]
  55. `xpack.ml.inference_model.time_to_live` {ess-icon}::
  56. (<<static-cluster-setting,Static>>) The time to live (TTL) for trained models in
  57. the inference model cache. The TTL is calculated from last access. Users of the
  58. cache (such as the inference processor or inference aggregator) cache a model on
  59. its first use and reset the TTL on every use. If a cached model is not accessed
  60. for the duration of the TTL, it is flagged for eviction from the cache. If a
  61. document is processed later, the model is again loaded into the cache. To update
  62. this setting in {ess}, see
  63. {cloud}/ec-add-user-settings.html[Add {es} user settings]. Defaults to `5m`.
  64. // end::interference-model-ttl-tag[]
  65. `xpack.ml.max_inference_processors`::
  66. (<<cluster-update-settings,Dynamic>>) The total number of `inference` type
  67. processors allowed across all ingest pipelines. Once the limit is reached,
  68. adding an `inference` processor to a pipeline is disallowed. Defaults to `50`.
  69. `xpack.ml.max_machine_memory_percent`::
  70. (<<cluster-update-settings,Dynamic>>) The maximum percentage of the machine's
  71. memory that {ml} may use for running analytics processes. These processes are
  72. separate to the {es} JVM. The limit is based on the total memory of the machine,
  73. not current free memory. Jobs are not allocated to a node if doing so would
  74. cause the estimated memory use of {ml} jobs to exceed the limit. When the
  75. {operator-feature} is enabled, this setting can be updated only by operator
  76. users. The minimum value is `5`; the maximum value is `200`. Defaults to `30`.
  77. +
  78. --
  79. TIP: Do not configure this setting to a value higher than the amount of memory
  80. left over after running the {es} JVM unless you have enough swap space to
  81. accommodate it and have determined this is an appropriate configuration for a
  82. specialist use case. The maximum setting value is for the special case where it
  83. has been determined that using swap space for {ml} jobs is acceptable. The
  84. general best practice is to not use swap on {es} nodes.
  85. --
  86. `xpack.ml.max_model_memory_limit`::
  87. (<<cluster-update-settings,Dynamic>>) The maximum `model_memory_limit` property
  88. value that can be set for any {ml} jobs in this cluster. If you try to create a
  89. job with a `model_memory_limit` property value that is greater than this setting
  90. value, an error occurs. Existing jobs are not affected when you update this
  91. setting. If this setting is `0` or unset, there is no maximum
  92. `model_memory_limit` value. If there are no nodes that meet the memory
  93. requirements for a job, this lack of a maximum memory limit means it's possible
  94. to create jobs that cannot be assigned to any available nodes. For more
  95. information about the `model_memory_limit` property, see
  96. <<ml-put-job,Create {anomaly-jobs}>> or <<put-dfanalytics>>. Defaults to `0`.
  97. [[xpack.ml.max_open_jobs]]
  98. `xpack.ml.max_open_jobs`::
  99. (<<cluster-update-settings,Dynamic>>) The maximum number of jobs that can run
  100. simultaneously on a node. In this context, jobs include both {anomaly-jobs} and
  101. {dfanalytics-jobs}. The maximum number of jobs is also constrained by memory
  102. usage. Thus if the estimated memory usage of the jobs would be higher than
  103. allowed, fewer jobs will run on a node. Prior to version 7.1, this setting was a
  104. per-node non-dynamic setting. It became a cluster-wide dynamic setting in
  105. version 7.1. As a result, changes to its value after node startup are used only
  106. after every node in the cluster is running version 7.1 or higher. The minimum
  107. value is `1`; the maximum value is `512`. Defaults to `20`.
  108. `xpack.ml.nightly_maintenance_requests_per_second`::
  109. (<<cluster-update-settings,Dynamic>>) The rate at which the nightly maintenance
  110. task deletes expired model snapshots and results. The setting is a proxy to the
  111. <<docs-delete-by-query-throttle,`requests_per_second`>> parameter used in the
  112. delete by query requests and controls throttling. When the {operator-feature} is
  113. enabled, this setting can be updated only by operator users. Valid values must
  114. be greater than `0.0` or equal to `-1.0`, where `-1.0` means a default value is
  115. used. Defaults to `-1.0`
  116. `xpack.ml.node_concurrent_job_allocations`::
  117. (<<cluster-update-settings,Dynamic>>) The maximum number of jobs that can
  118. concurrently be in the `opening` state on each node. Typically, jobs spend a
  119. small amount of time in this state before they move to `open` state. Jobs that
  120. must restore large models when they are opening spend more time in the `opening`
  121. state. When the {operator-feature} is enabled, this setting can be updated only
  122. by operator users. Defaults to `2`.
  123. [discrete]
  124. [[advanced-ml-settings]]
  125. ==== Advanced machine learning settings
  126. These settings are for advanced use cases; the default values are generally
  127. sufficient:
  128. `xpack.ml.enable_config_migration`::
  129. (<<cluster-update-settings,Dynamic>>) Reserved. When the {operator-feature} is
  130. enabled, this setting can be updated only by operator users.
  131. `xpack.ml.max_anomaly_records`::
  132. (<<cluster-update-settings,Dynamic>>) The maximum number of records that are
  133. output per bucket. Defaults to `500`.
  134. `xpack.ml.max_lazy_ml_nodes`::
  135. (<<cluster-update-settings,Dynamic>>) The number of lazily spun up {ml} nodes.
  136. Useful in situations where {ml} nodes are not desired until the first {ml} job
  137. opens. If the current number of {ml} nodes is greater than or equal to this
  138. setting, it is assumed that there are no more lazy nodes available as the
  139. desired number of nodes have already been provisioned. If a job is opened and
  140. this setting has a value greater than zero and there are no nodes that can
  141. accept the job, the job stays in the `OPENING` state until a new {ml} node is
  142. added to the cluster and the job is assigned to run on that node. When the
  143. {operator-feature} is enabled, this setting can be updated only by operator
  144. users. Defaults to `0`.
  145. +
  146. IMPORTANT: This setting assumes some external process is capable of adding {ml}
  147. nodes to the cluster. This setting is only useful when used in conjunction with
  148. such an external process.
  149. `xpack.ml.max_ml_node_size`::
  150. (<<cluster-update-settings,Dynamic>>)
  151. The maximum node size for {ml} nodes in a deployment that supports automatic
  152. cluster scaling. If you set it to the maximum possible size of future {ml} nodes,
  153. when a {ml} job is assigned to a lazy node it can check (and fail quickly) when
  154. scaling cannot support the size of the job. When the {operator-feature} is
  155. enabled, this setting can be updated only by operator users. Defaults to `0b`,
  156. which means it will be assumed that automatic cluster scaling can add arbitrarily large nodes to the cluster.
  157. `xpack.ml.persist_results_max_retries`::
  158. (<<cluster-update-settings,Dynamic>>) The maximum number of times to retry bulk
  159. indexing requests that fail while processing {ml} results. If the limit is
  160. reached, the {ml} job stops processing data and its status is `failed`. When the
  161. {operator-feature} is enabled, this setting can be updated only by operator
  162. users. The minimum value is `0`; the maximum value is `50`. Defaults to `20`.
  163. `xpack.ml.process_connect_timeout`::
  164. (<<cluster-update-settings,Dynamic>>) The connection timeout for {ml} processes
  165. that run separately from the {es} JVM. When such processes are started they must
  166. connect to the {es} JVM. If the process does not connect within the time period
  167. specified by this setting then the process is assumed to have failed. When the
  168. {operator-feature} is enabled, this setting can be updated only by operator
  169. users. The minimum value is `5s`. Defaults to `10s`.
  170. xpack.ml.use_auto_machine_memory_percent::
  171. (<<cluster-update-settings,Dynamic>>) If this setting is `true`, the
  172. `xpack.ml.max_machine_memory_percent` setting is ignored. Instead, the maximum
  173. percentage of the machine's memory that can be used for running {ml} analytics
  174. processes is calculated automatically and takes into account the total node size
  175. and the size of the JVM on the node. If this setting differs between nodes, the
  176. value on the current master node is heeded. When the {operator-feature} is
  177. enabled, this setting can be updated only by operator users. The default value
  178. is `false`.
  179. +
  180. --
  181. [IMPORTANT]
  182. ====
  183. * If you do not have dedicated {ml} nodes (that is to say, the node has
  184. multiple roles), do not enable this setting. Its calculations assume that {ml}
  185. analytics are the main purpose of the node.
  186. * The calculation assumes that dedicated {ml} nodes have at least
  187. `256MB` memory reserved outside of the JVM. If you have tiny {ml}
  188. nodes in your cluster, you shouldn't use this setting.
  189. ====
  190. --
  191. [discrete]
  192. [[model-inference-circuit-breaker]]
  193. ==== {ml-cap} circuit breaker settings
  194. `breaker.model_inference.limit`::
  195. (<<cluster-update-settings,Dynamic>>) The limit for the trained model circuit
  196. breaker. This value is defined as a percentage of the JVM heap. Defaults to
  197. `50%`. If the <<parent-circuit-breaker,parent circuit breaker>> is set to a
  198. value less than `50%`, this setting uses that value as its default instead.
  199. `breaker.model_inference.overhead`::
  200. (<<cluster-update-settings,Dynamic>>) A constant that all trained model
  201. estimations are multiplied by to determine a final estimation. See
  202. <<circuit-breaker>>. Defaults to `1`.
  203. `breaker.model_inference.type`::
  204. (<<static-cluster-setting,Static>>) The underlying type of the circuit breaker.
  205. There are two valid options: `noop` and `memory`. `noop` means the circuit
  206. breaker does nothing to prevent too much memory usage. `memory` means the
  207. circuit breaker tracks the memory used by trained models and can potentially
  208. break and prevent `OutOfMemory` errors. The default value is `memory`.