threadpool.asciidoc 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. `warmer`::
  32. For segment warm-up operations, defaults to `scaling`
  33. with a `5m` keep-alive.
  34. `refresh`::
  35. For refresh operations, defaults to `scaling`
  36. with a `5m` keep-alive.
  37. Changing a specific thread pool can be done by setting its type and
  38. specific type parameters, for example, changing the `index` thread pool
  39. to have more threads:
  40. [source,js]
  41. --------------------------------------------------
  42. threadpool:
  43. index:
  44. type: fixed
  45. size: 30
  46. --------------------------------------------------
  47. NOTE: you can update threadpool settings live using
  48. <<cluster-update-settings>>.
  49. [float]
  50. [[types]]
  51. === Thread pool types
  52. The following are the types of thread pools that can be used and their
  53. respective parameters:
  54. [float]
  55. ==== `cache`
  56. The `cache` thread pool is an unbounded thread pool that will spawn a
  57. thread if there are pending requests. Here is an example of how to set
  58. it:
  59. [source,js]
  60. --------------------------------------------------
  61. threadpool:
  62. index:
  63. type: cached
  64. --------------------------------------------------
  65. [float]
  66. ==== `fixed`
  67. The `fixed` thread pool holds a fixed size of threads to handle the
  68. requests with a queue (optionally bounded) for pending requests that
  69. have no threads to service them.
  70. The `size` parameter controls the number of threads, and defaults to the
  71. number of cores times 5.
  72. The `queue_size` allows to control the size of the queue of pending
  73. requests that have no threads to execute them. By default, it is set to
  74. `-1` which means its unbounded. When a request comes in and the queue is
  75. full, it will abort the request.
  76. [source,js]
  77. --------------------------------------------------
  78. threadpool:
  79. index:
  80. type: fixed
  81. size: 30
  82. queue_size: 1000
  83. --------------------------------------------------
  84. [float]
  85. [[processors]]
  86. === Processors setting
  87. The number of processors is automatically detected, and the thread pool
  88. settings are automatically set based on it. Sometimes, the number of processors
  89. are wrongly detected, in such cases, the number of processors can be
  90. explicitly set using the `processors` setting.
  91. In order to check the number of processors detected, use the nodes info
  92. API with the `os` flag.