ml-settings.asciidoc 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233
  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`.
  93. [[xpack.ml.max_open_jobs]]
  94. `xpack.ml.max_open_jobs`::
  95. (<<cluster-update-settings,Dynamic>>) The maximum number of jobs that can run
  96. simultaneously on a node. In this context, jobs include both {anomaly-jobs} and
  97. {dfanalytics-jobs}. The maximum number of jobs is also constrained by memory
  98. usage. Thus if the estimated memory usage of the jobs would be higher than
  99. allowed, fewer jobs will run on a node. Prior to version 7.1, this setting was a
  100. per-node non-dynamic setting. It became a cluster-wide dynamic setting in
  101. version 7.1. As a result, changes to its value after node startup are used only
  102. after every node in the cluster is running version 7.1 or higher. The minimum
  103. value is `1`; the maximum value is `512`. Defaults to `512`.
  104. `xpack.ml.nightly_maintenance_requests_per_second`::
  105. (<<cluster-update-settings,Dynamic>>) The rate at which the nightly maintenance
  106. task deletes expired model snapshots and results. The setting is a proxy to the
  107. <<docs-delete-by-query-throttle,`requests_per_second`>> parameter used in the
  108. delete by query requests and controls throttling. When the {operator-feature} is
  109. enabled, this setting can be updated only by operator users. Valid values must
  110. be greater than `0.0` or equal to `-1.0`, where `-1.0` means a default value is
  111. used. Defaults to `-1.0`
  112. `xpack.ml.node_concurrent_job_allocations`::
  113. (<<cluster-update-settings,Dynamic>>) The maximum number of jobs that can
  114. concurrently be in the `opening` state on each node. Typically, jobs spend a
  115. small amount of time in this state before they move to `open` state. Jobs that
  116. must restore large models when they are opening spend more time in the `opening`
  117. state. When the {operator-feature} is enabled, this setting can be updated only
  118. by operator users. Defaults to `2`.
  119. [discrete]
  120. [[advanced-ml-settings]]
  121. ==== Advanced machine learning settings
  122. These settings are for advanced use cases; the default values are generally
  123. sufficient:
  124. `xpack.ml.enable_config_migration`::
  125. (<<cluster-update-settings,Dynamic>>) Reserved. When the {operator-feature} is
  126. enabled, this setting can be updated only by operator users.
  127. `xpack.ml.max_anomaly_records`::
  128. (<<cluster-update-settings,Dynamic>>) The maximum number of records that are
  129. output per bucket. Defaults to `500`.
  130. `xpack.ml.max_lazy_ml_nodes`::
  131. (<<cluster-update-settings,Dynamic>>) The number of lazily spun up {ml} nodes.
  132. Useful in situations where {ml} nodes are not desired until the first {ml} job
  133. opens. If the current number of {ml} nodes is greater than or equal to this
  134. setting, it is assumed that there are no more lazy nodes available as the
  135. desired number of nodes have already been provisioned. If a job is opened and
  136. this setting has a value greater than zero and there are no nodes that can
  137. accept the job, the job stays in the `OPENING` state until a new {ml} node is
  138. added to the cluster and the job is assigned to run on that node. When the
  139. {operator-feature} is enabled, this setting can be updated only by operator
  140. users. Defaults to `0`.
  141. +
  142. IMPORTANT: This setting assumes some external process is capable of adding {ml}
  143. nodes to the cluster. This setting is only useful when used in conjunction with
  144. such an external process.
  145. `xpack.ml.max_ml_node_size`::
  146. (<<cluster-update-settings,Dynamic>>)
  147. The maximum node size for {ml} nodes in a deployment that supports automatic
  148. cluster scaling. If you set it to the maximum possible size of future {ml} nodes,
  149. when a {ml} job is assigned to a lazy node it can check (and fail quickly) when
  150. scaling cannot support the size of the job. When the {operator-feature} is
  151. enabled, this setting can be updated only by operator users. Defaults to `0b`,
  152. which means it will be assumed that automatic cluster scaling can add arbitrarily large nodes to the cluster.
  153. `xpack.ml.persist_results_max_retries`::
  154. (<<cluster-update-settings,Dynamic>>) The maximum number of times to retry bulk
  155. indexing requests that fail while processing {ml} results. If the limit is
  156. reached, the {ml} job stops processing data and its status is `failed`. When the
  157. {operator-feature} is enabled, this setting can be updated only by operator
  158. users. The minimum value is `0`; the maximum value is `50`. Defaults to `20`.
  159. `xpack.ml.process_connect_timeout`::
  160. (<<cluster-update-settings,Dynamic>>) The connection timeout for {ml} processes
  161. that run separately from the {es} JVM. When such processes are started they must
  162. connect to the {es} JVM. If the process does not connect within the time period
  163. specified by this setting then the process is assumed to have failed. When the
  164. {operator-feature} is enabled, this setting can be updated only by operator
  165. users. The minimum value is `5s`. Defaults to `10s`.
  166. `xpack.ml.use_auto_machine_memory_percent`::
  167. (<<cluster-update-settings,Dynamic>>) If this setting is `true`, the
  168. `xpack.ml.max_machine_memory_percent` setting is ignored. Instead, the maximum
  169. percentage of the machine's memory that can be used for running {ml} analytics
  170. processes is calculated automatically and takes into account the total node size
  171. and the size of the JVM on the node. If this setting differs between nodes, the
  172. value on the current master node is heeded. When the {operator-feature} is
  173. enabled, this setting can be updated only by operator users. The default value
  174. is `false`.
  175. +
  176. --
  177. [IMPORTANT]
  178. ====
  179. * If you do not have dedicated {ml} nodes (that is to say, the node has
  180. multiple roles), do not enable this setting. Its calculations assume that {ml}
  181. analytics are the main purpose of the node.
  182. * The calculation assumes that dedicated {ml} nodes have at least
  183. `256MB` memory reserved outside of the JVM. If you have tiny {ml}
  184. nodes in your cluster, you shouldn't use this setting.
  185. ====
  186. --
  187. [discrete]
  188. [[model-inference-circuit-breaker]]
  189. ==== {ml-cap} circuit breaker settings
  190. `breaker.model_inference.limit`::
  191. (<<cluster-update-settings,Dynamic>>) The limit for the trained model circuit
  192. breaker. This value is defined as a percentage of the JVM heap. Defaults to
  193. `50%`. If the <<parent-circuit-breaker,parent circuit breaker>> is set to a
  194. value less than `50%`, this setting uses that value as its default instead.
  195. `breaker.model_inference.overhead`::
  196. (<<cluster-update-settings,Dynamic>>) A constant that all trained model
  197. estimations are multiplied by to determine a final estimation. See
  198. <<circuit-breaker>>. Defaults to `1`.
  199. `breaker.model_inference.type`::
  200. (<<static-cluster-setting,Static>>) The underlying type of the circuit breaker.
  201. There are two valid options: `noop` and `memory`. `noop` means the circuit
  202. breaker does nothing to prevent too much memory usage. `memory` means the
  203. circuit breaker tracks the memory used by trained models and can potentially
  204. break and prevent `OutOfMemory` errors. The default value is `memory`.