machine-learning-decider.asciidoc 2.6 KB

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