threadpool.asciidoc 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. [[modules-threadpool]]
  2. == Thread Pool
  3. A node holds several thread pools in order to improve how threads are
  4. managed and memory consumption within a node. There are several thread
  5. pools, but the important ones include:
  6. [horizontal]
  7. `index`::
  8. For index/delete operations, defaults to `fixed`,
  9. size `# of available processors`.
  10. queue_size `200`.
  11. `search`::
  12. For count/search operations, defaults to `fixed`,
  13. size `3x # of available processors`.
  14. queue_size `1000`.
  15. `suggest`::
  16. For suggest operations, defaults to `fixed`,
  17. size `# of available processors`.
  18. queue_size `1000`.
  19. `get`::
  20. For get operations, defaults to `fixed`
  21. size `# of available processors`.
  22. queue_size `1000`.
  23. `bulk`::
  24. For bulk operations, defaults to `fixed`
  25. size `# of available processors`.
  26. queue_size `50`.
  27. `percolate`::
  28. For percolate operations, defaults to `fixed`
  29. size `# of available processors`.
  30. queue_size `1000`.
  31. `snapshot`::
  32. For snapshot/restore operations, defaults to `scaling`
  33. keep-alive `5m`,
  34. size `(# of available processors)/2`.
  35. `warmer`::
  36. For segment warm-up operations, defaults to `scaling`
  37. with a `5m` keep-alive.
  38. `refresh`::
  39. For refresh operations, defaults to `scaling`
  40. with a `5m` keep-alive.
  41. `listener`::
  42. Mainly for java client executing of action when listener threaded is set to true
  43. size `(# of available processors)/2` max at 10.
  44. Changing a specific thread pool can be done by setting its type and
  45. specific type parameters, for example, changing the `index` thread pool
  46. to have more threads:
  47. [source,js]
  48. --------------------------------------------------
  49. threadpool:
  50. index:
  51. type: fixed
  52. size: 30
  53. --------------------------------------------------
  54. NOTE: you can update threadpool settings live using
  55. <<cluster-update-settings>>.
  56. [float]
  57. [[types]]
  58. === Thread pool types
  59. The following are the types of thread pools that can be used and their
  60. respective parameters:
  61. [float]
  62. ==== `cache`
  63. The `cache` thread pool is an unbounded thread pool that will spawn a
  64. thread if there are pending requests. Here is an example of how to set
  65. it:
  66. [source,js]
  67. --------------------------------------------------
  68. threadpool:
  69. index:
  70. type: cached
  71. --------------------------------------------------
  72. [float]
  73. ==== `fixed`
  74. The `fixed` thread pool holds a fixed size of threads to handle the
  75. requests with a queue (optionally bounded) for pending requests that
  76. have no threads to service them.
  77. The `size` parameter controls the number of threads, and defaults to the
  78. number of cores times 5.
  79. The `queue_size` allows to control the size of the queue of pending
  80. requests that have no threads to execute them. By default, it is set to
  81. `-1` which means its unbounded. When a request comes in and the queue is
  82. full, it will abort the request.
  83. [source,js]
  84. --------------------------------------------------
  85. threadpool:
  86. index:
  87. type: fixed
  88. size: 30
  89. queue_size: 1000
  90. --------------------------------------------------
  91. [float]
  92. [[processors]]
  93. === Processors setting
  94. The number of processors is automatically detected, and the thread pool
  95. settings are automatically set based on it. Sometimes, the number of processors
  96. are wrongly detected, in such cases, the number of processors can be
  97. explicitly set using the `processors` setting.
  98. In order to check the number of processors detected, use the nodes info
  99. API with the `os` flag.