ml-settings.asciidoc 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  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 (i.e. "2gb") or a percentage of total allocated heap.
  52. The default is "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 models in the
  57. inference model cache. The TTL is calculated from last access. The `inference`
  58. processor attempts to load the model from cache. If the `inference` processor
  59. does not receive any documents for the duration of the TTL, the referenced model
  60. is flagged for eviction from the cache. If a document is processed later, the
  61. model is again loaded into the cache. Defaults to `5m`.
  62. // end::interference-model-ttl-tag[]
  63. `xpack.ml.max_inference_processors`::
  64. (<<cluster-update-settings,Dynamic>>) The total number of `inference` type
  65. processors allowed across all ingest pipelines. Once the limit is reached,
  66. adding an `inference` processor to a pipeline is disallowed. Defaults to `50`.
  67. `xpack.ml.max_machine_memory_percent`::
  68. (<<cluster-update-settings,Dynamic>>) The maximum percentage of the machine's
  69. memory that {ml} may use for running analytics processes. (These processes are
  70. separate to the {es} JVM.) Defaults to `30` percent. The limit is based on the
  71. total memory of the machine, not current free memory. Jobs are not allocated to
  72. a node if doing so would cause the estimated memory use of {ml} jobs to exceed
  73. the limit.
  74. `xpack.ml.max_model_memory_limit`::
  75. (<<cluster-update-settings,Dynamic>>) The maximum `model_memory_limit` property
  76. value that can be set for any job on this node. If you try to create a job with
  77. a `model_memory_limit` property value that is greater than this setting value,
  78. an error occurs. Existing jobs are not affected when you update this setting.
  79. For more information about the `model_memory_limit` property, see
  80. <<put-analysislimits>>.
  81. [[xpack.ml.max_open_jobs]]
  82. `xpack.ml.max_open_jobs`::
  83. (<<cluster-update-settings,Dynamic>>) The maximum number of jobs that can run
  84. simultaneously on a node. Defaults to `20`. In this context, jobs include both
  85. {anomaly-jobs} and {dfanalytics-jobs}. The maximum number of jobs is also
  86. constrained by memory usage. Thus if the estimated memory usage of the jobs
  87. would be higher than allowed, fewer jobs will run on a node. Prior to version
  88. 7.1, this setting was a per-node non-dynamic setting. It became a cluster-wide
  89. dynamic setting in version 7.1. As a result, changes to its value after node
  90. startup are used only after every node in the cluster is running version 7.1 or
  91. higher. The maximum permitted value is `512`.
  92. `xpack.ml.nightly_maintenance_requests_per_second`::
  93. (<<cluster-update-settings,Dynamic>>) The rate at which the nightly maintenance task
  94. deletes expired model snapshots and results. The setting is a proxy to the
  95. [requests_per_second](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-delete-by-query.html#_throttling_delete_requests)
  96. parameter used in the Delete by query requests and controls throttling.
  97. Valid values must be greater than `0.0` or equal to `-1.0` where `-1.0` means a default value
  98. is used. Defaults to `-1.0`
  99. `xpack.ml.node_concurrent_job_allocations`::
  100. (<<cluster-update-settings,Dynamic>>) The maximum number of jobs that can
  101. concurrently be in the `opening` state on each node. Typically, jobs spend a
  102. small amount of time in this state before they move to `open` state. Jobs that
  103. must restore large models when they are opening spend more time in the `opening`
  104. state. Defaults to `2`.
  105. [discrete]
  106. [[advanced-ml-settings]]
  107. ==== Advanced machine learning settings
  108. These settings are for advanced use cases; the default values are generally
  109. sufficient:
  110. `xpack.ml.enable_config_migration`::
  111. (<<cluster-update-settings,Dynamic>>) Reserved.
  112. `xpack.ml.max_anomaly_records`::
  113. (<<cluster-update-settings,Dynamic>>) The maximum number of records that are
  114. output per bucket. The default value is `500`.
  115. `xpack.ml.max_lazy_ml_nodes`::
  116. (<<cluster-update-settings,Dynamic>>) The number of lazily spun up {ml} nodes.
  117. Useful in situations where {ml} nodes are not desired until the first {ml} job
  118. opens. It defaults to `0` and has a maximum acceptable value of `3`. If the
  119. current number of {ml} nodes is greater than or equal to this setting, it is
  120. assumed that there are no more lazy nodes available as the desired number
  121. of nodes have already been provisioned. If a job is opened and this setting has
  122. a value greater than zero and there are no nodes that can accept the job, the
  123. job stays in the `OPENING` state until a new {ml} node is added to the cluster
  124. and the job is assigned to run on that node.
  125. +
  126. IMPORTANT: This setting assumes some external process is capable of adding {ml}
  127. nodes to the cluster. This setting is only useful when used in conjunction with
  128. such an external process.
  129. `xpack.ml.max_ml_node_size`::
  130. (<<cluster-update-settings,Dynamic>>)
  131. The maximum node size for {ml} nodes in a deployment that supports automatic
  132. cluster scaling. Defaults to `0b`, which means this value is ignored. If you set
  133. it to the maximum possible size of future {ml} nodes, when a {ml} job is
  134. assigned to a lazy node it can check (and fail quickly) when scaling cannot
  135. support the size of the job.
  136. `xpack.ml.process_connect_timeout`::
  137. (<<cluster-update-settings,Dynamic>>) The connection timeout for {ml} processes
  138. that run separately from the {es} JVM. Defaults to `10s`. Some {ml} processing
  139. is done by processes that run separately to the {es} JVM. When such processes
  140. are started they must connect to the {es} JVM. If such a process does not
  141. connect within the time period specified by this setting then the process is
  142. assumed to have failed. Defaults to `10s`. The minimum value for this setting is
  143. `5s`.
  144. xpack.ml.use_auto_machine_memory_percent::
  145. (<<cluster-update-settings,Dynamic>>) If this setting is `true`, the
  146. `xpack.ml.max_machine_memory_percent` setting is ignored. Instead, the maximum
  147. percentage of the machine's memory that can be used for running {ml} analytics
  148. processes is calculated automatically and takes into account the total node size
  149. and the size of the JVM on the node. The default value is `false`. If this
  150. setting differs between nodes, the value on the current master node is heeded.
  151. +
  152. TIP: If you do not have dedicated {ml} nodes (that is to say, the node has
  153. multiple roles), do not enable this setting. Its calculations assume that {ml}
  154. analytics are the main purpose of the node.
  155. +
  156. IMPORTANT: The calculation assumes that dedicated {ml} nodes have at least
  157. `256MB` memory reserved outside of the JVM. If you have tiny {ml}
  158. nodes in your cluster, you shouldn't use this setting.
  159. [discrete]
  160. [[model-inference-circuit-breaker]]
  161. ==== {ml-cap} circuit breaker settings
  162. `breaker.model_inference.limit`::
  163. (<<cluster-update-settings,Dynamic>>) Limit for the model inference breaker,
  164. which defaults to 50% of the JVM heap. If the parent circuit breaker is less
  165. than 50% of the JVM heap, it is bound to that limit instead. See
  166. <<circuit-breaker>>.
  167. `breaker.model_inference.overhead`::
  168. (<<cluster-update-settings,Dynamic>>) A constant that all accounting estimations
  169. are multiplied by to determine a final estimation. Defaults to 1. See
  170. <<circuit-breaker>>.
  171. `breaker.model_inference.type`::
  172. (<<static-cluster-setting,Static>>) The underlying type of the circuit breaker.
  173. There are two valid options: `noop` and `memory`. `noop` means the circuit
  174. breaker does nothing to prevent too much memory usage. `memory` means the
  175. circuit breaker tracks the memory used by inference models and can potentially
  176. break and prevent `OutOfMemory` errors. The default is `memory`.