ml-settings.asciidoc 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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
  30. `remote_cluster_client` role; otherwise, {ccs} fails when used in {ml} jobs or
  31. {dfeeds}. See <<remote-node>>.
  32. ====
  33. `xpack.ml.enabled`::
  34. (<<static-cluster-setting,Static>>) The default value (`true`) enables {ml} APIs
  35. on the node.
  36. +
  37. IMPORTANT: If you want to use {ml-features} in your cluster, it is recommended
  38. that you use the default value for this setting on all nodes.
  39. +
  40. If set to `false`, the {ml} APIs are disabled on the node. For example, the node
  41. cannot open jobs, start {dfeeds}, receive transport (internal) communication
  42. requests, or requests from clients (including {kib}) related to {ml} APIs.
  43. `xpack.ml.inference_model.cache_size`::
  44. (<<static-cluster-setting,Static>>) The maximum inference cache size allowed.
  45. The inference cache exists in the JVM heap on each ingest node. The cache
  46. affords faster processing times for the `inference` processor. The value can be
  47. a static byte sized value (such as `2gb`) or a percentage of total allocated
  48. heap. Defaults to `40%`. See also <<model-inference-circuit-breaker>>.
  49. [[xpack-interference-model-ttl]]
  50. // tag::interference-model-ttl-tag[]
  51. `xpack.ml.inference_model.time_to_live` {ess-icon}::
  52. (<<static-cluster-setting,Static>>) The time to live (TTL) for trained models in
  53. the inference model cache. The TTL is calculated from last access. Users of the
  54. cache (such as the inference processor or inference aggregator) cache a model on
  55. its first use and reset the TTL on every use. If a cached model is not accessed
  56. for the duration of the TTL, it is flagged for eviction from the cache. If a
  57. document is processed later, the model is again loaded into the cache. To update
  58. this setting in {ess}, see
  59. {cloud}/ec-add-user-settings.html[Add {es} user settings]. Defaults to `5m`.
  60. // end::interference-model-ttl-tag[]
  61. `xpack.ml.max_inference_processors`::
  62. (<<cluster-update-settings,Dynamic>>) The total number of `inference` type
  63. processors allowed across all ingest pipelines. Once the limit is reached,
  64. adding an `inference` processor to a pipeline is disallowed. Defaults to `50`.
  65. `xpack.ml.max_machine_memory_percent`::
  66. (<<cluster-update-settings,Dynamic>>) The maximum percentage of the machine's
  67. memory that {ml} may use for running analytics processes. These processes are
  68. separate to the {es} JVM. The limit is based on the total memory of the machine,
  69. not current free memory. Jobs are not allocated to a node if doing so would
  70. cause the estimated memory use of {ml} jobs to exceed the limit. When the
  71. {operator-feature} is enabled, this setting can be updated only by operator
  72. users. The minimum value is `5`; the maximum value is `200`. Defaults to `30`.
  73. +
  74. --
  75. TIP: Do not configure this setting to a value higher than the amount of memory
  76. left over after running the {es} JVM unless you have enough swap space to
  77. accommodate it and have determined this is an appropriate configuration for a
  78. specialist use case. The maximum setting value is for the special case where it
  79. has been determined that using swap space for {ml} jobs is acceptable. The
  80. general best practice is to not use swap on {es} nodes.
  81. --
  82. `xpack.ml.max_model_memory_limit`::
  83. (<<cluster-update-settings,Dynamic>>) The maximum `model_memory_limit` property
  84. value that can be set for any {ml} jobs in this cluster. If you try to create a
  85. job with a `model_memory_limit` property value that is greater than this setting
  86. value, an error occurs. Existing jobs are not affected when you update this
  87. setting. If this setting is `0` or unset, there is no maximum
  88. `model_memory_limit` value. If there are no nodes that meet the memory
  89. requirements for a job, this lack of a maximum memory limit means it's possible
  90. to create jobs that cannot be assigned to any available nodes. For more
  91. information about the `model_memory_limit` property, see
  92. <<ml-put-job,Create {anomaly-jobs}>> or <<put-dfanalytics>>. Defaults to `0` if
  93. `xpack.ml.use_auto_machine_memory_percent` is `false`. If
  94. `xpack.ml.use_auto_machine_memory_percent` is `true` and
  95. `xpack.ml.max_model_memory_limit` is not explicitly set then it will default to
  96. the largest `model_memory_limit` that could be assigned in the cluster.
  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 `512`.
  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. When the {operator-feature} is enabled, this
  176. setting can be updated only by operator users. The default value is `false`.
  177. +
  178. --
  179. [IMPORTANT]
  180. ====
  181. * If you do not have dedicated {ml} nodes (that is to say, the node has
  182. multiple roles), do not enable this setting. Its calculations assume that {ml}
  183. analytics are the main purpose of the node.
  184. * The calculation assumes that dedicated {ml} nodes have at least
  185. `256MB` memory reserved outside of the JVM. If you have tiny {ml}
  186. nodes in your cluster, you shouldn't use this setting.
  187. ====
  188. --
  189. +
  190. If this setting is `true` it also affects the default value for
  191. `xpack.ml.max_model_memory_limit`. In this case `xpack.ml.max_model_memory_limit`
  192. defaults to the largest size that could be assigned in the current cluster.
  193. [discrete]
  194. [[model-inference-circuit-breaker]]
  195. ==== {ml-cap} circuit breaker settings
  196. The relevant circuit breaker settings can be found in the <<circuit-breakers-page-model-inference, Circuit Breakers page>>.