machine-learning-decider.asciidoc 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [role="xpack"]
  2. [[autoscaling-machine-learning-decider]]
  3. === Machine learning decider
  4. The {ml} decider (`ml`) calculates the memory required to run {ml} jobs.
  5. The {ml} decider is enabled for policies governing `ml` nodes.
  6. NOTE: For {ml} jobs to open when the cluster is not appropriately
  7. scaled, set `xpack.ml.max_lazy_ml_nodes` to the largest number of possible {ml}
  8. jobs (refer to <<advanced-ml-settings>> for more information). In {ess}, this is
  9. automatically set.
  10. [[autoscaling-machine-learning-decider-settings]]
  11. ==== Configuration settings
  12. Both `num_anomaly_jobs_in_queue` and `num_analytics_jobs_in_queue` are designed
  13. to delay a scale-up event. If the cluster is too small, these settings indicate how many jobs of each type can be
  14. unassigned from a node. Both settings are
  15. only considered for jobs that can be opened given the current scale. If a job is
  16. too large for any node size or if a job can't be assigned without user
  17. intervention (for example, a user calling `_stop` against a real-time
  18. {anomaly-job}), the numbers are ignored for that particular job.
  19. `num_anomaly_jobs_in_queue`::
  20. (Optional, integer)
  21. Specifies the number of queued {anomaly-jobs} to allow. Defaults to `0`.
  22. `num_analytics_jobs_in_queue`::
  23. (Optional, integer)
  24. Specifies the number of queued {dfanalytics-jobs} to allow. Defaults to `0`.
  25. `down_scale_delay`::
  26. (Optional, <<time-units,time value>>)
  27. Specifies the time to delay before scaling down. Defaults to 1 hour. If a scale
  28. down is possible for the entire time window, then a scale down is requested. If
  29. the cluster requires a scale up during the window, the window is reset.
  30. [[autoscaling-machine-learning-decider-examples]]
  31. ==== {api-examples-title}
  32. This example creates an autoscaling policy named `my_autoscaling_policy` that
  33. overrides the default configuration of the {ml} decider.
  34. [source,console]
  35. --------------------------------------------------
  36. PUT /_autoscaling/policy/my_autoscaling_policy
  37. {
  38. "roles" : [ "ml" ],
  39. "deciders": {
  40. "ml": {
  41. "num_anomaly_jobs_in_queue": 5,
  42. "num_analytics_jobs_in_queue": 3,
  43. "down_scale_delay": "30m"
  44. }
  45. }
  46. }
  47. --------------------------------------------------
  48. // TEST
  49. The API returns the following result:
  50. [source,console-result]
  51. --------------------------------------------------
  52. {
  53. "acknowledged": true
  54. }
  55. --------------------------------------------------
  56. //////////////////////////
  57. [source,console]
  58. --------------------------------------------------
  59. DELETE /_autoscaling/policy/my_autoscaling_policy
  60. --------------------------------------------------
  61. // TEST[continued]
  62. //////////////////////////