circuit_breaker.asciidoc 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. [[circuit-breaker]]
  2. === Circuit Breaker
  3. Elasticsearch contains multiple circuit breakers used to prevent operations from
  4. causing an OutOfMemoryError. Each breaker specifies a limit for how much memory
  5. it can use. Additionally, there is a parent-level breaker that specifies the
  6. total amount of memory that can be used across all breakers.
  7. Except where noted otherwise, these settings can be dynamically updated on a
  8. live cluster with the <<cluster-update-settings,cluster-update-settings>> API.
  9. [[parent-circuit-breaker]]
  10. [float]
  11. ==== Parent circuit breaker
  12. The parent-level breaker can be configured with the following settings:
  13. `indices.breaker.total.use_real_memory`::
  14. _Static_ setting determining whether the parent breaker should take real
  15. memory usage into account (`true`) or only consider the amount that is
  16. reserved by child circuit breakers (`false`). Defaults to `true`.
  17. `indices.breaker.total.limit`::
  18. Starting limit for overall parent breaker, defaults to 70% of JVM heap if
  19. `indices.breaker.total.use_real_memory` is `false`. If `indices.breaker.total.use_real_memory`
  20. is `true`, defaults to 95% of the JVM heap.
  21. [[fielddata-circuit-breaker]]
  22. [float]
  23. ==== Field data circuit breaker
  24. The field data circuit breaker allows Elasticsearch to estimate the amount of
  25. memory a field will require to be loaded into memory. It can then prevent the
  26. field data loading by raising an exception. By default the limit is configured
  27. to 40% of the maximum JVM heap. It can be configured with the following
  28. parameters:
  29. `indices.breaker.fielddata.limit`::
  30. Limit for fielddata breaker, defaults to 40% of JVM heap
  31. `indices.breaker.fielddata.overhead`::
  32. A constant that all field data estimations are multiplied with to determine a
  33. final estimation. Defaults to 1.03
  34. [[request-circuit-breaker]]
  35. [float]
  36. ==== Request circuit breaker
  37. The request circuit breaker allows Elasticsearch to prevent per-request data
  38. structures (for example, memory used for calculating aggregations during a
  39. request) from exceeding a certain amount of memory.
  40. `indices.breaker.request.limit`::
  41. Limit for request breaker, defaults to 60% of JVM heap
  42. `indices.breaker.request.overhead`::
  43. A constant that all request estimations are multiplied with to determine a
  44. final estimation. Defaults to 1
  45. [[in-flight-circuit-breaker]]
  46. [float]
  47. ==== In flight requests circuit breaker
  48. The in flight requests circuit breaker allows Elasticsearch to limit the memory usage of all
  49. currently active incoming requests on transport or HTTP level from exceeding a certain amount of
  50. memory on a node. The memory usage is based on the content length of the request itself. This
  51. circuit breaker also considers that memory is not only needed for representing the raw request but
  52. also as a structured object which is reflected by default overhead.
  53. `network.breaker.inflight_requests.limit`::
  54. Limit for in flight requests breaker, defaults to 100% of JVM heap. This means that it is bound
  55. by the limit configured for the parent circuit breaker.
  56. `network.breaker.inflight_requests.overhead`::
  57. A constant that all in flight requests estimations are multiplied with to determine a
  58. final estimation. Defaults to 2.
  59. [[accounting-circuit-breaker]]
  60. [float]
  61. ==== Accounting requests circuit breaker
  62. The accounting circuit breaker allows Elasticsearch to limit the memory
  63. usage of things held in memory that are not released when a request is
  64. completed. This includes things like the Lucene segment memory.
  65. `indices.breaker.accounting.limit`::
  66. Limit for accounting breaker, defaults to 100% of JVM heap. This means that it is bound
  67. by the limit configured for the parent circuit breaker.
  68. `indices.breaker.accounting.overhead`::
  69. A constant that all accounting estimations are multiplied with to determine a
  70. final estimation. Defaults to 1
  71. [[script-compilation-circuit-breaker]]
  72. [float]
  73. ==== Script compilation circuit breaker
  74. Slightly different than the previous memory-based circuit breaker, the script
  75. compilation circuit breaker limits the number of inline script compilations
  76. within a period of time.
  77. See the "prefer-parameters" section of the <<modules-scripting-using,scripting>>
  78. documentation for more information.
  79. `script.max_compilations_rate`::
  80. Limit for the number of unique dynamic scripts within a certain interval
  81. that are allowed to be compiled. Defaults to 75/5m, meaning 75 every 5
  82. minutes.