ml-settings.asciidoc 13 KB

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