thread_pool.asciidoc 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. [[cat-thread-pool]]
  2. == cat thread pool
  3. The `thread_pool` command shows cluster wide thread pool statistics per node. By default the active, queue and rejected
  4. statistics are returned for all thread pools.
  5. [source,js]
  6. --------------------------------------------------
  7. GET /_cat/thread_pool
  8. --------------------------------------------------
  9. // CONSOLE
  10. Which looks like:
  11. [source,txt]
  12. --------------------------------------------------
  13. node-0 analyze 0 0 0
  14. ...
  15. node-0 fetch_shard_started 0 0 0
  16. node-0 fetch_shard_store 0 0 0
  17. node-0 flush 0 0 0
  18. ...
  19. node-0 write 0 0 0
  20. --------------------------------------------------
  21. // TESTRESPONSE[s/\.\.\./(node-0 \\S+ 0 0 0\n)*/]
  22. // TESTRESPONSE[s/\d+/\\d+/ _cat]
  23. // The substitutions do two things:
  24. // 1. Expect any number of extra thread pools. This allows us to only list a
  25. // few thread pools. The list would be super long otherwise. In addition,
  26. // if xpack is installed then the list will contain more thread pools and
  27. // this way we don't have to assert about them.
  28. // 2. Expect any number of active, queued, or rejected items. We really don't
  29. // know how many there will be and we just want to assert that there are
  30. // numbers in the response, not *which* numbers are there.
  31. The first column is the node name
  32. [source,txt]
  33. --------------------------------------------------
  34. node_name
  35. node-0
  36. --------------------------------------------------
  37. The second column is the thread pool name
  38. [source,txt]
  39. --------------------------------------------------
  40. name
  41. analyze
  42. ccr (default distro only)
  43. fetch_shard_started
  44. fetch_shard_store
  45. flush
  46. force_merge
  47. generic
  48. get
  49. listener
  50. management
  51. ml_autodetect (default distro only)
  52. ml_datafeed (default distro only)
  53. ml_utility (default distro only)
  54. refresh
  55. rollup_indexing (default distro only)`
  56. search
  57. security-token-key (default distro only)
  58. snapshot
  59. warmer
  60. watcher (default distro only)
  61. write
  62. --------------------------------------------------
  63. The next three columns show the active, queue, and rejected statistics for each thread pool
  64. [source,txt]
  65. --------------------------------------------------
  66. active queue rejected
  67. 0 0 0
  68. 0 0 0
  69. 0 0 0
  70. 0 0 0
  71. 0 0 0
  72. 0 0 0
  73. 0 0 0
  74. 0 0 0
  75. 0 0 0
  76. 0 0 0
  77. 1 0 0
  78. 0 0 0
  79. 0 0 0
  80. 0 0 0
  81. 0 0 0
  82. --------------------------------------------------
  83. The cat thread pool API accepts a `thread_pool_patterns` URL parameter for specifying a
  84. comma-separated list of regular expressions to match thread pool names.
  85. [source,js]
  86. --------------------------------------------------
  87. GET /_cat/thread_pool/generic?v&h=id,name,active,rejected,completed
  88. --------------------------------------------------
  89. // CONSOLE
  90. which looks like:
  91. [source,txt]
  92. --------------------------------------------------
  93. id name active rejected completed
  94. 0EWUhXeBQtaVGlexUeVwMg generic 0 0 70
  95. --------------------------------------------------
  96. // TESTRESPONSE[s/0EWUhXeBQtaVGlexUeVwMg/[\\w-]+/ s/\d+/\\d+/ _cat]
  97. Here the host columns and the active, rejected and completed suggest thread pool statistics are displayed.
  98. All <<modules-threadpool,built-in thread pools>> and custom thread pools are available.
  99. [float]
  100. ==== Thread Pool Fields
  101. For each thread pool, you can load details about it by using the field names
  102. in the table below.
  103. [cols="<,<,<",options="header"]
  104. |=======================================================================
  105. |Field Name |Alias |Description
  106. |`type` |`t` |The current (*) type of thread pool (`fixed` or `scaling`)
  107. |`active` |`a` |The number of active threads in the current thread pool
  108. |`pool_size` |`psz` |The number of threads in the current thread pool
  109. |`queue` |`q` |The number of tasks in the queue for the current thread pool
  110. |`queue_size` |`qs` |The maximum number of tasks permitted in the queue for the current thread pool
  111. |`rejected` |`r` |The number of tasks rejected by the thread pool executor
  112. |`largest` |`l` |The highest number of active threads in the current thread pool
  113. |`completed` |`c` |The number of tasks completed by the thread pool executor
  114. |`core` |`cr` |The configured core number of active threads allowed in the current thread pool
  115. |`max` |`mx` |The configured maximum number of active threads allowed in the current thread pool
  116. |`size` |`sz` |The configured fixed number of active threads allowed in the current thread pool
  117. |`keep_alive` |`k` |The configured keep alive time for threads
  118. |=======================================================================
  119. [float]
  120. === Other Fields
  121. In addition to details about each thread pool, it is also convenient to get an
  122. understanding of where those thread pools reside. As such, you can request
  123. other details like the `ip` of the responding node(s).
  124. [cols="<,<,<",options="header"]
  125. |=======================================================================
  126. |Field Name |Alias |Description
  127. |`node_id` |`id` |The unique node ID
  128. |`ephemeral_id`|`eid` |The ephemeral node ID
  129. |`pid` |`p` |The process ID of the running node
  130. |`host` |`h` |The hostname for the current node
  131. |`ip` |`i` |The IP address for the current node
  132. |`port` |`po` |The bound transport port for the current node
  133. |=======================================================================