thread_pool.asciidoc 5.3 KB

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