estimate-memory-usage-dfanalytics.asciidoc 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[estimate-memory-usage-dfanalytics]]
  4. === Estimate memory usage API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Estimate memory usage for {dfanalytics-jobs}</titleabbrev>
  8. ++++
  9. Estimates memory usage for the given {dataframe-analytics-config}.
  10. experimental[]
  11. [[ml-estimate-memory-usage-dfanalytics-request]]
  12. ==== {api-request-title}
  13. `POST _ml/data_frame/analytics/_estimate_memory_usage`
  14. [[ml-estimate-memory-usage-dfanalytics-prereq]]
  15. ==== {api-prereq-title}
  16. * You must have `monitor_ml` privilege to use this API. For more
  17. information, see {stack-ov}/security-privileges.html[Security privileges] and
  18. {stack-ov}/built-in-roles.html[Built-in roles].
  19. [[ml-estimate-memory-usage-dfanalytics-desc]]
  20. ==== {api-description-title}
  21. This API estimates memory usage for the given {dataframe-analytics-config} before the {dfanalytics-job} is even created.
  22. Serves as an advice on how to set `model_memory_limit` when creating {dfanalytics-job}.
  23. [[ml-estimate-memory-usage-dfanalytics-request-body]]
  24. ==== {api-request-body-title}
  25. `data_frame_analytics_config`::
  26. (Required, object) Intended configuration of {dfanalytics-job}. For more information, see
  27. <<ml-dfanalytics-resources>>.
  28. Note that `id` and `dest` don't need to be provided in the context of this API.
  29. [[ml-estimate-memory-usage-dfanalytics-results]]
  30. ==== {api-response-body-title}
  31. `expected_memory_without_disk`::
  32. (string) Estimated memory usage under the assumption that the whole {dfanalytics} should happen in memory
  33. (i.e. without overflowing to disk).
  34. `expected_memory_with_disk`::
  35. (string) Estimated memory usage under the assumption that overflowing to disk is allowed during {dfanalytics}.
  36. `expected_memory_with_disk` is usually smaller than `expected_memory_without_disk` as using disk allows to
  37. limit the main memory needed to perform {dfanalytics}.
  38. [[ml-estimate-memory-usage-dfanalytics-example]]
  39. ==== {api-examples-title}
  40. [source,console]
  41. --------------------------------------------------
  42. POST _ml/data_frame/analytics/_estimate_memory_usage
  43. {
  44. "data_frame_analytics_config": {
  45. "source": {
  46. "index": "logdata"
  47. },
  48. "analysis": {
  49. "outlier_detection": {}
  50. }
  51. }
  52. }
  53. --------------------------------------------------
  54. // TEST[skip:TBD]
  55. The API returns the following results:
  56. [source,console-result]
  57. ----
  58. {
  59. "expected_memory_without_disk": "128MB",
  60. "expected_memory_with_disk": "32MB"
  61. }
  62. ----